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

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

Issue 898003002: [Cleanup] Const-correct the profile() method for the EasyUnlockService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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 <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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698