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

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

Issue 2728453003: preload polymer elements in options page (Closed)
Patch Set: rebase Created 3 years, 9 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return "signOutAndSignIn"; 188 return "signOutAndSignIn";
189 case sync_ui_util::UPGRADE_CLIENT: 189 case sync_ui_util::UPGRADE_CLIENT:
190 return "upgradeClient"; 190 return "upgradeClient";
191 case sync_ui_util::ENTER_PASSPHRASE: 191 case sync_ui_util::ENTER_PASSPHRASE:
192 return "enterPassphrase"; 192 return "enterPassphrase";
193 default: 193 default:
194 return "noAction"; 194 return "noAction";
195 } 195 }
196 } 196 }
197 197
198 #if defined(OS_CHROMEOS)
199 bool g_enable_polymer_preload = true;
200 #endif // defined(OS_CHROMEOS)
198 } // namespace 201 } // namespace
199 202
200 namespace options { 203 namespace options {
201 204
202 BrowserOptionsHandler::BrowserOptionsHandler() 205 BrowserOptionsHandler::BrowserOptionsHandler()
203 : page_initialized_(false), 206 : page_initialized_(false),
204 template_url_service_(NULL), 207 template_url_service_(NULL),
205 cloud_print_mdns_ui_enabled_(false), 208 cloud_print_mdns_ui_enabled_(false),
206 #if defined(OS_CHROMEOS) 209 #if defined(OS_CHROMEOS)
207 enable_factory_reset_(false), 210 enable_factory_reset_(false),
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SCREEN_MAGNIFIER_FULL)); 718 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SCREEN_MAGNIFIER_FULL));
716 magnifier_list->Append(std::move(option_full)); 719 magnifier_list->Append(std::move(option_full));
717 720
718 std::unique_ptr<base::ListValue> option_partial(new base::ListValue); 721 std::unique_ptr<base::ListValue> option_partial(new base::ListValue);
719 option_partial->AppendInteger(ash::MAGNIFIER_PARTIAL); 722 option_partial->AppendInteger(ash::MAGNIFIER_PARTIAL);
720 option_partial->AppendString(l10n_util::GetStringUTF16( 723 option_partial->AppendString(l10n_util::GetStringUTF16(
721 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SCREEN_MAGNIFIER_PARTIAL)); 724 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SCREEN_MAGNIFIER_PARTIAL));
722 magnifier_list->Append(std::move(option_partial)); 725 magnifier_list->Append(std::move(option_partial));
723 726
724 values->Set("magnifierList", magnifier_list.release()); 727 values->Set("magnifierList", magnifier_list.release());
725 #endif 728 values->SetBoolean("enablePolymerPreload", g_enable_polymer_preload);
729 #endif // defined(OS_CHROMEOS)
726 730
727 #if defined(OS_MACOSX) 731 #if defined(OS_MACOSX)
728 values->SetString("macPasswordsWarning", 732 values->SetString("macPasswordsWarning",
729 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MAC_WARNING)); 733 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MAC_WARNING));
730 values->SetBoolean("multiple_profiles", 734 values->SetBoolean("multiple_profiles",
731 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1); 735 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1);
732 #endif 736 #endif
733 737
734 if (ShouldShowMultiProfilesUserList()) 738 if (ShouldShowMultiProfilesUserList())
735 values->Set("profilesInfo", GetProfilesInfoList().release()); 739 values->Set("profilesInfo", GetProfilesInfoList().release());
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
2344 2348
2345 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, 2349 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns,
2346 const policy::PolicyMap& previous, 2350 const policy::PolicyMap& previous,
2347 const policy::PolicyMap& current) { 2351 const policy::PolicyMap& current) {
2348 std::set<std::string> different_keys; 2352 std::set<std::string> different_keys;
2349 current.GetDifferingKeys(previous, &different_keys); 2353 current.GetDifferingKeys(previous, &different_keys);
2350 if (base::ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) 2354 if (base::ContainsKey(different_keys, policy::key::kMetricsReportingEnabled))
2351 SetupMetricsReportingCheckbox(); 2355 SetupMetricsReportingCheckbox();
2352 } 2356 }
2353 2357
2358 #if defined(OS_CHROMEOS)
2359 // static
2360 void BrowserOptionsHandler::DisablePolymerPreloadForTesting() {
2361 g_enable_polymer_preload = false;
2362 }
2363 #endif // defined(OS_CHROMEOS)
2364
2354 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { 2365 bool BrowserOptionsHandler::IsDeviceOwnerProfile() {
2355 #if defined(OS_CHROMEOS) 2366 #if defined(OS_CHROMEOS)
2356 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); 2367 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui()));
2357 #else 2368 #else
2358 return true; 2369 return true;
2359 #endif 2370 #endif
2360 } 2371 }
2361 2372
2362 } // namespace options 2373 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.h ('k') | chrome/test/base/in_process_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698