summaryrefslogtreecommitdiffstats
path: root/chrome/browser/debugger
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 09:56:58 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 09:56:58 +0000
commita878900d1577d0943387f16774a09a5ceae24b2f (patch)
tree21840f532e01cca7131434b30aee68e3f263f52c /chrome/browser/debugger
parent2bcc742366e08add58e8a1d2d60a7a16ac83b768 (diff)
downloadchromium_src-a878900d1577d0943387f16774a09a5ceae24b2f.zip
chromium_src-a878900d1577d0943387f16774a09a5ceae24b2f.tar.gz
chromium_src-a878900d1577d0943387f16774a09a5ceae24b2f.tar.bz2
DevTools: inspector tabs are initially drawn in the undocked style even for docked inspectors
BUG=40804 Review URL: http://codereview.chromium.org/2009002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/debugger')
-rwxr-xr-xchrome/browser/debugger/devtools_window.cc23
-rwxr-xr-x[-rw-r--r--]chrome/browser/debugger/devtools_window.h1
2 files changed, 20 insertions, 4 deletions
diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc
index debf10a..c8dbfd8 100755
--- a/chrome/browser/debugger/devtools_window.cc
+++ b/chrome/browser/debugger/devtools_window.cc
@@ -60,9 +60,8 @@ DevToolsWindow::DevToolsWindow(Profile* profile,
open_console_on_load_(false) {
// Create TabContents with devtools.
tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL);
- GURL url(std::string(chrome::kChromeUIDevToolsURL) + "devtools.html");
tab_contents_->render_view_host()->AllowBindings(BindingsPolicy::DOM_UI);
- tab_contents_->controller().LoadURL(url, GURL(), PageTransition::START_PAGE);
+ tab_contents_->controller().LoadURL(GetDevToolsUrl(), GURL(), PageTransition::START_PAGE);
// Wipe out page icon so that the default application icon is used.
NavigationEntry* entry = tab_contents_->controller().GetActiveEntry();
@@ -241,9 +240,7 @@ void DevToolsWindow::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
if (type == NotificationType::LOAD_STOP) {
- SetAttachedWindow();
is_loaded_ = true;
- UpdateTheme();
if (open_console_on_load_) {
DoOpenConsole();
open_console_on_load_ = false;
@@ -283,6 +280,24 @@ std::string SkColorToRGBAString(SkColor color) {
DoubleToString(SkColorGetA(color) / 255.0).c_str());
}
+GURL DevToolsWindow::GetDevToolsUrl() {
+ BrowserThemeProvider* tp = profile_->GetThemeProvider();
+ CHECK(tp);
+
+ SkColor color_toolbar =
+ tp->GetColor(BrowserThemeProvider::COLOR_TOOLBAR);
+ SkColor color_tab_text =
+ tp->GetColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT);
+
+ std::string url_string = StringPrintf(
+ "%sdevtools.html?docked=%s&toolbar_color=%s&text_color=%s",
+ chrome::kChromeUIDevToolsURL,
+ docked_ ? "true" : "false",
+ SkColorToRGBAString(color_toolbar).c_str(),
+ SkColorToRGBAString(color_tab_text).c_str());
+ return GURL(url_string);
+}
+
void DevToolsWindow::UpdateTheme() {
BrowserThemeProvider* tp = profile_->GetThemeProvider();
CHECK(tp);
diff --git a/chrome/browser/debugger/devtools_window.h b/chrome/browser/debugger/devtools_window.h
index f799639..fbd14dc 100644..100755
--- a/chrome/browser/debugger/devtools_window.h
+++ b/chrome/browser/debugger/devtools_window.h
@@ -61,6 +61,7 @@ class DevToolsWindow
void ScheduleOpenConsole();
void DoOpenConsole();
+ GURL GetDevToolsUrl();
void UpdateTheme();
// Overridden from TabContentsDelegate.