Chromium Code Reviews| 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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 242 public: | 242 public: |
| 243 explicit FrontendWebContentsObserver(DevToolsUIBindings* ui_bindings); | 243 explicit FrontendWebContentsObserver(DevToolsUIBindings* ui_bindings); |
| 244 ~FrontendWebContentsObserver() override; | 244 ~FrontendWebContentsObserver() override; |
| 245 | 245 |
| 246 private: | 246 private: |
| 247 // contents::WebContentsObserver: | 247 // contents::WebContentsObserver: |
| 248 void RenderProcessGone(base::TerminationStatus status) override; | 248 void RenderProcessGone(base::TerminationStatus status) override; |
| 249 // TODO(creis): Replace with RenderFrameCreated when http://crbug.com/425397 | 249 // TODO(creis): Replace with RenderFrameCreated when http://crbug.com/425397 |
| 250 // is fixed. See also http://crbug.com/424641. | 250 // is fixed. See also http://crbug.com/424641. |
| 251 void AboutToNavigateRenderFrame( | 251 void AboutToNavigateRenderFrame( |
| 252 content::RenderFrameHost* render_frame_host) override; | 252 content::RenderFrameHost* render_frame_host, |
|
dgozman
2015/01/22 13:54:08
Let's use |old_host| and |new_host| for consistenc
pfeldman
2015/01/22 22:10:04
Done.
| |
| 253 content::RenderFrameHost* dest_frame_host) override; | |
| 253 void DocumentOnLoadCompletedInMainFrame() override; | 254 void DocumentOnLoadCompletedInMainFrame() override; |
| 254 void DidNavigateMainFrame( | 255 void DidNavigateMainFrame( |
| 255 const content::LoadCommittedDetails& details, | 256 const content::LoadCommittedDetails& details, |
| 256 const content::FrameNavigateParams& params) override; | 257 const content::FrameNavigateParams& params) override; |
| 257 | 258 |
| 258 DevToolsUIBindings* devtools_bindings_; | 259 DevToolsUIBindings* devtools_bindings_; |
| 259 DISALLOW_COPY_AND_ASSIGN(FrontendWebContentsObserver); | 260 DISALLOW_COPY_AND_ASSIGN(FrontendWebContentsObserver); |
| 260 }; | 261 }; |
| 261 | 262 |
| 262 DevToolsUIBindings::FrontendWebContentsObserver::FrontendWebContentsObserver( | 263 DevToolsUIBindings::FrontendWebContentsObserver::FrontendWebContentsObserver( |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 280 devtools_bindings_->Detach(); | 281 devtools_bindings_->Detach(); |
| 281 break; | 282 break; |
| 282 default: | 283 default: |
| 283 crashed = false; | 284 crashed = false; |
| 284 break; | 285 break; |
| 285 } | 286 } |
| 286 devtools_bindings_->delegate_->RenderProcessGone(crashed); | 287 devtools_bindings_->delegate_->RenderProcessGone(crashed); |
| 287 } | 288 } |
| 288 | 289 |
| 289 void DevToolsUIBindings::FrontendWebContentsObserver:: | 290 void DevToolsUIBindings::FrontendWebContentsObserver:: |
| 290 AboutToNavigateRenderFrame(content::RenderFrameHost* render_frame_host) { | 291 AboutToNavigateRenderFrame(content::RenderFrameHost* old_host, |
| 291 if (render_frame_host->GetParent()) | 292 content::RenderFrameHost* new_host) { |
| 293 if (new_host->GetParent()) | |
| 292 return; | 294 return; |
| 293 devtools_bindings_->frontend_host_.reset( | 295 devtools_bindings_->frontend_host_.reset( |
| 294 content::DevToolsFrontendHost::Create(render_frame_host, | 296 content::DevToolsFrontendHost::Create(new_host, |
| 295 devtools_bindings_)); | 297 devtools_bindings_)); |
| 296 } | 298 } |
| 297 | 299 |
| 298 void DevToolsUIBindings::FrontendWebContentsObserver:: | 300 void DevToolsUIBindings::FrontendWebContentsObserver:: |
| 299 DocumentOnLoadCompletedInMainFrame() { | 301 DocumentOnLoadCompletedInMainFrame() { |
| 300 devtools_bindings_->DocumentOnLoadCompletedInMainFrame(); | 302 devtools_bindings_->DocumentOnLoadCompletedInMainFrame(); |
| 301 } | 303 } |
| 302 | 304 |
| 303 void DevToolsUIBindings::FrontendWebContentsObserver:: | 305 void DevToolsUIBindings::FrontendWebContentsObserver:: |
| 304 DidNavigateMainFrame(const content::LoadCommittedDetails& details, | 306 DidNavigateMainFrame(const content::LoadCommittedDetails& details, |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 903 if (frontend_loaded_) | 905 if (frontend_loaded_) |
| 904 return; | 906 return; |
| 905 frontend_loaded_ = true; | 907 frontend_loaded_ = true; |
| 906 | 908 |
| 907 // Call delegate first - it seeds importants bit of information. | 909 // Call delegate first - it seeds importants bit of information. |
| 908 delegate_->OnLoadCompleted(); | 910 delegate_->OnLoadCompleted(); |
| 909 | 911 |
| 910 UpdateTheme(); | 912 UpdateTheme(); |
| 911 AddDevToolsExtensionsToClient(); | 913 AddDevToolsExtensionsToClient(); |
| 912 } | 914 } |
| OLD | NEW |