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

Side by Side Diff: components/proximity_auth/screenlock_bridge.cc

Issue 2903353003: Adding mojo calls for easy unlock service (Closed)
Patch Set: comments and rebase Created 3 years, 6 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
« no previous file with comments | « components/proximity_auth/screenlock_bridge.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/proximity_auth/screenlock_bridge.h" 5 #include "components/proximity_auth/screenlock_bridge.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 hardlock_on_click_(false), 60 hardlock_on_click_(false),
61 is_trial_run_(false) { 61 is_trial_run_(false) {
62 } 62 }
63 63
64 ScreenlockBridge::UserPodCustomIconOptions::~UserPodCustomIconOptions() { 64 ScreenlockBridge::UserPodCustomIconOptions::~UserPodCustomIconOptions() {
65 } 65 }
66 66
67 std::unique_ptr<base::DictionaryValue> 67 std::unique_ptr<base::DictionaryValue>
68 ScreenlockBridge::UserPodCustomIconOptions::ToDictionaryValue() const { 68 ScreenlockBridge::UserPodCustomIconOptions::ToDictionaryValue() const {
69 auto result = base::MakeUnique<base::DictionaryValue>(); 69 auto result = base::MakeUnique<base::DictionaryValue>();
70 std::string icon_id = GetIdForIcon(icon_); 70 result->SetString("id", GetIDString());
71 result->SetString("id", icon_id);
72 71
73 if (!tooltip_.empty()) { 72 if (!tooltip_.empty()) {
74 auto tooltip_options = base::MakeUnique<base::DictionaryValue>(); 73 auto tooltip_options = base::MakeUnique<base::DictionaryValue>();
75 tooltip_options->SetString("text", tooltip_); 74 tooltip_options->SetString("text", tooltip_);
76 tooltip_options->SetBoolean("autoshow", autoshow_tooltip_); 75 tooltip_options->SetBoolean("autoshow", autoshow_tooltip_);
77 result->Set("tooltip", std::move(tooltip_options)); 76 result->Set("tooltip", std::move(tooltip_options));
78 } 77 }
79 78
80 if (!aria_label_.empty()) 79 if (!aria_label_.empty())
81 result->SetString("ariaLabel", aria_label_); 80 result->SetString("ariaLabel", aria_label_);
(...skipping 25 matching lines...) Expand all
107 } 106 }
108 107
109 void ScreenlockBridge::UserPodCustomIconOptions::SetHardlockOnClick() { 108 void ScreenlockBridge::UserPodCustomIconOptions::SetHardlockOnClick() {
110 hardlock_on_click_ = true; 109 hardlock_on_click_ = true;
111 } 110 }
112 111
113 void ScreenlockBridge::UserPodCustomIconOptions::SetTrialRun() { 112 void ScreenlockBridge::UserPodCustomIconOptions::SetTrialRun() {
114 is_trial_run_ = true; 113 is_trial_run_ = true;
115 } 114 }
116 115
116 std::string ScreenlockBridge::UserPodCustomIconOptions::GetIDString() const {
117 return GetIdForIcon(icon_);
118 }
119
117 // static 120 // static
118 ScreenlockBridge* ScreenlockBridge::Get() { 121 ScreenlockBridge* ScreenlockBridge::Get() {
119 return g_screenlock_bridge_instance.Pointer(); 122 return g_screenlock_bridge_instance.Pointer();
120 } 123 }
121 124
122 void ScreenlockBridge::SetLockHandler(LockHandler* lock_handler) { 125 void ScreenlockBridge::SetLockHandler(LockHandler* lock_handler) {
123 // Don't notify observers if there is no change -- i.e. if the screen was 126 // Don't notify observers if there is no change -- i.e. if the screen was
124 // already unlocked, and is remaining unlocked. 127 // already unlocked, and is remaining unlocked.
125 if (lock_handler == lock_handler_) 128 if (lock_handler == lock_handler_)
126 return; 129 return;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 observers_.RemoveObserver(observer); 185 observers_.RemoveObserver(observer);
183 } 186 }
184 187
185 ScreenlockBridge::ScreenlockBridge() 188 ScreenlockBridge::ScreenlockBridge()
186 : lock_handler_(nullptr), focused_account_id_(EmptyAccountId()) {} 189 : lock_handler_(nullptr), focused_account_id_(EmptyAccountId()) {}
187 190
188 ScreenlockBridge::~ScreenlockBridge() { 191 ScreenlockBridge::~ScreenlockBridge() {
189 } 192 }
190 193
191 } // namespace proximity_auth 194 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « components/proximity_auth/screenlock_bridge.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698