OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ |
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ |
7 | 7 |
8 #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h" | 8 #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h" |
9 #include "chrome/browser/devtools/devtools_toggle_action.h" | 9 #include "chrome/browser/devtools/devtools_toggle_action.h" |
10 #include "chrome/browser/devtools/devtools_ui_bindings.h" | 10 #include "chrome/browser/devtools/devtools_ui_bindings.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 namespace user_prefs { | 25 namespace user_prefs { |
26 class PrefRegistrySyncable; | 26 class PrefRegistrySyncable; |
27 } | 27 } |
28 | 28 |
29 class DevToolsWindow : public DevToolsUIBindings::Delegate, | 29 class DevToolsWindow : public DevToolsUIBindings::Delegate, |
30 public content::WebContentsDelegate { | 30 public content::WebContentsDelegate { |
31 public: | 31 public: |
32 class ObserverWithAccessor : public content::WebContentsObserver { | 32 class ObserverWithAccessor : public content::WebContentsObserver { |
33 public: | 33 public: |
34 explicit ObserverWithAccessor(content::WebContents* web_contents); | 34 explicit ObserverWithAccessor(content::WebContents* web_contents); |
35 virtual ~ObserverWithAccessor(); | 35 ~ObserverWithAccessor() override; |
36 | 36 |
37 private: | 37 private: |
38 DISALLOW_COPY_AND_ASSIGN(ObserverWithAccessor); | 38 DISALLOW_COPY_AND_ASSIGN(ObserverWithAccessor); |
39 }; | 39 }; |
40 | 40 |
41 static const char kDevToolsApp[]; | 41 static const char kDevToolsApp[]; |
42 | 42 |
43 virtual ~DevToolsWindow(); | 43 ~DevToolsWindow() override; |
44 | 44 |
45 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 45 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
46 | 46 |
47 // Return the DevToolsWindow for the given WebContents if one exists, | 47 // Return the DevToolsWindow for the given WebContents if one exists, |
48 // otherwise NULL. | 48 // otherwise NULL. |
49 static DevToolsWindow* GetInstanceForInspectedWebContents( | 49 static DevToolsWindow* GetInstanceForInspectedWebContents( |
50 content::WebContents* inspected_web_contents); | 50 content::WebContents* inspected_web_contents); |
51 | 51 |
52 // Return the docked DevTools WebContents for the given inspected WebContents | 52 // Return the docked DevTools WebContents for the given inspected WebContents |
53 // if one exists and should be shown in browser window, otherwise NULL. | 53 // if one exists and should be shown in browser window, otherwise NULL. |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 static DevToolsWindow* FindDevToolsWindow(content::DevToolsAgentHost*); | 219 static DevToolsWindow* FindDevToolsWindow(content::DevToolsAgentHost*); |
220 static DevToolsWindow* AsDevToolsWindow(content::WebContents*); | 220 static DevToolsWindow* AsDevToolsWindow(content::WebContents*); |
221 static DevToolsWindow* CreateDevToolsWindowForWorker(Profile* profile); | 221 static DevToolsWindow* CreateDevToolsWindowForWorker(Profile* profile); |
222 static DevToolsWindow* ToggleDevToolsWindow( | 222 static DevToolsWindow* ToggleDevToolsWindow( |
223 content::WebContents* web_contents, | 223 content::WebContents* web_contents, |
224 bool force_open, | 224 bool force_open, |
225 const DevToolsToggleAction& action, | 225 const DevToolsToggleAction& action, |
226 const std::string& settings); | 226 const std::string& settings); |
227 | 227 |
228 // content::WebContentsDelegate: | 228 // content::WebContentsDelegate: |
229 virtual content::WebContents* OpenURLFromTab( | 229 content::WebContents* OpenURLFromTab( |
230 content::WebContents* source, | 230 content::WebContents* source, |
231 const content::OpenURLParams& params) override; | 231 const content::OpenURLParams& params) override; |
232 virtual void ActivateContents(content::WebContents* contents) override; | 232 void ActivateContents(content::WebContents* contents) override; |
233 virtual void AddNewContents(content::WebContents* source, | 233 void AddNewContents(content::WebContents* source, |
234 content::WebContents* new_contents, | 234 content::WebContents* new_contents, |
235 WindowOpenDisposition disposition, | 235 WindowOpenDisposition disposition, |
236 const gfx::Rect& initial_pos, | 236 const gfx::Rect& initial_pos, |
237 bool user_gesture, | 237 bool user_gesture, |
238 bool* was_blocked) override; | 238 bool* was_blocked) override; |
239 virtual void WebContentsCreated(content::WebContents* source_contents, | 239 void WebContentsCreated(content::WebContents* source_contents, |
240 int opener_render_frame_id, | 240 int opener_render_frame_id, |
241 const base::string16& frame_name, | 241 const base::string16& frame_name, |
242 const GURL& target_url, | 242 const GURL& target_url, |
243 content::WebContents* new_contents) override; | 243 content::WebContents* new_contents) override; |
244 virtual void CloseContents(content::WebContents* source) override; | 244 void CloseContents(content::WebContents* source) override; |
245 virtual void ContentsZoomChange(bool zoom_in) override; | 245 void ContentsZoomChange(bool zoom_in) override; |
246 virtual void BeforeUnloadFired(content::WebContents* tab, | 246 void BeforeUnloadFired(content::WebContents* tab, |
247 bool proceed, | 247 bool proceed, |
248 bool* proceed_to_fire_unload) override; | 248 bool* proceed_to_fire_unload) override; |
249 virtual bool PreHandleKeyboardEvent( | 249 bool PreHandleKeyboardEvent(content::WebContents* source, |
250 content::WebContents* source, | 250 const content::NativeWebKeyboardEvent& event, |
251 const content::NativeWebKeyboardEvent& event, | 251 bool* is_keyboard_shortcut) override; |
252 bool* is_keyboard_shortcut) override; | 252 void HandleKeyboardEvent( |
253 virtual void HandleKeyboardEvent( | |
254 content::WebContents* source, | 253 content::WebContents* source, |
255 const content::NativeWebKeyboardEvent& event) override; | 254 const content::NativeWebKeyboardEvent& event) override; |
256 virtual content::JavaScriptDialogManager* | 255 content::JavaScriptDialogManager* GetJavaScriptDialogManager() override; |
257 GetJavaScriptDialogManager() override; | 256 content::ColorChooser* OpenColorChooser( |
258 virtual content::ColorChooser* OpenColorChooser( | |
259 content::WebContents* web_contents, | 257 content::WebContents* web_contents, |
260 SkColor color, | 258 SkColor color, |
261 const std::vector<content::ColorSuggestion>& suggestions) override; | 259 const std::vector<content::ColorSuggestion>& suggestions) override; |
262 virtual void RunFileChooser( | 260 void RunFileChooser(content::WebContents* web_contents, |
263 content::WebContents* web_contents, | 261 const content::FileChooserParams& params) override; |
264 const content::FileChooserParams& params) override; | 262 void WebContentsFocused(content::WebContents* contents) override; |
265 virtual void WebContentsFocused(content::WebContents* contents) override; | 263 bool PreHandleGestureEvent(content::WebContents* source, |
266 virtual bool PreHandleGestureEvent( | 264 const blink::WebGestureEvent& event) override; |
267 content::WebContents* source, | |
268 const blink::WebGestureEvent& event) override; | |
269 | 265 |
270 // content::DevToolsUIBindings::Delegate overrides | 266 // content::DevToolsUIBindings::Delegate overrides |
271 virtual void ActivateWindow() override; | 267 void ActivateWindow() override; |
272 virtual void CloseWindow() override; | 268 void CloseWindow() override; |
273 virtual void SetInspectedPageBounds(const gfx::Rect& rect) override; | 269 void SetInspectedPageBounds(const gfx::Rect& rect) override; |
274 virtual void InspectElementCompleted() override; | 270 void InspectElementCompleted() override; |
275 virtual void MoveWindow(int x, int y) override; | 271 void MoveWindow(int x, int y) override; |
276 virtual void SetIsDocked(bool is_docked) override; | 272 void SetIsDocked(bool is_docked) override; |
277 virtual void OpenInNewTab(const std::string& url) override; | 273 void OpenInNewTab(const std::string& url) override; |
278 virtual void SetWhitelistedShortcuts(const std::string& message) override; | 274 void SetWhitelistedShortcuts(const std::string& message) override; |
279 virtual void InspectedContentsClosing() override; | 275 void InspectedContentsClosing() override; |
280 virtual void OnLoadCompleted() override; | 276 void OnLoadCompleted() override; |
281 virtual InfoBarService* GetInfoBarService() override; | 277 InfoBarService* GetInfoBarService() override; |
282 virtual void RenderProcessGone() override; | 278 void RenderProcessGone() override; |
283 | 279 |
284 void CreateDevToolsBrowser(); | 280 void CreateDevToolsBrowser(); |
285 BrowserWindow* GetInspectedBrowserWindow(); | 281 BrowserWindow* GetInspectedBrowserWindow(); |
286 void ScheduleShow(const DevToolsToggleAction& action); | 282 void ScheduleShow(const DevToolsToggleAction& action); |
287 void Show(const DevToolsToggleAction& action); | 283 void Show(const DevToolsToggleAction& action); |
288 void DoAction(const DevToolsToggleAction& action); | 284 void DoAction(const DevToolsToggleAction& action); |
289 void LoadCompleted(); | 285 void LoadCompleted(); |
290 void UpdateBrowserToolbar(); | 286 void UpdateBrowserToolbar(); |
291 void UpdateBrowserWindow(); | 287 void UpdateBrowserWindow(); |
292 content::WebContents* GetInspectedWebContents(); | 288 content::WebContents* GetInspectedWebContents(); |
(...skipping 17 matching lines...) Expand all Loading... |
310 base::Closure close_callback_; | 306 base::Closure close_callback_; |
311 | 307 |
312 base::TimeTicks inspect_element_start_time_; | 308 base::TimeTicks inspect_element_start_time_; |
313 scoped_ptr<DevToolsEventForwarder> event_forwarder_; | 309 scoped_ptr<DevToolsEventForwarder> event_forwarder_; |
314 | 310 |
315 friend class DevToolsEventForwarder; | 311 friend class DevToolsEventForwarder; |
316 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); | 312 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); |
317 }; | 313 }; |
318 | 314 |
319 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ | 315 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ |
OLD | NEW |