| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 class DefaultBindingsDelegate : public DevToolsUIBindings::Delegate { | 181 class DefaultBindingsDelegate : public DevToolsUIBindings::Delegate { |
| 182 public: | 182 public: |
| 183 explicit DefaultBindingsDelegate(content::WebContents* web_contents) | 183 explicit DefaultBindingsDelegate(content::WebContents* web_contents) |
| 184 : web_contents_(web_contents) {} | 184 : web_contents_(web_contents) {} |
| 185 | 185 |
| 186 private: | 186 private: |
| 187 virtual ~DefaultBindingsDelegate() {} | 187 virtual ~DefaultBindingsDelegate() {} |
| 188 | 188 |
| 189 virtual void ActivateWindow() OVERRIDE; | 189 virtual void ActivateWindow() OVERRIDE; |
| 190 virtual void CloseWindow() OVERRIDE {} | 190 virtual void CloseWindow() OVERRIDE {} |
| 191 virtual void SetContentsInsets( | 191 virtual void SetInspectedPageBounds(const gfx::Rect& rect) OVERRIDE {} |
| 192 int left, int top, int right, int bottom) OVERRIDE {} | |
| 193 virtual void SetContentsResizingStrategy( | 192 virtual void SetContentsResizingStrategy( |
| 194 const gfx::Insets& insets, const gfx::Size& min_size) OVERRIDE {} | 193 const gfx::Insets& insets, const gfx::Size& min_size) OVERRIDE {} |
| 195 virtual void InspectElementCompleted() OVERRIDE {} | 194 virtual void InspectElementCompleted() OVERRIDE {} |
| 196 virtual void MoveWindow(int x, int y) OVERRIDE {} | 195 virtual void MoveWindow(int x, int y) OVERRIDE {} |
| 197 virtual void SetIsDocked(bool is_docked) OVERRIDE {} | 196 virtual void SetIsDocked(bool is_docked) OVERRIDE {} |
| 198 virtual void OpenInNewTab(const std::string& url) OVERRIDE; | 197 virtual void OpenInNewTab(const std::string& url) OVERRIDE; |
| 199 virtual void SetWhitelistedShortcuts(const std::string& message) OVERRIDE {} | 198 virtual void SetWhitelistedShortcuts(const std::string& message) OVERRIDE {} |
| 200 | 199 |
| 201 virtual void InspectedContentsClosing() OVERRIDE; | 200 virtual void InspectedContentsClosing() OVERRIDE; |
| 202 virtual void OnLoadCompleted() OVERRIDE {} | 201 virtual void OnLoadCompleted() OVERRIDE {} |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 407 } |
| 409 | 408 |
| 410 void DevToolsUIBindings::ActivateWindow() { | 409 void DevToolsUIBindings::ActivateWindow() { |
| 411 delegate_->ActivateWindow(); | 410 delegate_->ActivateWindow(); |
| 412 } | 411 } |
| 413 | 412 |
| 414 void DevToolsUIBindings::CloseWindow() { | 413 void DevToolsUIBindings::CloseWindow() { |
| 415 delegate_->CloseWindow(); | 414 delegate_->CloseWindow(); |
| 416 } | 415 } |
| 417 | 416 |
| 418 void DevToolsUIBindings::SetContentsInsets( | 417 void DevToolsUIBindings::SetInspectedPageBounds(const gfx::Rect& rect) { |
| 419 int top, int left, int bottom, int right) { | 418 delegate_->SetInspectedPageBounds(rect); |
| 420 delegate_->SetContentsInsets(top, left, bottom, right); | |
| 421 } | 419 } |
| 422 | 420 |
| 423 void DevToolsUIBindings::SetContentsResizingStrategy( | 421 void DevToolsUIBindings::SetContentsResizingStrategy( |
| 424 const gfx::Insets& insets, const gfx::Size& min_size) { | 422 const gfx::Insets& insets, const gfx::Size& min_size) { |
| 425 delegate_->SetContentsResizingStrategy(insets, min_size); | 423 delegate_->SetContentsResizingStrategy(insets, min_size); |
| 426 } | 424 } |
| 427 | 425 |
| 428 void DevToolsUIBindings::MoveWindow(int x, int y) { | 426 void DevToolsUIBindings::MoveWindow(int x, int y) { |
| 429 delegate_->MoveWindow(x, y); | 427 delegate_->MoveWindow(x, y); |
| 430 } | 428 } |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 NULL); | 818 NULL); |
| 821 } | 819 } |
| 822 | 820 |
| 823 void DevToolsUIBindings::DocumentOnLoadCompletedInMainFrame() { | 821 void DevToolsUIBindings::DocumentOnLoadCompletedInMainFrame() { |
| 824 // Call delegate first - it seeds importants bit of information. | 822 // Call delegate first - it seeds importants bit of information. |
| 825 delegate_->OnLoadCompleted(); | 823 delegate_->OnLoadCompleted(); |
| 826 | 824 |
| 827 UpdateTheme(); | 825 UpdateTheme(); |
| 828 AddDevToolsExtensionsToClient(); | 826 AddDevToolsExtensionsToClient(); |
| 829 } | 827 } |
| OLD | NEW |