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

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

Issue 445503003: Update easy unlock settings UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add spinner Created 6 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 | « chrome/browser/resources/options/options_bundle.js ('k') | chrome/common/url_constants.h » ('j') | 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 "apps/app_window.h" 10 #include "apps/app_window.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 IDS_OPTIONS_ENABLE_DO_NOT_TRACK_BUBBLE_DISABLE }, 236 IDS_OPTIONS_ENABLE_DO_NOT_TRACK_BUBBLE_DISABLE },
237 { "downloadLocationAskForSaveLocation", 237 { "downloadLocationAskForSaveLocation",
238 IDS_OPTIONS_DOWNLOADLOCATION_ASKFORSAVELOCATION }, 238 IDS_OPTIONS_DOWNLOADLOCATION_ASKFORSAVELOCATION },
239 { "downloadLocationBrowseTitle", 239 { "downloadLocationBrowseTitle",
240 IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE }, 240 IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE },
241 { "downloadLocationChangeButton", 241 { "downloadLocationChangeButton",
242 IDS_OPTIONS_DOWNLOADLOCATION_CHANGE_BUTTON }, 242 IDS_OPTIONS_DOWNLOADLOCATION_CHANGE_BUTTON },
243 { "downloadLocationGroupName", IDS_OPTIONS_DOWNLOADLOCATION_GROUP_NAME }, 243 { "downloadLocationGroupName", IDS_OPTIONS_DOWNLOADLOCATION_GROUP_NAME },
244 { "enableLogging", IDS_OPTIONS_ENABLE_LOGGING }, 244 { "enableLogging", IDS_OPTIONS_ENABLE_LOGGING },
245 { "metricsReportingResetRestart", IDS_OPTIONS_ENABLE_LOGGING_RESTART }, 245 { "metricsReportingResetRestart", IDS_OPTIONS_ENABLE_LOGGING_RESTART },
246 #if !defined(OS_CHROMEOS) 246 { "easyUnlockDescription", IDS_OPTIONS_EASY_UNLOCK_DESCRIPTION },
247 { "easyUnlockCheckboxLabel", IDS_OPTIONS_EASY_UNLOCK_CHECKBOX_LABEL },
248 #endif
249 { "easyUnlockSectionTitle", IDS_OPTIONS_EASY_UNLOCK_SECTION_TITLE }, 247 { "easyUnlockSectionTitle", IDS_OPTIONS_EASY_UNLOCK_SECTION_TITLE },
250 { "easyUnlockSetupButton", IDS_OPTIONS_EASY_UNLOCK_SETUP_BUTTON }, 248 { "easyUnlockSetupButton", IDS_OPTIONS_EASY_UNLOCK_SETUP_BUTTON },
251 { "easyUnlockManagement", IDS_OPTIONS_EASY_UNLOCK_MANAGEMENT }, 249 { "easyUnlockSetupIntro", IDS_OPTIONS_EASY_UNLOCK_SETUP_INTRO },
250 { "easyUnlockTurnOffButton", IDS_OPTIONS_EASY_UNLOCK_TURN_OFF_BUTTON },
251 { "easyUnlockTurnOffTitle", IDS_OPTIONS_EASY_UNLOCK_TURN_OFF_TITLE },
252 { "easyUnlockTurnOffDescription",
253 IDS_OPTIONS_EASY_UNLOCK_TURN_OFF_DESCRIPTION },
254 { "easyUnlockTurnOffOfflineTitle",
255 IDS_OPTIONS_EASY_UNLOCK_TURN_OFF_OFFLINE_TITLE },
256 { "easyUnlockTurnOffOfflineMessage",
257 IDS_OPTIONS_EASY_UNLOCK_TURN_OFF_OFFLINE_MESSAGE },
258 { "easyUnlockTurnOffErrorTitle",
259 IDS_OPTIONS_EASY_UNLOCK_TURN_OFF_ERROR_TITLE },
260 { "easyUnlockTurnOffErrorMessage",
261 IDS_OPTIONS_EASY_UNLOCK_TURN_OFF_ERROR_MESSAGE },
262 { "easyUnlockTurnOffRetryButton",
263 IDS_OPTIONS_EASY_UNLOCK_TURN_OFF_RETRY_BUTTON },
252 { "extensionControlled", IDS_OPTIONS_TAB_EXTENSION_CONTROLLED }, 264 { "extensionControlled", IDS_OPTIONS_TAB_EXTENSION_CONTROLLED },
253 { "extensionDisable", IDS_OPTIONS_TAB_EXTENSION_CONTROLLED_DISABLE }, 265 { "extensionDisable", IDS_OPTIONS_TAB_EXTENSION_CONTROLLED_DISABLE },
254 { "fontSettingsCustomizeFontsButton", 266 { "fontSettingsCustomizeFontsButton",
255 IDS_OPTIONS_FONTSETTINGS_CUSTOMIZE_FONTS_BUTTON }, 267 IDS_OPTIONS_FONTSETTINGS_CUSTOMIZE_FONTS_BUTTON },
256 { "fontSizeLabelCustom", IDS_OPTIONS_FONT_SIZE_LABEL_CUSTOM }, 268 { "fontSizeLabelCustom", IDS_OPTIONS_FONT_SIZE_LABEL_CUSTOM },
257 { "fontSizeLabelLarge", IDS_OPTIONS_FONT_SIZE_LABEL_LARGE }, 269 { "fontSizeLabelLarge", IDS_OPTIONS_FONT_SIZE_LABEL_LARGE },
258 { "fontSizeLabelMedium", IDS_OPTIONS_FONT_SIZE_LABEL_MEDIUM }, 270 { "fontSizeLabelMedium", IDS_OPTIONS_FONT_SIZE_LABEL_MEDIUM },
259 { "fontSizeLabelSmall", IDS_OPTIONS_FONT_SIZE_LABEL_SMALL }, 271 { "fontSizeLabelSmall", IDS_OPTIONS_FONT_SIZE_LABEL_SMALL },
260 { "fontSizeLabelVeryLarge", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_LARGE }, 272 { "fontSizeLabelVeryLarge", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_LARGE },
261 { "fontSizeLabelVerySmall", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_SMALL }, 273 { "fontSizeLabelVerySmall", IDS_OPTIONS_FONT_SIZE_LABEL_VERY_SMALL },
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 611
600 values->SetString("cloudPrintLearnMoreURL", chrome::kCloudPrintLearnMoreURL); 612 values->SetString("cloudPrintLearnMoreURL", chrome::kCloudPrintLearnMoreURL);
601 613
602 values->SetString("languagesLearnMoreURL", 614 values->SetString("languagesLearnMoreURL",
603 chrome::kLanguageSettingsLearnMoreUrl); 615 chrome::kLanguageSettingsLearnMoreUrl);
604 616
605 values->SetBoolean( 617 values->SetBoolean(
606 "easyUnlockAllowed", 618 "easyUnlockAllowed",
607 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->IsAllowed()); 619 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->IsAllowed());
608 values->SetString("easyUnlockLearnMoreURL", chrome::kEasyUnlockLearnMoreUrl); 620 values->SetString("easyUnlockLearnMoreURL", chrome::kEasyUnlockLearnMoreUrl);
609 values->SetString("easyUnlockManagementURL", 621
610 chrome::kEasyUnlockManagementUrl);
611 #if defined(OS_CHROMEOS) 622 #if defined(OS_CHROMEOS)
612 values->SetString("easyUnlockCheckboxLabel",
613 l10n_util::GetStringFUTF16(
614 IDS_OPTIONS_EASY_UNLOCK_CHECKBOX_LABEL_CHROMEOS,
615 chromeos::GetChromeDeviceType()));
616
617 values->SetBoolean( 623 values->SetBoolean(
618 "consumerManagementEnabled", 624 "consumerManagementEnabled",
619 CommandLine::ForCurrentProcess()->HasSwitch( 625 CommandLine::ForCurrentProcess()->HasSwitch(
620 chromeos::switches::kEnableConsumerManagement)); 626 chromeos::switches::kEnableConsumerManagement));
621 627
622 const enterprise_management::PolicyData* policy_data = 628 const enterprise_management::PolicyData* policy_data =
623 chromeos::DeviceSettingsService::Get()->policy_data(); 629 chromeos::DeviceSettingsService::Get()->policy_data();
624 values->SetBoolean( 630 values->SetBoolean(
625 "consumerManagementEnrolled", 631 "consumerManagementEnrolled",
626 policy_data && 632 policy_data &&
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 void BrowserOptionsHandler::SetupManagingSupervisedUsers() { 1789 void BrowserOptionsHandler::SetupManagingSupervisedUsers() {
1784 bool has_users = !Profile::FromWebUI(web_ui())-> 1790 bool has_users = !Profile::FromWebUI(web_ui())->
1785 GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty(); 1791 GetPrefs()->GetDictionary(prefs::kSupervisedUsers)->empty();
1786 base::FundamentalValue has_users_value(has_users); 1792 base::FundamentalValue has_users_value(has_users);
1787 web_ui()->CallJavascriptFunction( 1793 web_ui()->CallJavascriptFunction(
1788 "BrowserOptions.updateManagesSupervisedUsers", 1794 "BrowserOptions.updateManagesSupervisedUsers",
1789 has_users_value); 1795 has_users_value);
1790 } 1796 }
1791 1797
1792 void BrowserOptionsHandler::SetupEasyUnlock() { 1798 void BrowserOptionsHandler::SetupEasyUnlock() {
1799 // TODO(xiyuan): Update when pairing data is really availble.
1793 bool has_pairing = !Profile::FromWebUI(web_ui())->GetPrefs() 1800 bool has_pairing = !Profile::FromWebUI(web_ui())->GetPrefs()
1794 ->GetDictionary(prefs::kEasyUnlockPairing)->empty(); 1801 ->GetDictionary(prefs::kEasyUnlockPairing)->empty();
1795 base::FundamentalValue has_pairing_value(has_pairing); 1802 base::FundamentalValue has_pairing_value(has_pairing);
1796 web_ui()->CallJavascriptFunction( 1803 web_ui()->CallJavascriptFunction(
1797 "BrowserOptions.updateEasyUnlock", 1804 "BrowserOptions.updateEasyUnlock",
1798 has_pairing_value); 1805 has_pairing_value);
1799 } 1806 }
1800 1807
1801 void BrowserOptionsHandler::SetupExtensionControlledIndicators() { 1808 void BrowserOptionsHandler::SetupExtensionControlledIndicators() {
1802 #if defined(OS_WIN) 1809 #if defined(OS_WIN)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 extension = extensions::GetExtensionOverridingProxy( 1846 extension = extensions::GetExtensionOverridingProxy(
1840 Profile::FromWebUI(web_ui())); 1847 Profile::FromWebUI(web_ui()));
1841 AppendExtensionData("proxy", extension, &extension_controlled); 1848 AppendExtensionData("proxy", extension, &extension_controlled);
1842 1849
1843 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", 1850 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators",
1844 extension_controlled); 1851 extension_controlled);
1845 #endif // defined(OS_WIN) 1852 #endif // defined(OS_WIN)
1846 } 1853 }
1847 1854
1848 } // namespace options 1855 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/options_bundle.js ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698