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 #include "chrome/browser/devtools/devtools_window.h" | 5 #include "chrome/browser/devtools/devtools_window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 // DevToolsToolboxDelegate ---------------------------------------------------- | 84 // DevToolsToolboxDelegate ---------------------------------------------------- |
85 | 85 |
86 class DevToolsToolboxDelegate | 86 class DevToolsToolboxDelegate |
87 : public content::WebContentsObserver, | 87 : public content::WebContentsObserver, |
88 public content::WebContentsDelegate { | 88 public content::WebContentsDelegate { |
89 public: | 89 public: |
90 DevToolsToolboxDelegate( | 90 DevToolsToolboxDelegate( |
91 WebContents* toolbox_contents, | 91 WebContents* toolbox_contents, |
92 DevToolsWindow::ObserverWithAccessor* web_contents_observer); | 92 DevToolsWindow::ObserverWithAccessor* web_contents_observer); |
93 virtual ~DevToolsToolboxDelegate(); | 93 ~DevToolsToolboxDelegate() override; |
94 | 94 |
95 virtual content::WebContents* OpenURLFromTab( | 95 content::WebContents* OpenURLFromTab( |
96 content::WebContents* source, | 96 content::WebContents* source, |
97 const content::OpenURLParams& params) override; | 97 const content::OpenURLParams& params) override; |
98 virtual bool PreHandleKeyboardEvent( | 98 bool PreHandleKeyboardEvent(content::WebContents* source, |
99 content::WebContents* source, | 99 const content::NativeWebKeyboardEvent& event, |
100 const content::NativeWebKeyboardEvent& event, | 100 bool* is_keyboard_shortcut) override; |
101 bool* is_keyboard_shortcut) override; | 101 void HandleKeyboardEvent( |
102 virtual void HandleKeyboardEvent( | |
103 content::WebContents* source, | 102 content::WebContents* source, |
104 const content::NativeWebKeyboardEvent& event) override; | 103 const content::NativeWebKeyboardEvent& event) override; |
105 virtual void WebContentsDestroyed() override; | 104 void WebContentsDestroyed() override; |
106 | 105 |
107 private: | 106 private: |
108 BrowserWindow* GetInspectedBrowserWindow(); | 107 BrowserWindow* GetInspectedBrowserWindow(); |
109 DevToolsWindow::ObserverWithAccessor* inspected_contents_observer_; | 108 DevToolsWindow::ObserverWithAccessor* inspected_contents_observer_; |
110 DISALLOW_COPY_AND_ASSIGN(DevToolsToolboxDelegate); | 109 DISALLOW_COPY_AND_ASSIGN(DevToolsToolboxDelegate); |
111 }; | 110 }; |
112 | 111 |
113 DevToolsToolboxDelegate::DevToolsToolboxDelegate( | 112 DevToolsToolboxDelegate::DevToolsToolboxDelegate( |
114 WebContents* toolbox_contents, | 113 WebContents* toolbox_contents, |
115 DevToolsWindow::ObserverWithAccessor* web_contents_observer) | 114 DevToolsWindow::ObserverWithAccessor* web_contents_observer) |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 closure.Run(); | 1226 closure.Run(); |
1228 return; | 1227 return; |
1229 } | 1228 } |
1230 load_completed_callback_ = closure; | 1229 load_completed_callback_ = closure; |
1231 } | 1230 } |
1232 | 1231 |
1233 bool DevToolsWindow::ForwardKeyboardEvent( | 1232 bool DevToolsWindow::ForwardKeyboardEvent( |
1234 const content::NativeWebKeyboardEvent& event) { | 1233 const content::NativeWebKeyboardEvent& event) { |
1235 return event_forwarder_->ForwardEvent(event); | 1234 return event_forwarder_->ForwardEvent(event); |
1236 } | 1235 } |
OLD | NEW |