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

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

Issue 2903353003: Adding mojo calls for easy unlock service (Closed)
Patch Set: Incoporate pathset 3 comments 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 if (hardlock_on_click_) 83 if (hardlock_on_click_)
84 result->SetBoolean("hardlockOnClick", true); 84 result->SetBoolean("hardlockOnClick", true);
85 85
86 if (is_trial_run_) 86 if (is_trial_run_)
87 result->SetBoolean("isTrialRun", true); 87 result->SetBoolean("isTrialRun", true);
88 88
89 return result; 89 return result;
90 } 90 }
91 91
92 ash::mojom::UserPodCustomIconOptionsPtr
93 ScreenlockBridge::UserPodCustomIconOptions::ToUserPodCustomIconOptionsPtr()
94 const {
95 ash::mojom::UserPodCustomIconOptionsPtr icon_options =
96 ash::mojom::UserPodCustomIconOptions::New();
97 std::string icon_id = GetIdForIcon(icon_);
98 icon_options->id = icon_id;
99
100 if (!tooltip_.empty()) {
101 icon_options->tooltip = tooltip_;
102 icon_options->autoshow_tooltip = autoshow_tooltip_;
103 }
104
105 if (!aria_label_.empty())
106 icon_options->aria_label = aria_label_;
107
108 if (hardlock_on_click_)
109 icon_options->hardlock_on_click = true;
110
111 if (is_trial_run_)
112 icon_options->is_trial_run = true;
113
114 return icon_options;
115 }
116
92 void ScreenlockBridge::UserPodCustomIconOptions::SetIcon( 117 void ScreenlockBridge::UserPodCustomIconOptions::SetIcon(
93 ScreenlockBridge::UserPodCustomIcon icon) { 118 ScreenlockBridge::UserPodCustomIcon icon) {
94 icon_ = icon; 119 icon_ = icon;
95 } 120 }
96 121
97 void ScreenlockBridge::UserPodCustomIconOptions::SetTooltip( 122 void ScreenlockBridge::UserPodCustomIconOptions::SetTooltip(
98 const base::string16& tooltip, 123 const base::string16& tooltip,
99 bool autoshow) { 124 bool autoshow) {
100 tooltip_ = tooltip; 125 tooltip_ = tooltip;
101 autoshow_tooltip_ = autoshow; 126 autoshow_tooltip_ = autoshow;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 observers_.RemoveObserver(observer); 207 observers_.RemoveObserver(observer);
183 } 208 }
184 209
185 ScreenlockBridge::ScreenlockBridge() 210 ScreenlockBridge::ScreenlockBridge()
186 : lock_handler_(nullptr), focused_account_id_(EmptyAccountId()) {} 211 : lock_handler_(nullptr), focused_account_id_(EmptyAccountId()) {}
187 212
188 ScreenlockBridge::~ScreenlockBridge() { 213 ScreenlockBridge::~ScreenlockBridge() {
189 } 214 }
190 215
191 } // namespace proximity_auth 216 } // namespace proximity_auth
OLDNEW
« components/proximity_auth/BUILD.gn ('K') | « components/proximity_auth/screenlock_bridge.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698