| 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 "components/proximity_auth/screenlock_bridge.h" | 5 #include "components/proximity_auth/screenlock_bridge.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "components/proximity_auth/logging/logging.h" | 9 #include "components/proximity_auth/logging/logging.h" |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 void ScreenlockBridge::UserPodCustomIconOptions::SetTrialRun() { | 110 void ScreenlockBridge::UserPodCustomIconOptions::SetTrialRun() { |
| 111 is_trial_run_ = true; | 111 is_trial_run_ = true; |
| 112 } | 112 } |
| 113 | 113 |
| 114 // static | 114 // static |
| 115 ScreenlockBridge* ScreenlockBridge::Get() { | 115 ScreenlockBridge* ScreenlockBridge::Get() { |
| 116 return g_screenlock_bridge_instance.Pointer(); | 116 return g_screenlock_bridge_instance.Pointer(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void ScreenlockBridge::SetLockHandler(LockHandler* lock_handler) { | 119 void ScreenlockBridge::SetLockHandler(LockHandler* lock_handler) { |
| 120 DCHECK(lock_handler_ == nullptr || lock_handler == nullptr); | |
| 121 | |
| 122 // Don't notify observers if there is no change -- i.e. if the screen was | 120 // Don't notify observers if there is no change -- i.e. if the screen was |
| 123 // already unlocked, and is remaining unlocked. | 121 // already unlocked, and is remaining unlocked. |
| 124 if (lock_handler == lock_handler_) | 122 if (lock_handler == lock_handler_) |
| 125 return; | 123 return; |
| 126 | 124 |
| 125 DCHECK(lock_handler_ == nullptr || lock_handler == nullptr); |
| 126 |
| 127 // TODO(isherman): If |lock_handler| is null, then |lock_handler_| might have | 127 // TODO(isherman): If |lock_handler| is null, then |lock_handler_| might have |
| 128 // been freed. Cache the screen type rather than querying it below. | 128 // been freed. Cache the screen type rather than querying it below. |
| 129 LockHandler::ScreenType screen_type; | 129 LockHandler::ScreenType screen_type; |
| 130 if (lock_handler_) | 130 if (lock_handler_) |
| 131 screen_type = lock_handler_->GetScreenType(); | 131 screen_type = lock_handler_->GetScreenType(); |
| 132 else | 132 else |
| 133 screen_type = lock_handler->GetScreenType(); | 133 screen_type = lock_handler->GetScreenType(); |
| 134 | 134 |
| 135 focused_account_id_ = EmptyAccountId(); | 135 focused_account_id_ = EmptyAccountId(); |
| 136 lock_handler_ = lock_handler; | 136 lock_handler_ = lock_handler; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 observers_.RemoveObserver(observer); | 179 observers_.RemoveObserver(observer); |
| 180 } | 180 } |
| 181 | 181 |
| 182 ScreenlockBridge::ScreenlockBridge() | 182 ScreenlockBridge::ScreenlockBridge() |
| 183 : lock_handler_(nullptr), focused_account_id_(EmptyAccountId()) {} | 183 : lock_handler_(nullptr), focused_account_id_(EmptyAccountId()) {} |
| 184 | 184 |
| 185 ScreenlockBridge::~ScreenlockBridge() { | 185 ScreenlockBridge::~ScreenlockBridge() { |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace proximity_auth | 188 } // namespace proximity_auth |
| OLD | NEW |