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

Side by Side Diff: chrome/browser/browser_main.cc

Issue 7670041: Add --use-more-webui runtime flag to toggle WebUI replacements for native dialogs. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_main.h" 5 #include "chrome/browser/browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "chrome/browser/search_engines/search_engine_type.h" 70 #include "chrome/browser/search_engines/search_engine_type.h"
71 #include "chrome/browser/search_engines/template_url.h" 71 #include "chrome/browser/search_engines/template_url.h"
72 #include "chrome/browser/search_engines/template_url_service.h" 72 #include "chrome/browser/search_engines/template_url_service.h"
73 #include "chrome/browser/search_engines/template_url_service_factory.h" 73 #include "chrome/browser/search_engines/template_url_service_factory.h"
74 #include "chrome/browser/service/service_process_control.h" 74 #include "chrome/browser/service/service_process_control.h"
75 #include "chrome/browser/shell_integration.h" 75 #include "chrome/browser/shell_integration.h"
76 #include "chrome/browser/translate/translate_manager.h" 76 #include "chrome/browser/translate/translate_manager.h"
77 #include "chrome/browser/ui/browser.h" 77 #include "chrome/browser/ui/browser.h"
78 #include "chrome/browser/ui/browser_init.h" 78 #include "chrome/browser/ui/browser_init.h"
79 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" 79 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h"
80 #include "chrome/browser/ui/webui/chrome_web_ui.h"
80 #include "chrome/browser/web_resource/gpu_blacklist_updater.h" 81 #include "chrome/browser/web_resource/gpu_blacklist_updater.h"
81 #include "chrome/common/chrome_constants.h" 82 #include "chrome/common/chrome_constants.h"
82 #include "chrome/common/chrome_paths.h" 83 #include "chrome/common/chrome_paths.h"
83 #include "chrome/common/chrome_result_codes.h" 84 #include "chrome/common/chrome_result_codes.h"
84 #include "chrome/common/chrome_switches.h" 85 #include "chrome/common/chrome_switches.h"
85 #include "chrome/common/chrome_version_info.h" 86 #include "chrome/common/chrome_version_info.h"
86 #include "chrome/common/env_vars.h" 87 #include "chrome/common/env_vars.h"
87 #include "chrome/common/json_pref_store.h" 88 #include "chrome/common/json_pref_store.h"
88 #include "chrome/common/jstemplate_builder.h" 89 #include "chrome/common/jstemplate_builder.h"
89 #include "chrome/common/logging_chrome.h" 90 #include "chrome/common/logging_chrome.h"
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 // We don't support retention experiments on Mac or Linux. 1491 // We don't support retention experiments on Mac or Linux.
1491 return content::RESULT_CODE_NORMAL_EXIT; 1492 return content::RESULT_CODE_NORMAL_EXIT;
1492 #endif // defined(OS_WIN) 1493 #endif // defined(OS_WIN)
1493 } 1494 }
1494 1495
1495 #if defined(OS_CHROMEOS) 1496 #if defined(OS_CHROMEOS)
1496 // This needs to be called after the locale has been set. 1497 // This needs to be called after the locale has been set.
1497 RegisterTranslateableItems(); 1498 RegisterTranslateableItems();
1498 #endif 1499 #endif
1499 1500
1501 ChromeWebUI::SetMoreWebUI(
Rick Byers 2011/08/18 19:25:30 Rather that keep a separate flag which you set at
flackr 2011/08/23 17:41:44 Done.
1502 CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseMoreWebUI));
1503
1500 #if defined(TOOLKIT_VIEWS) 1504 #if defined(TOOLKIT_VIEWS)
1501 views::Widget::SetPureViews( 1505 views::Widget::SetPureViews(
1502 CommandLine::ForCurrentProcess()->HasSwitch(switches::kUsePureViews)); 1506 CommandLine::ForCurrentProcess()->HasSwitch(switches::kUsePureViews));
1507 // If using Pure Views, turn on More WebUI to remove as much GTK as possible.
1508 if (views::Widget::IsPureViews()) {
1509 ChromeWebUI::SetMoreWebUI(true);
1510 }
1503 // Launch the views desktop shell window and register it as the default parent 1511 // Launch the views desktop shell window and register it as the default parent
1504 // for all unparented views widgets. 1512 // for all unparented views widgets.
1505 if (parsed_command_line.HasSwitch(switches::kViewsDesktop)) { 1513 if (parsed_command_line.HasSwitch(switches::kViewsDesktop)) {
1506 std::string desktop_type_cmd = 1514 std::string desktop_type_cmd =
1507 parsed_command_line.GetSwitchValueASCII(switches::kViewsDesktop); 1515 parsed_command_line.GetSwitchValueASCII(switches::kViewsDesktop);
1508 views::desktop::DesktopWindowView::DesktopType desktop_type; 1516 views::desktop::DesktopWindowView::DesktopType desktop_type;
1509 if (desktop_type_cmd == "netbook") 1517 if (desktop_type_cmd == "netbook")
1510 desktop_type = views::desktop::DesktopWindowView::DESKTOP_NETBOOK; 1518 desktop_type = views::desktop::DesktopWindowView::DESKTOP_NETBOOK;
1511 else if (desktop_type_cmd == "other") 1519 else if (desktop_type_cmd == "other")
1512 desktop_type = views::desktop::DesktopWindowView::DESKTOP_OTHER; 1520 desktop_type = views::desktop::DesktopWindowView::DESKTOP_OTHER;
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 // (environment variable is set, and valid). 2178 // (environment variable is set, and valid).
2171 std::string pre_read; 2179 std::string pre_read;
2172 if (env->GetVar(kEnvVar, &pre_read) && (pre_read == "0" || pre_read == "1")) { 2180 if (env->GetVar(kEnvVar, &pre_read) && (pre_read == "0" || pre_read == "1")) {
2173 std::string uma_name(name); 2181 std::string uma_name(name);
2174 uma_name += "_PreRead"; 2182 uma_name += "_PreRead";
2175 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; 2183 uma_name += pre_read == "1" ? "Enabled" : "Disabled";
2176 AddPreReadHistogramTime(uma_name.c_str(), time); 2184 AddPreReadHistogramTime(uma_name.c_str(), time);
2177 } 2185 }
2178 #endif 2186 #endif
2179 } 2187 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698