| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 : public content::WebContentsObserver { | 300 : public content::WebContentsObserver { |
| 301 public: | 301 public: |
| 302 explicit FrontendWebContentsObserver(DevToolsUIBindings* ui_bindings); | 302 explicit FrontendWebContentsObserver(DevToolsUIBindings* ui_bindings); |
| 303 ~FrontendWebContentsObserver() override; | 303 ~FrontendWebContentsObserver() override; |
| 304 | 304 |
| 305 private: | 305 private: |
| 306 // contents::WebContentsObserver: | 306 // contents::WebContentsObserver: |
| 307 void RenderProcessGone(base::TerminationStatus status) override; | 307 void RenderProcessGone(base::TerminationStatus status) override; |
| 308 void DidStartNavigationToPendingEntry( | 308 void DidStartNavigationToPendingEntry( |
| 309 const GURL& url, | 309 const GURL& url, |
| 310 content::NavigationController::ReloadType reload_type) override; | 310 content::ReloadType reload_type) override; |
| 311 void DocumentAvailableInMainFrame() override; | 311 void DocumentAvailableInMainFrame() override; |
| 312 void DocumentOnLoadCompletedInMainFrame() override; | 312 void DocumentOnLoadCompletedInMainFrame() override; |
| 313 void DidNavigateMainFrame( | 313 void DidNavigateMainFrame( |
| 314 const content::LoadCommittedDetails& details, | 314 const content::LoadCommittedDetails& details, |
| 315 const content::FrameNavigateParams& params) override; | 315 const content::FrameNavigateParams& params) override; |
| 316 | 316 |
| 317 DevToolsUIBindings* devtools_bindings_; | 317 DevToolsUIBindings* devtools_bindings_; |
| 318 DISALLOW_COPY_AND_ASSIGN(FrontendWebContentsObserver); | 318 DISALLOW_COPY_AND_ASSIGN(FrontendWebContentsObserver); |
| 319 }; | 319 }; |
| 320 | 320 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 343 devtools_bindings_->Detach(); | 343 devtools_bindings_->Detach(); |
| 344 break; | 344 break; |
| 345 default: | 345 default: |
| 346 crashed = false; | 346 crashed = false; |
| 347 break; | 347 break; |
| 348 } | 348 } |
| 349 devtools_bindings_->delegate_->RenderProcessGone(crashed); | 349 devtools_bindings_->delegate_->RenderProcessGone(crashed); |
| 350 } | 350 } |
| 351 | 351 |
| 352 void DevToolsUIBindings::FrontendWebContentsObserver:: | 352 void DevToolsUIBindings::FrontendWebContentsObserver:: |
| 353 DidStartNavigationToPendingEntry( | 353 DidStartNavigationToPendingEntry(const GURL& url, |
| 354 const GURL& url, | 354 content::ReloadType reload_type) { |
| 355 content::NavigationController::ReloadType reload_type) { | |
| 356 devtools_bindings_->frontend_host_.reset( | 355 devtools_bindings_->frontend_host_.reset( |
| 357 content::DevToolsFrontendHost::Create( | 356 content::DevToolsFrontendHost::Create( |
| 358 web_contents()->GetMainFrame(), | 357 web_contents()->GetMainFrame(), |
| 359 base::Bind(&DevToolsUIBindings::HandleMessageFromDevToolsFrontend, | 358 base::Bind(&DevToolsUIBindings::HandleMessageFromDevToolsFrontend, |
| 360 base::Unretained(devtools_bindings_)))); | 359 base::Unretained(devtools_bindings_)))); |
| 361 } | 360 } |
| 362 | 361 |
| 363 void DevToolsUIBindings::FrontendWebContentsObserver:: | 362 void DevToolsUIBindings::FrontendWebContentsObserver:: |
| 364 DocumentAvailableInMainFrame() { | 363 DocumentAvailableInMainFrame() { |
| 365 devtools_bindings_->DocumentAvailableInMainFrame(); | 364 devtools_bindings_->DocumentAvailableInMainFrame(); |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 void DevToolsUIBindings::FrontendLoaded() { | 1135 void DevToolsUIBindings::FrontendLoaded() { |
| 1137 if (frontend_loaded_) | 1136 if (frontend_loaded_) |
| 1138 return; | 1137 return; |
| 1139 frontend_loaded_ = true; | 1138 frontend_loaded_ = true; |
| 1140 | 1139 |
| 1141 // Call delegate first - it seeds importants bit of information. | 1140 // Call delegate first - it seeds importants bit of information. |
| 1142 delegate_->OnLoadCompleted(); | 1141 delegate_->OnLoadCompleted(); |
| 1143 | 1142 |
| 1144 AddDevToolsExtensionsToClient(); | 1143 AddDevToolsExtensionsToClient(); |
| 1145 } | 1144 } |
| OLD | NEW |