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

Side by Side Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 20686002: Profile Reset: enable feature by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CamelCase Created 7 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
« no previous file with comments | « no previous file | no next file » | 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/ui/webui/options/browser_options_handler.h" 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/memory/singleton.h" 14 #include "base/memory/singleton.h"
15 #include "base/metrics/field_trial.h"
15 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
16 #include "base/path_service.h" 17 #include "base/path_service.h"
17 #include "base/prefs/pref_service.h" 18 #include "base/prefs/pref_service.h"
18 #include "base/stl_util.h" 19 #include "base/stl_util.h"
19 #include "base/strings/string_number_conversions.h" 20 #include "base/strings/string_number_conversions.h"
20 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
21 #include "base/value_conversions.h" 22 #include "base/value_conversions.h"
22 #include "base/values.h" 23 #include "base/values.h"
23 #include "chrome/browser/auto_launch_trial.h" 24 #include "chrome/browser/auto_launch_trial.h"
24 #include "chrome/browser/browser_process.h" 25 #include "chrome/browser/browser_process.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 using content::BrowserThread; 119 using content::BrowserThread;
119 using content::DownloadManager; 120 using content::DownloadManager;
120 using content::OpenURLParams; 121 using content::OpenURLParams;
121 using content::Referrer; 122 using content::Referrer;
122 using content::UserMetricsAction; 123 using content::UserMetricsAction;
123 124
124 namespace options { 125 namespace options {
125 126
126 namespace { 127 namespace {
127 128
129 // Constants for the new tab button field trial.
130 const char kProfileResetTrialName[] = "ManualResetProfile";
131 const char kProfileResetTrialEnableGroupName[] = "Enable";
132
128 bool ShouldShowMultiProfilesUserList(chrome::HostDesktopType desktop_type) { 133 bool ShouldShowMultiProfilesUserList(chrome::HostDesktopType desktop_type) {
129 #if defined(OS_CHROMEOS) 134 #if defined(OS_CHROMEOS)
130 // On Chrome OS we use different UI for multi-profiles. 135 // On Chrome OS we use different UI for multi-profiles.
131 return false; 136 return false;
132 #else 137 #else
133 if (desktop_type != chrome::HOST_DESKTOP_TYPE_NATIVE) 138 if (desktop_type != chrome::HOST_DESKTOP_TYPE_NATIVE)
134 return false; 139 return false;
135 return profiles::IsMultipleProfilesEnabled(); 140 return profiles::IsMultipleProfilesEnabled();
136 #endif 141 #endif
137 } 142 }
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 values->SetBoolean("profileIsManaged", 526 values->SetBoolean("profileIsManaged",
522 ManagedUserService::ProfileIsManaged(Profile::FromWebUI(web_ui()))); 527 ManagedUserService::ProfileIsManaged(Profile::FromWebUI(web_ui())));
523 #endif 528 #endif
524 529
525 #if !defined(OS_CHROMEOS) 530 #if !defined(OS_CHROMEOS)
526 values->SetBoolean( 531 values->SetBoolean(
527 "gpuEnabledAtStart", 532 "gpuEnabledAtStart",
528 g_browser_process->gpu_mode_manager()->initial_gpu_mode_pref()); 533 g_browser_process->gpu_mode_manager()->initial_gpu_mode_pref());
529 #endif 534 #endif
530 535
536 bool finch_allows_button =
537 base::FieldTrialList::FindFullName(kProfileResetTrialName) ==
538 kProfileResetTrialEnableGroupName;
531 values->SetBoolean("enableResetProfileSettingsSection", 539 values->SetBoolean("enableResetProfileSettingsSection",
540 finch_allows_button ||
532 CommandLine::ForCurrentProcess()->HasSwitch( 541 CommandLine::ForCurrentProcess()->HasSwitch(
533 switches::kEnableResetProfileSettings)); 542 switches::kEnableResetProfileSettings));
534 } 543 }
535 544
536 void BrowserOptionsHandler::RegisterCloudPrintValues(DictionaryValue* values) { 545 void BrowserOptionsHandler::RegisterCloudPrintValues(DictionaryValue* values) {
537 #if defined(OS_CHROMEOS) 546 #if defined(OS_CHROMEOS)
538 values->SetString("cloudPrintChromeosOptionLabel", 547 values->SetString("cloudPrintChromeosOptionLabel",
539 l10n_util::GetStringFUTF16( 548 l10n_util::GetStringFUTF16(
540 IDS_CLOUD_PRINT_CHROMEOS_OPTION_LABEL, 549 IDS_CLOUD_PRINT_CHROMEOS_OPTION_LABEL,
541 l10n_util::GetStringUTF16(IDS_GOOGLE_CLOUD_PRINT))); 550 l10n_util::GetStringUTF16(IDS_GOOGLE_CLOUD_PRINT)));
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 base::FundamentalValue disabled(proxy_config && 1731 base::FundamentalValue disabled(proxy_config &&
1723 !proxy_config->IsUserModifiable()); 1732 !proxy_config->IsUserModifiable());
1724 base::FundamentalValue extension_controlled(is_extension_controlled); 1733 base::FundamentalValue extension_controlled(is_extension_controlled);
1725 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection", 1734 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection",
1726 disabled, extension_controlled); 1735 disabled, extension_controlled);
1727 1736
1728 #endif // !defined(OS_CHROMEOS) 1737 #endif // !defined(OS_CHROMEOS)
1729 } 1738 }
1730 1739
1731 } // namespace options 1740 } // namespace options
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698