OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_ui_bindings.h" | 5 #include "chrome/browser/devtools/devtools_ui_bindings.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 public: | 176 public: |
177 explicit DefaultBindingsDelegate(content::WebContents* web_contents) | 177 explicit DefaultBindingsDelegate(content::WebContents* web_contents) |
178 : web_contents_(web_contents) {} | 178 : web_contents_(web_contents) {} |
179 | 179 |
180 private: | 180 private: |
181 virtual ~DefaultBindingsDelegate() {} | 181 virtual ~DefaultBindingsDelegate() {} |
182 | 182 |
183 virtual void ActivateWindow() OVERRIDE; | 183 virtual void ActivateWindow() OVERRIDE; |
184 virtual void CloseWindow() OVERRIDE {} | 184 virtual void CloseWindow() OVERRIDE {} |
185 virtual void SetInspectedPageBounds(const gfx::Rect& rect) OVERRIDE {} | 185 virtual void SetInspectedPageBounds(const gfx::Rect& rect) OVERRIDE {} |
186 virtual void SetContentsResizingStrategy( | |
187 const gfx::Insets& insets, const gfx::Size& min_size) OVERRIDE {} | |
188 virtual void InspectElementCompleted() OVERRIDE {} | 186 virtual void InspectElementCompleted() OVERRIDE {} |
189 virtual void MoveWindow(int x, int y) OVERRIDE {} | 187 virtual void MoveWindow(int x, int y) OVERRIDE {} |
190 virtual void SetIsDocked(bool is_docked) OVERRIDE {} | 188 virtual void SetIsDocked(bool is_docked) OVERRIDE {} |
191 virtual void OpenInNewTab(const std::string& url) OVERRIDE; | 189 virtual void OpenInNewTab(const std::string& url) OVERRIDE; |
192 virtual void SetWhitelistedShortcuts(const std::string& message) OVERRIDE {} | 190 virtual void SetWhitelistedShortcuts(const std::string& message) OVERRIDE {} |
193 | 191 |
194 virtual void InspectedContentsClosing() OVERRIDE; | 192 virtual void InspectedContentsClosing() OVERRIDE; |
195 virtual void OnLoadCompleted() OVERRIDE {} | 193 virtual void OnLoadCompleted() OVERRIDE {} |
196 virtual InfoBarService* GetInfoBarService() OVERRIDE; | 194 virtual InfoBarService* GetInfoBarService() OVERRIDE; |
197 virtual void RenderProcessGone() OVERRIDE {} | 195 virtual void RenderProcessGone() OVERRIDE {} |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 } | 427 } |
430 | 428 |
431 void DevToolsUIBindings::CloseWindow() { | 429 void DevToolsUIBindings::CloseWindow() { |
432 delegate_->CloseWindow(); | 430 delegate_->CloseWindow(); |
433 } | 431 } |
434 | 432 |
435 void DevToolsUIBindings::SetInspectedPageBounds(const gfx::Rect& rect) { | 433 void DevToolsUIBindings::SetInspectedPageBounds(const gfx::Rect& rect) { |
436 delegate_->SetInspectedPageBounds(rect); | 434 delegate_->SetInspectedPageBounds(rect); |
437 } | 435 } |
438 | 436 |
439 void DevToolsUIBindings::SetContentsResizingStrategy( | |
440 const gfx::Insets& insets, const gfx::Size& min_size) { | |
441 delegate_->SetContentsResizingStrategy(insets, min_size); | |
442 } | |
443 | |
444 void DevToolsUIBindings::MoveWindow(int x, int y) { | 437 void DevToolsUIBindings::MoveWindow(int x, int y) { |
445 delegate_->MoveWindow(x, y); | 438 delegate_->MoveWindow(x, y); |
446 } | 439 } |
447 | 440 |
448 void DevToolsUIBindings::SetIsDocked(bool dock_requested) { | 441 void DevToolsUIBindings::SetIsDocked(bool dock_requested) { |
449 delegate_->SetIsDocked(dock_requested); | 442 delegate_->SetIsDocked(dock_requested); |
450 } | 443 } |
451 | 444 |
452 void DevToolsUIBindings::InspectElementCompleted() { | 445 void DevToolsUIBindings::InspectElementCompleted() { |
453 delegate_->InspectElementCompleted(); | 446 delegate_->InspectElementCompleted(); |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 web_contents_->GetMainFrame()->ExecuteJavaScript(javascript); | 802 web_contents_->GetMainFrame()->ExecuteJavaScript(javascript); |
810 } | 803 } |
811 | 804 |
812 void DevToolsUIBindings::DocumentOnLoadCompletedInMainFrame() { | 805 void DevToolsUIBindings::DocumentOnLoadCompletedInMainFrame() { |
813 // Call delegate first - it seeds importants bit of information. | 806 // Call delegate first - it seeds importants bit of information. |
814 delegate_->OnLoadCompleted(); | 807 delegate_->OnLoadCompleted(); |
815 | 808 |
816 UpdateTheme(); | 809 UpdateTheme(); |
817 AddDevToolsExtensionsToClient(); | 810 AddDevToolsExtensionsToClient(); |
818 } | 811 } |
OLD | NEW |