| OLD | NEW |
| 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 Loading... |
| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 lock_handler_->Unlock(GetAuthenticatedUserEmail(profile)); | 159 lock_handler_->Unlock(GetAuthenticatedUserEmail(profile)); |
| 159 } | 160 } |
| 160 | 161 |
| 161 void ScreenlockBridge::AddObserver(Observer* observer) { | 162 void ScreenlockBridge::AddObserver(Observer* observer) { |
| 162 observers_.AddObserver(observer); | 163 observers_.AddObserver(observer); |
| 163 } | 164 } |
| 164 | 165 |
| 165 void ScreenlockBridge::RemoveObserver(Observer* observer) { | 166 void ScreenlockBridge::RemoveObserver(Observer* observer) { |
| 166 observers_.RemoveObserver(observer); | 167 observers_.RemoveObserver(observer); |
| 167 } | 168 } |
| OLD | NEW |