tizen beta release
[framework/web/webkit-efl.git] / debian / libwebkit-engine / usr / share / ewebkit-0 / webinspector / InspectorFrontendHostStub.js
1 /*
2  * Copyright (C) 2009 Google Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  *     * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *     * Redistributions in binary form must reproduce the above
11  * copyright notice, this list of conditions and the following disclaimer
12  * in the documentation and/or other materials provided with the
13  * distribution.
14  *     * Neither the name of Google Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30
31 if (!window.InspectorFrontendHost) {
32
33 /**
34  * @constructor
35  */
36 WebInspector.InspectorFrontendHostStub = function()
37 {
38     this._attachedWindowHeight = 0;
39 }
40
41 WebInspector.InspectorFrontendHostStub.prototype = {
42     platform: function()
43     {
44         var match = navigator.userAgent.match(/Windows NT/);
45         if (match)
46             return "windows";
47         match = navigator.userAgent.match(/Mac OS X/);
48         if (match)
49             return "mac";
50         return "linux";
51     },
52
53     port: function()
54     {
55         return "unknown";
56     },
57
58     bringToFront: function()
59     {
60         this._windowVisible = true;
61     },
62
63     closeWindow: function()
64     {
65         this._windowVisible = false;
66     },
67
68     attach: function()
69     {
70     },
71
72     detach: function()
73     {
74     },
75
76     search: function(sourceRow, query)
77     {
78     },
79
80     setAttachedWindowHeight: function(height)
81     {
82     },
83
84     moveWindowBy: function(x, y)
85     {
86     },
87
88     setExtensionAPI: function(script)
89     {
90     },
91
92     loaded: function()
93     {
94     },
95
96     localizedStringsURL: function()
97     {
98         return undefined;
99     },
100
101     hiddenPanels: function()
102     {
103         return "";
104     },
105
106     inspectedURLChanged: function(url)
107     {
108         document.title = WebInspector.UIString(Preferences.applicationTitle, url);
109     },
110
111     copyText: function()
112     {
113     },
114
115     saveAs: function(fileName, content)
116     {
117         var builder = new WebKitBlobBuilder();
118         builder.append(content);
119         var blob = builder.getBlob("application/octet-stream");
120
121         var fr = new FileReader();
122         fr.onload = function(e) {
123             // Force download
124             window.location = this.result;
125         }
126         fr.readAsDataURL(blob);
127     },
128
129     canAttachWindow: function()
130     {
131         return false;
132     },
133
134     sendMessageToBackend: function(message)
135     {
136     },
137
138     recordActionTaken: function(actionCode)
139     {
140     },
141
142     recordPanelShown: function(panelCode)
143     {
144     },
145
146     recordSettingChanged: function(settingCode)
147     {
148     },
149
150     loadResourceSynchronously: function(url)
151     {
152         return "";
153     }
154 }
155
156 var InspectorFrontendHost = new WebInspector.InspectorFrontendHostStub();
157 Preferences.localizeUI = false;
158
159 }