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

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

Issue 620953003: DevTools: Use resource name to detect toolbox web contents resource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 (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 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 was_blocked); 854 was_blocked);
855 } 855 }
856 } 856 }
857 857
858 void DevToolsWindow::WebContentsCreated(WebContents* source_contents, 858 void DevToolsWindow::WebContentsCreated(WebContents* source_contents,
859 int opener_render_frame_id, 859 int opener_render_frame_id,
860 const base::string16& frame_name, 860 const base::string16& frame_name,
861 const GURL& target_url, 861 const GURL& target_url,
862 WebContents* new_contents) { 862 WebContents* new_contents) {
863 if (target_url.SchemeIs(content::kChromeDevToolsScheme) && 863 if (target_url.SchemeIs(content::kChromeDevToolsScheme) &&
864 target_url.query().find("toolbox=true") != std::string::npos) { 864 target_url.path().rfind("toolbox.html") != std::string::npos) {
dgozman 2014/10/02 10:08:10 There is no difference between find and rfind here
apavlov 2014/10/02 10:10:23 We know that it will be A TAD faster :)
865 CHECK(can_dock_); 865 CHECK(can_dock_);
866 toolbox_web_contents_ = new_contents; 866 toolbox_web_contents_ = new_contents;
867 } 867 }
868 } 868 }
869 869
870 void DevToolsWindow::CloseContents(WebContents* source) { 870 void DevToolsWindow::CloseContents(WebContents* source) {
871 CHECK(is_docked_); 871 CHECK(is_docked_);
872 life_stage_ = kClosing; 872 life_stage_ = kClosing;
873 UpdateBrowserWindow(); 873 UpdateBrowserWindow();
874 // In case of docked main_web_contents_, we own it so delete here. 874 // In case of docked main_web_contents_, we own it so delete here.
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 closure.Run(); 1223 closure.Run();
1224 return; 1224 return;
1225 } 1225 }
1226 load_completed_callback_ = closure; 1226 load_completed_callback_ = closure;
1227 } 1227 }
1228 1228
1229 bool DevToolsWindow::ForwardKeyboardEvent( 1229 bool DevToolsWindow::ForwardKeyboardEvent(
1230 const content::NativeWebKeyboardEvent& event) { 1230 const content::NativeWebKeyboardEvent& event) {
1231 return event_forwarder_->ForwardEvent(event); 1231 return event_forwarder_->ForwardEvent(event);
1232 } 1232 }
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