| 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> |
| 8 |
| 7 #include "base/macros.h" | 9 #include "base/macros.h" |
| 8 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| 9 #include "base/values.h" | 11 #include "base/values.h" |
| 10 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 11 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/extensions/event_router_forwarder.h" | 14 #include "chrome/browser/extensions/event_router_forwarder.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/common/extensions/api/system_private.h" | 16 #include "chrome/common/extensions/api/system_private.h" |
| 15 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 16 #include "google_apis/google_api_keys.h" | 18 #include "google_apis/google_api_keys.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 52 |
| 51 // Dispatches an extension event with |argument| | 53 // Dispatches an extension event with |argument| |
| 52 void DispatchEvent(extensions::events::HistogramValue histogram_value, | 54 void DispatchEvent(extensions::events::HistogramValue histogram_value, |
| 53 const std::string& event_name, | 55 const std::string& event_name, |
| 54 base::Value* argument) { | 56 base::Value* argument) { |
| 55 scoped_ptr<base::ListValue> list_args(new base::ListValue()); | 57 scoped_ptr<base::ListValue> list_args(new base::ListValue()); |
| 56 if (argument) { | 58 if (argument) { |
| 57 list_args->Append(argument); | 59 list_args->Append(argument); |
| 58 } | 60 } |
| 59 g_browser_process->extension_event_router_forwarder() | 61 g_browser_process->extension_event_router_forwarder() |
| 60 ->BroadcastEventToRenderers(histogram_value, event_name, list_args.Pass(), | 62 ->BroadcastEventToRenderers(histogram_value, event_name, |
| 61 GURL()); | 63 std::move(list_args), GURL()); |
| 62 } | 64 } |
| 63 | 65 |
| 64 } // namespace | 66 } // namespace |
| 65 | 67 |
| 66 namespace extensions { | 68 namespace extensions { |
| 67 | 69 |
| 68 namespace system_private = api::system_private; | 70 namespace system_private = api::system_private; |
| 69 | 71 |
| 70 bool SystemPrivateGetIncognitoModeAvailabilityFunction::RunSync() { | 72 bool SystemPrivateGetIncognitoModeAvailabilityFunction::RunSync() { |
| 71 PrefService* prefs = GetProfile()->GetPrefs(); | 73 PrefService* prefs = GetProfile()->GetPrefs(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 DispatchEvent(extensions::events::SYSTEM_PRIVATE_ON_SCREEN_UNLOCKED, | 166 DispatchEvent(extensions::events::SYSTEM_PRIVATE_ON_SCREEN_UNLOCKED, |
| 165 system_private::OnScreenUnlocked::kEventName, NULL); | 167 system_private::OnScreenUnlocked::kEventName, NULL); |
| 166 } | 168 } |
| 167 | 169 |
| 168 void DispatchWokeUpEvent() { | 170 void DispatchWokeUpEvent() { |
| 169 DispatchEvent(extensions::events::SYSTEM_PRIVATE_ON_WOKE_UP, | 171 DispatchEvent(extensions::events::SYSTEM_PRIVATE_ON_WOKE_UP, |
| 170 system_private::OnWokeUp::kEventName, NULL); | 172 system_private::OnWokeUp::kEventName, NULL); |
| 171 } | 173 } |
| 172 | 174 |
| 173 } // namespace extensions | 175 } // namespace extensions |
| OLD | NEW |