| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |