OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |