Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: chrome/browser/devtools/devtools_ui_bindings.cc

Issue 1360143003: [DevTools] Do not use AboutToNavigateRenderFrame in DevToolsUIBindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/prefs/scoped_user_pref_update.h" 10 #include "base/prefs/scoped_user_pref_update.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 293
294 class DevToolsUIBindings::FrontendWebContentsObserver 294 class DevToolsUIBindings::FrontendWebContentsObserver
295 : public content::WebContentsObserver { 295 : public content::WebContentsObserver {
296 public: 296 public:
297 explicit FrontendWebContentsObserver(DevToolsUIBindings* ui_bindings); 297 explicit FrontendWebContentsObserver(DevToolsUIBindings* ui_bindings);
298 ~FrontendWebContentsObserver() override; 298 ~FrontendWebContentsObserver() override;
299 299
300 private: 300 private:
301 // contents::WebContentsObserver: 301 // contents::WebContentsObserver:
302 void RenderProcessGone(base::TerminationStatus status) override; 302 void RenderProcessGone(base::TerminationStatus status) override;
303 // TODO(creis): Replace with RenderFrameCreated when http://crbug.com/425397 303 void DidStartProvisionalLoadForFrame(
304 // is fixed. See also http://crbug.com/424641. 304 content::RenderFrameHost* render_frame_host,
305 void AboutToNavigateRenderFrame( 305 const GURL& validated_url,
306 content::RenderFrameHost* old_host, 306 bool is_error_page,
307 content::RenderFrameHost* new_host) override; 307 bool is_iframe_srcdoc) override;
308 void DocumentOnLoadCompletedInMainFrame() override; 308 void DocumentOnLoadCompletedInMainFrame() override;
309 void DidNavigateMainFrame( 309 void DidNavigateMainFrame(
310 const content::LoadCommittedDetails& details, 310 const content::LoadCommittedDetails& details,
311 const content::FrameNavigateParams& params) override; 311 const content::FrameNavigateParams& params) override;
312 312
313 DevToolsUIBindings* devtools_bindings_; 313 DevToolsUIBindings* devtools_bindings_;
314 DISALLOW_COPY_AND_ASSIGN(FrontendWebContentsObserver); 314 DISALLOW_COPY_AND_ASSIGN(FrontendWebContentsObserver);
315 }; 315 };
316 316
317 DevToolsUIBindings::FrontendWebContentsObserver::FrontendWebContentsObserver( 317 DevToolsUIBindings::FrontendWebContentsObserver::FrontendWebContentsObserver(
(...skipping 21 matching lines...) Expand all
339 devtools_bindings_->Detach(); 339 devtools_bindings_->Detach();
340 break; 340 break;
341 default: 341 default:
342 crashed = false; 342 crashed = false;
343 break; 343 break;
344 } 344 }
345 devtools_bindings_->delegate_->RenderProcessGone(crashed); 345 devtools_bindings_->delegate_->RenderProcessGone(crashed);
346 } 346 }
347 347
348 void DevToolsUIBindings::FrontendWebContentsObserver:: 348 void DevToolsUIBindings::FrontendWebContentsObserver::
349 AboutToNavigateRenderFrame(content::RenderFrameHost* old_host, 349 DidStartProvisionalLoadForFrame(content::RenderFrameHost* render_frame_host,
350 content::RenderFrameHost* new_host) { 350 const GURL& validated_url,
351 if (new_host->GetParent()) 351 bool is_error_page,
352 bool is_iframe_srcdoc) {
353 if (render_frame_host->GetParent())
352 return; 354 return;
353 devtools_bindings_->frontend_host_.reset( 355 devtools_bindings_->frontend_host_.reset(
354 content::DevToolsFrontendHost::Create(new_host, 356 content::DevToolsFrontendHost::Create(render_frame_host,
355 devtools_bindings_)); 357 devtools_bindings_));
356 } 358 }
357 359
358 void DevToolsUIBindings::FrontendWebContentsObserver:: 360 void DevToolsUIBindings::FrontendWebContentsObserver::
359 DocumentOnLoadCompletedInMainFrame() { 361 DocumentOnLoadCompletedInMainFrame() {
360 devtools_bindings_->DocumentOnLoadCompletedInMainFrame(); 362 devtools_bindings_->DocumentOnLoadCompletedInMainFrame();
361 } 363 }
362 364
363 void DevToolsUIBindings::FrontendWebContentsObserver:: 365 void DevToolsUIBindings::FrontendWebContentsObserver::
364 DidNavigateMainFrame(const content::LoadCommittedDetails& details, 366 DidNavigateMainFrame(const content::LoadCommittedDetails& details,
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 void DevToolsUIBindings::FrontendLoaded() { 1145 void DevToolsUIBindings::FrontendLoaded() {
1144 if (frontend_loaded_) 1146 if (frontend_loaded_)
1145 return; 1147 return;
1146 frontend_loaded_ = true; 1148 frontend_loaded_ = true;
1147 1149
1148 // Call delegate first - it seeds importants bit of information. 1150 // Call delegate first - it seeds importants bit of information.
1149 delegate_->OnLoadCompleted(); 1151 delegate_->OnLoadCompleted();
1150 1152
1151 AddDevToolsExtensionsToClient(); 1153 AddDevToolsExtensionsToClient();
1152 } 1154 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698