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

Side by Side Diff: chrome/browser/signin/screenlock_bridge.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/signin/screenlock_bridge.h" 5 #include "chrome/browser/signin/screenlock_bridge.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "chrome/browser/profiles/profile_window.h" 9 #include "chrome/browser/profiles/profile_window.h"
10 #include "chrome/browser/signin/signin_manager_factory.h" 10 #include "chrome/browser/signin/signin_manager_factory.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 void ScreenlockBridge::UserPodCustomIconOptions::SetAriaLabel( 102 void ScreenlockBridge::UserPodCustomIconOptions::SetAriaLabel(
103 const base::string16& aria_label) { 103 const base::string16& aria_label) {
104 aria_label_ = aria_label; 104 aria_label_ = aria_label;
105 } 105 }
106 106
107 void ScreenlockBridge::UserPodCustomIconOptions::SetHardlockOnClick() { 107 void ScreenlockBridge::UserPodCustomIconOptions::SetHardlockOnClick() {
108 hardlock_on_click_ = true; 108 hardlock_on_click_ = true;
109 } 109 }
110 110
111 // static 111 // static
112 std::string ScreenlockBridge::GetAuthenticatedUserEmail(Profile* profile) { 112 std::string ScreenlockBridge::GetAuthenticatedUserEmail(
113 const Profile* profile) {
113 // |profile| has to be a signed-in profile with SigninManager already 114 // |profile| has to be a signed-in profile with SigninManager already
114 // created. Otherwise, just crash to collect stack. 115 // created. Otherwise, just crash to collect stack.
115 SigninManagerBase* signin_manager = 116 const SigninManagerBase* signin_manager =
116 SigninManagerFactory::GetForProfileIfExists(profile); 117 SigninManagerFactory::GetForProfileIfExists(profile);
117 return signin_manager->GetAuthenticatedUsername(); 118 return signin_manager->GetAuthenticatedUsername();
118 } 119 }
119 120
120 ScreenlockBridge::ScreenlockBridge() : lock_handler_(NULL) { 121 ScreenlockBridge::ScreenlockBridge() : lock_handler_(NULL) {
121 } 122 }
122 123
123 ScreenlockBridge::~ScreenlockBridge() { 124 ScreenlockBridge::~ScreenlockBridge() {
124 } 125 }
125 126
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 lock_handler_->Unlock(GetAuthenticatedUserEmail(profile)); 173 lock_handler_->Unlock(GetAuthenticatedUserEmail(profile));
173 } 174 }
174 175
175 void ScreenlockBridge::AddObserver(Observer* observer) { 176 void ScreenlockBridge::AddObserver(Observer* observer) {
176 observers_.AddObserver(observer); 177 observers_.AddObserver(observer);
177 } 178 }
178 179
179 void ScreenlockBridge::RemoveObserver(Observer* observer) { 180 void ScreenlockBridge::RemoveObserver(Observer* observer) {
180 observers_.RemoveObserver(observer); 181 observers_.RemoveObserver(observer);
181 } 182 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/screenlock_bridge.h ('k') | chrome/browser/signin/signin_manager_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698