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

Side by Side Diff: chrome/browser/extensions/api/screenlock_private/screenlock_private_api.cc

Issue 576343002: [Easy signin] Add method to get user info to easyUnlockPrivate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win fix Created 6 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/api/screenlock_private/screenlock_private_ap i.h" 5 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap i.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/extensions/api/screenlock_private.h" 10 #include "chrome/common/extensions/api/screenlock_private.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 void ScreenlockPrivateEventRouter::OnScreenDidLock() { 107 void ScreenlockPrivateEventRouter::OnScreenDidLock() {
108 DispatchEvent(screenlock::OnChanged::kEventName, 108 DispatchEvent(screenlock::OnChanged::kEventName,
109 new base::FundamentalValue(true)); 109 new base::FundamentalValue(true));
110 } 110 }
111 111
112 void ScreenlockPrivateEventRouter::OnScreenDidUnlock() { 112 void ScreenlockPrivateEventRouter::OnScreenDidUnlock() {
113 DispatchEvent(screenlock::OnChanged::kEventName, 113 DispatchEvent(screenlock::OnChanged::kEventName,
114 new base::FundamentalValue(false)); 114 new base::FundamentalValue(false));
115 } 115 }
116 116
117 void ScreenlockPrivateEventRouter::OnFocusedUserChanged(
118 const std::string& user_id) {
119 }
120
117 void ScreenlockPrivateEventRouter::DispatchEvent( 121 void ScreenlockPrivateEventRouter::DispatchEvent(
118 const std::string& event_name, 122 const std::string& event_name,
119 base::Value* arg) { 123 base::Value* arg) {
120 scoped_ptr<base::ListValue> args(new base::ListValue()); 124 scoped_ptr<base::ListValue> args(new base::ListValue());
121 if (arg) 125 if (arg)
122 args->Append(arg); 126 args->Append(arg);
123 scoped_ptr<extensions::Event> event(new extensions::Event( 127 scoped_ptr<extensions::Event> event(new extensions::Event(
124 event_name, args.Pass())); 128 event_name, args.Pass()));
125 extensions::EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass()); 129 extensions::EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass());
126 } 130 }
(...skipping 17 matching lines...) Expand all
144 scoped_ptr<base::ListValue> args(new base::ListValue()); 148 scoped_ptr<base::ListValue> args(new base::ListValue());
145 args->AppendString(screenlock::ToString(FromLockHandlerAuthType(auth_type))); 149 args->AppendString(screenlock::ToString(FromLockHandlerAuthType(auth_type)));
146 args->AppendString(value); 150 args->AppendString(value);
147 151
148 scoped_ptr<extensions::Event> event(new extensions::Event( 152 scoped_ptr<extensions::Event> event(new extensions::Event(
149 screenlock::OnAuthAttempted::kEventName, args.Pass())); 153 screenlock::OnAuthAttempted::kEventName, args.Pass()));
150 extensions::EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass()); 154 extensions::EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass());
151 } 155 }
152 156
153 } // namespace extensions 157 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698