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

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

Issue 2894973002: Provide WebContents::CreateParams to tab helpers. (Closed)
Patch Set: rebase Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_window.h" 5 #include "chrome/browser/devtools/devtools_window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 } 1040 }
1041 1041
1042 WebContents* inspected_web_contents = GetInspectedWebContents(); 1042 WebContents* inspected_web_contents = GetInspectedWebContents();
1043 if (inspected_web_contents) { 1043 if (inspected_web_contents) {
1044 inspected_web_contents->GetDelegate()->AddNewContents( 1044 inspected_web_contents->GetDelegate()->AddNewContents(
1045 source, new_contents, disposition, initial_rect, user_gesture, 1045 source, new_contents, disposition, initial_rect, user_gesture,
1046 was_blocked); 1046 was_blocked);
1047 } 1047 }
1048 } 1048 }
1049 1049
1050 void DevToolsWindow::WebContentsCreated(WebContents* source_contents, 1050 void DevToolsWindow::WebContentsCreated(
1051 int opener_render_process_id, 1051 WebContents* source_contents,
1052 int opener_render_frame_id, 1052 int opener_render_process_id,
1053 const std::string& frame_name, 1053 int opener_render_frame_id,
1054 const GURL& target_url, 1054 const std::string& frame_name,
1055 WebContents* new_contents) { 1055 const GURL& target_url,
1056 WebContents* new_contents,
1057 const base::Optional<content::WebContents::CreateParams>& create_params) {
1056 if (target_url.SchemeIs(content::kChromeDevToolsScheme) && 1058 if (target_url.SchemeIs(content::kChromeDevToolsScheme) &&
1057 target_url.path().rfind("toolbox.html") != std::string::npos) { 1059 target_url.path().rfind("toolbox.html") != std::string::npos) {
1058 CHECK(can_dock_); 1060 CHECK(can_dock_);
1059 if (toolbox_web_contents_) 1061 if (toolbox_web_contents_)
1060 delete toolbox_web_contents_; 1062 delete toolbox_web_contents_;
1061 toolbox_web_contents_ = new_contents; 1063 toolbox_web_contents_ = new_contents;
1062 1064
1063 // Tag the DevTools toolbox WebContents with its TaskManager specific 1065 // Tag the DevTools toolbox WebContents with its TaskManager specific
1064 // UserData so that it shows up in the task manager. 1066 // UserData so that it shows up in the task manager.
1065 task_manager::WebContentsTags::CreateForDevToolsContents( 1067 task_manager::WebContentsTags::CreateForDevToolsContents(
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { 1438 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) {
1437 // Only route reload via front-end if the agent is attached. 1439 // Only route reload via front-end if the agent is attached.
1438 WebContents* wc = GetInspectedWebContents(); 1440 WebContents* wc = GetInspectedWebContents();
1439 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) 1441 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING)
1440 return false; 1442 return false;
1441 base::Value bypass_cache_value(bypass_cache); 1443 base::Value bypass_cache_value(bypass_cache);
1442 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", 1444 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage",
1443 &bypass_cache_value, nullptr, nullptr); 1445 &bypass_cache_value, nullptr, nullptr);
1444 return true; 1446 return true;
1445 } 1447 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_window.h ('k') | chrome/browser/page_load_metrics/metrics_web_contents_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698