OLD | NEW |
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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 values->SetString("hotwordLearnMoreURL", chrome::kHotwordLearnMoreURL); | 530 values->SetString("hotwordLearnMoreURL", chrome::kHotwordLearnMoreURL); |
531 RegisterTitle(values, "hotwordConfirmOverlay", | 531 RegisterTitle(values, "hotwordConfirmOverlay", |
532 IDS_HOTWORD_CONFIRM_BUBBLE_TITLE); | 532 IDS_HOTWORD_CONFIRM_BUBBLE_TITLE); |
533 values->SetString("hotwordManageAudioHistoryURL", | 533 values->SetString("hotwordManageAudioHistoryURL", |
534 chrome::kManageAudioHistoryURL); | 534 chrome::kManageAudioHistoryURL); |
535 | 535 |
536 #if defined(OS_CHROMEOS) | 536 #if defined(OS_CHROMEOS) |
537 Profile* profile = Profile::FromWebUI(web_ui()); | 537 Profile* profile = Profile::FromWebUI(web_ui()); |
538 std::string username = profile->GetProfileUserName(); | 538 std::string username = profile->GetProfileUserName(); |
539 if (username.empty()) { | 539 if (username.empty()) { |
540 user_manager::User* user = | 540 const user_manager::User* user = |
541 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 541 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
542 if (user && (user->GetType() != user_manager::USER_TYPE_GUEST)) | 542 if (user && (user->GetType() != user_manager::USER_TYPE_GUEST)) |
543 username = user->email(); | 543 username = user->email(); |
544 } | 544 } |
545 if (!username.empty()) | 545 if (!username.empty()) |
546 username = gaia::SanitizeEmail(gaia::CanonicalizeEmail(username)); | 546 username = gaia::SanitizeEmail(gaia::CanonicalizeEmail(username)); |
547 | 547 |
548 values->SetString("username", username); | 548 values->SetString("username", username); |
549 #endif | 549 #endif |
550 // Pass along sync status early so it will be available during page init. | 550 // Pass along sync status early so it will be available during page init. |
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, | 2120 void BrowserOptionsHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns, |
2121 const policy::PolicyMap& previous, | 2121 const policy::PolicyMap& previous, |
2122 const policy::PolicyMap& current) { | 2122 const policy::PolicyMap& current) { |
2123 std::set<std::string> different_keys; | 2123 std::set<std::string> different_keys; |
2124 current.GetDifferingKeys(previous, &different_keys); | 2124 current.GetDifferingKeys(previous, &different_keys); |
2125 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) | 2125 if (ContainsKey(different_keys, policy::key::kMetricsReportingEnabled)) |
2126 SetupMetricsReportingCheckbox(); | 2126 SetupMetricsReportingCheckbox(); |
2127 } | 2127 } |
2128 | 2128 |
2129 } // namespace options | 2129 } // namespace options |
OLD | NEW |