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

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

Issue 27693002: DevTools: Display a warning when trying to open untrusted frontend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed the other CHECK Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/webui/devtools_ui.cc » ('j') | 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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 external_frontend)); 615 external_frontend));
616 return new DevToolsWindow(profile, url, inspected_rvh, dock_side); 616 return new DevToolsWindow(profile, url, inspected_rvh, dock_side);
617 } 617 }
618 618
619 // static 619 // static
620 GURL DevToolsWindow::GetDevToolsURL(Profile* profile, 620 GURL DevToolsWindow::GetDevToolsURL(Profile* profile,
621 const GURL& base_url, 621 const GURL& base_url,
622 DevToolsDockSide dock_side, 622 DevToolsDockSide dock_side,
623 bool shared_worker_frontend, 623 bool shared_worker_frontend,
624 bool external_frontend) { 624 bool external_frontend) {
625 if (base_url.SchemeIs("data"))
626 return base_url;
627
625 std::string frontend_url( 628 std::string frontend_url(
626 base_url.is_empty() ? chrome::kChromeUIDevToolsURL : base_url.spec()); 629 base_url.is_empty() ? chrome::kChromeUIDevToolsURL : base_url.spec());
627 ThemeService* tp = ThemeServiceFactory::GetForProfile(profile); 630 ThemeService* tp = ThemeServiceFactory::GetForProfile(profile);
628 DCHECK(tp); 631 DCHECK(tp);
629 std::string url_string( 632 std::string url_string(
630 frontend_url + 633 frontend_url +
631 ((frontend_url.find("?") == std::string::npos) ? "?" : "&") + 634 ((frontend_url.find("?") == std::string::npos) ? "?" : "&") +
632 "dockSide=" + SideToString(dock_side) + 635 "dockSide=" + SideToString(dock_side) +
633 "&toolbarColor=" + 636 "&toolbarColor=" +
634 SkColorToRGBAString(tp->GetColor(ThemeProperties::COLOR_TOOLBAR)) + 637 SkColorToRGBAString(tp->GetColor(ThemeProperties::COLOR_TOOLBAR)) +
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 1369
1367 void DevToolsWindow::Restore() { 1370 void DevToolsWindow::Restore() {
1368 if (dock_side_ == DEVTOOLS_DOCK_SIDE_MINIMIZED) 1371 if (dock_side_ == DEVTOOLS_DOCK_SIDE_MINIMIZED)
1369 SetDockSide(SideToString(dock_side_before_minimized_)); 1372 SetDockSide(SideToString(dock_side_before_minimized_));
1370 } 1373 }
1371 1374
1372 content::WebContents* DevToolsWindow::GetInspectedWebContents() { 1375 content::WebContents* DevToolsWindow::GetInspectedWebContents() {
1373 return inspected_contents_observer_ ? 1376 return inspected_contents_observer_ ?
1374 inspected_contents_observer_->web_contents() : NULL; 1377 inspected_contents_observer_->web_contents() : NULL;
1375 } 1378 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/devtools_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698