| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_ui_bindings.h" | 5 #include "chrome/browser/devtools/devtools_ui_bindings.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 ThemeService* tp = ThemeServiceFactory::GetForProfile(profile); | 328 ThemeService* tp = ThemeServiceFactory::GetForProfile(profile); |
| 329 DCHECK(tp); | 329 DCHECK(tp); |
| 330 std::string url_string( | 330 std::string url_string( |
| 331 frontend_url + | 331 frontend_url + |
| 332 ((frontend_url.find("?") == std::string::npos) ? "?" : "&") + | 332 ((frontend_url.find("?") == std::string::npos) ? "?" : "&") + |
| 333 "dockSide=undocked" + // TODO(dgozman): remove this support in M38. | 333 "dockSide=undocked" + // TODO(dgozman): remove this support in M38. |
| 334 "&toolbarColor=" + | 334 "&toolbarColor=" + |
| 335 SkColorToRGBAString(tp->GetColor(ThemeProperties::COLOR_TOOLBAR)) + | 335 SkColorToRGBAString(tp->GetColor(ThemeProperties::COLOR_TOOLBAR)) + |
| 336 "&textColor=" + | 336 "&textColor=" + |
| 337 SkColorToRGBAString(tp->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT))); | 337 SkColorToRGBAString(tp->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT))); |
| 338 if (CommandLine::ForCurrentProcess()->HasSwitch( | 338 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 339 switches::kEnableDevToolsExperiments)) | 339 switches::kEnableDevToolsExperiments)) |
| 340 url_string += "&experiments=true"; | 340 url_string += "&experiments=true"; |
| 341 #if defined(DEBUG_DEVTOOLS) | 341 #if defined(DEBUG_DEVTOOLS) |
| 342 url_string += "&debugFrontend=true"; | 342 url_string += "&debugFrontend=true"; |
| 343 #endif // defined(DEBUG_DEVTOOLS) | 343 #endif // defined(DEBUG_DEVTOOLS) |
| 344 return GURL(url_string); | 344 return GURL(url_string); |
| 345 } | 345 } |
| 346 | 346 |
| 347 DevToolsUIBindings::DevToolsUIBindings(content::WebContents* web_contents) | 347 DevToolsUIBindings::DevToolsUIBindings(content::WebContents* web_contents) |
| 348 : profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())), | 348 : profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())), |
| 349 web_contents_(web_contents), | 349 web_contents_(web_contents), |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 if (frontend_loaded_) | 903 if (frontend_loaded_) |
| 904 return; | 904 return; |
| 905 frontend_loaded_ = true; | 905 frontend_loaded_ = true; |
| 906 | 906 |
| 907 // Call delegate first - it seeds importants bit of information. | 907 // Call delegate first - it seeds importants bit of information. |
| 908 delegate_->OnLoadCompleted(); | 908 delegate_->OnLoadCompleted(); |
| 909 | 909 |
| 910 UpdateTheme(); | 910 UpdateTheme(); |
| 911 AddDevToolsExtensionsToClient(); | 911 AddDevToolsExtensionsToClient(); |
| 912 } | 912 } |
| OLD | NEW |