| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 : public content::WebContentsObserver { | 298 : public content::WebContentsObserver { |
| 299 public: | 299 public: |
| 300 explicit FrontendWebContentsObserver(DevToolsUIBindings* ui_bindings); | 300 explicit FrontendWebContentsObserver(DevToolsUIBindings* ui_bindings); |
| 301 ~FrontendWebContentsObserver() override; | 301 ~FrontendWebContentsObserver() override; |
| 302 | 302 |
| 303 private: | 303 private: |
| 304 // contents::WebContentsObserver: | 304 // contents::WebContentsObserver: |
| 305 void RenderProcessGone(base::TerminationStatus status) override; | 305 void RenderProcessGone(base::TerminationStatus status) override; |
| 306 void DidStartNavigationToPendingEntry( | 306 void DidStartNavigationToPendingEntry( |
| 307 const GURL& url, | 307 const GURL& url, |
| 308 content::NavigationController::ReloadType reload_type) override; | 308 content::ReloadType reload_type) override; |
| 309 void DocumentAvailableInMainFrame() override; | 309 void DocumentAvailableInMainFrame() override; |
| 310 void DocumentOnLoadCompletedInMainFrame() override; | 310 void DocumentOnLoadCompletedInMainFrame() override; |
| 311 void DidNavigateMainFrame( | 311 void DidNavigateMainFrame( |
| 312 const content::LoadCommittedDetails& details, | 312 const content::LoadCommittedDetails& details, |
| 313 const content::FrameNavigateParams& params) override; | 313 const content::FrameNavigateParams& params) override; |
| 314 | 314 |
| 315 DevToolsUIBindings* devtools_bindings_; | 315 DevToolsUIBindings* devtools_bindings_; |
| 316 DISALLOW_COPY_AND_ASSIGN(FrontendWebContentsObserver); | 316 DISALLOW_COPY_AND_ASSIGN(FrontendWebContentsObserver); |
| 317 }; | 317 }; |
| 318 | 318 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 341 devtools_bindings_->Detach(); | 341 devtools_bindings_->Detach(); |
| 342 break; | 342 break; |
| 343 default: | 343 default: |
| 344 crashed = false; | 344 crashed = false; |
| 345 break; | 345 break; |
| 346 } | 346 } |
| 347 devtools_bindings_->delegate_->RenderProcessGone(crashed); | 347 devtools_bindings_->delegate_->RenderProcessGone(crashed); |
| 348 } | 348 } |
| 349 | 349 |
| 350 void DevToolsUIBindings::FrontendWebContentsObserver:: | 350 void DevToolsUIBindings::FrontendWebContentsObserver:: |
| 351 DidStartNavigationToPendingEntry( | 351 DidStartNavigationToPendingEntry(const GURL& url, |
| 352 const GURL& url, | 352 content::ReloadType reload_type) { |
| 353 content::NavigationController::ReloadType reload_type) { | |
| 354 devtools_bindings_->frontend_host_.reset( | 353 devtools_bindings_->frontend_host_.reset( |
| 355 content::DevToolsFrontendHost::Create( | 354 content::DevToolsFrontendHost::Create( |
| 356 web_contents()->GetMainFrame(), | 355 web_contents()->GetMainFrame(), |
| 357 base::Bind(&DevToolsUIBindings::HandleMessageFromDevToolsFrontend, | 356 base::Bind(&DevToolsUIBindings::HandleMessageFromDevToolsFrontend, |
| 358 base::Unretained(devtools_bindings_)))); | 357 base::Unretained(devtools_bindings_)))); |
| 359 } | 358 } |
| 360 | 359 |
| 361 void DevToolsUIBindings::FrontendWebContentsObserver:: | 360 void DevToolsUIBindings::FrontendWebContentsObserver:: |
| 362 DocumentAvailableInMainFrame() { | 361 DocumentAvailableInMainFrame() { |
| 363 devtools_bindings_->DocumentAvailableInMainFrame(); | 362 devtools_bindings_->DocumentAvailableInMainFrame(); |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 void DevToolsUIBindings::FrontendLoaded() { | 1098 void DevToolsUIBindings::FrontendLoaded() { |
| 1100 if (frontend_loaded_) | 1099 if (frontend_loaded_) |
| 1101 return; | 1100 return; |
| 1102 frontend_loaded_ = true; | 1101 frontend_loaded_ = true; |
| 1103 | 1102 |
| 1104 // Call delegate first - it seeds importants bit of information. | 1103 // Call delegate first - it seeds importants bit of information. |
| 1105 delegate_->OnLoadCompleted(); | 1104 delegate_->OnLoadCompleted(); |
| 1106 | 1105 |
| 1107 AddDevToolsExtensionsToClient(); | 1106 AddDevToolsExtensionsToClient(); |
| 1108 } | 1107 } |
| OLD | NEW |