OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/system_private/system_private_api.h" | 5 #include "chrome/browser/extensions/api/system_private/system_private_api.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 const char kNeedRestartState[] = "NeedRestart"; | 47 const char kNeedRestartState[] = "NeedRestart"; |
48 | 48 |
49 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
50 const char kUpdatingState[] = "Updating"; | 50 const char kUpdatingState[] = "Updating"; |
51 #endif // defined(OS_CHROMEOS) | 51 #endif // defined(OS_CHROMEOS) |
52 | 52 |
53 // Dispatches an extension event with |argument| | 53 // Dispatches an extension event with |argument| |
54 void DispatchEvent(extensions::events::HistogramValue histogram_value, | 54 void DispatchEvent(extensions::events::HistogramValue histogram_value, |
55 const std::string& event_name, | 55 const std::string& event_name, |
56 base::Value* argument) { | 56 base::Value* argument) { |
57 scoped_ptr<base::ListValue> list_args(new base::ListValue()); | 57 std::unique_ptr<base::ListValue> list_args(new base::ListValue()); |
58 if (argument) { | 58 if (argument) { |
59 list_args->Append(argument); | 59 list_args->Append(argument); |
60 } | 60 } |
61 g_browser_process->extension_event_router_forwarder() | 61 g_browser_process->extension_event_router_forwarder() |
62 ->BroadcastEventToRenderers(histogram_value, event_name, | 62 ->BroadcastEventToRenderers(histogram_value, event_name, |
63 std::move(list_args), GURL()); | 63 std::move(list_args), GURL()); |
64 } | 64 } |
65 | 65 |
66 } // namespace | 66 } // namespace |
67 | 67 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 DispatchEvent(extensions::events::SYSTEM_PRIVATE_ON_SCREEN_UNLOCKED, | 166 DispatchEvent(extensions::events::SYSTEM_PRIVATE_ON_SCREEN_UNLOCKED, |
167 system_private::OnScreenUnlocked::kEventName, NULL); | 167 system_private::OnScreenUnlocked::kEventName, NULL); |
168 } | 168 } |
169 | 169 |
170 void DispatchWokeUpEvent() { | 170 void DispatchWokeUpEvent() { |
171 DispatchEvent(extensions::events::SYSTEM_PRIVATE_ON_WOKE_UP, | 171 DispatchEvent(extensions::events::SYSTEM_PRIVATE_ON_WOKE_UP, |
172 system_private::OnWokeUp::kEventName, NULL); | 172 system_private::OnWokeUp::kEventName, NULL); |
173 } | 173 } |
174 | 174 |
175 } // namespace extensions | 175 } // namespace extensions |
OLD | NEW |