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 "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/extensions/event_router_forwarder.h" | 10 #include "chrome/browser/extensions/event_router_forwarder.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 break; | 117 break; |
118 } | 118 } |
119 #else | 119 #else |
120 if (UpgradeDetector::GetInstance()->notify_upgrade()) { | 120 if (UpgradeDetector::GetInstance()->notify_upgrade()) { |
121 state = kNeedRestartState; | 121 state = kNeedRestartState; |
122 download_progress = 1; | 122 download_progress = 1; |
123 } else { | 123 } else { |
124 state = kNotAvailableState; | 124 state = kNotAvailableState; |
125 } | 125 } |
126 #endif | 126 #endif |
127 DictionaryValue* dict = new DictionaryValue(); | 127 base::DictionaryValue* dict = new base::DictionaryValue(); |
128 dict->SetString(kStateKey, state); | 128 dict->SetString(kStateKey, state); |
129 dict->SetDouble(kDownloadProgressKey, download_progress); | 129 dict->SetDouble(kDownloadProgressKey, download_progress); |
130 SetResult(dict); | 130 SetResult(dict); |
131 | 131 |
132 return true; | 132 return true; |
133 } | 133 } |
134 | 134 |
135 void DispatchVolumeChangedEvent(double volume, bool is_volume_muted) { | 135 void DispatchVolumeChangedEvent(double volume, bool is_volume_muted) { |
136 DictionaryValue* dict = new DictionaryValue(); | 136 base::DictionaryValue* dict = new base::DictionaryValue(); |
137 dict->SetDouble(kVolumeKey, volume); | 137 dict->SetDouble(kVolumeKey, volume); |
138 dict->SetBoolean(kIsVolumeMutedKey, is_volume_muted); | 138 dict->SetBoolean(kIsVolumeMutedKey, is_volume_muted); |
139 DispatchEvent(kOnVolumeChanged, dict); | 139 DispatchEvent(kOnVolumeChanged, dict); |
140 } | 140 } |
141 | 141 |
142 void DispatchBrightnessChangedEvent(int brightness, bool user_initiated) { | 142 void DispatchBrightnessChangedEvent(int brightness, bool user_initiated) { |
143 DictionaryValue* dict = new DictionaryValue(); | 143 base::DictionaryValue* dict = new base::DictionaryValue(); |
144 dict->SetInteger(kBrightnessKey, brightness); | 144 dict->SetInteger(kBrightnessKey, brightness); |
145 dict->SetBoolean(kUserInitiatedKey, user_initiated); | 145 dict->SetBoolean(kUserInitiatedKey, user_initiated); |
146 DispatchEvent(kOnBrightnessChanged, dict); | 146 DispatchEvent(kOnBrightnessChanged, dict); |
147 } | 147 } |
148 | 148 |
149 void DispatchScreenUnlockedEvent() { | 149 void DispatchScreenUnlockedEvent() { |
150 DispatchEvent(kOnScreenUnlocked, NULL); | 150 DispatchEvent(kOnScreenUnlocked, NULL); |
151 } | 151 } |
152 | 152 |
153 void DispatchWokeUpEvent() { | 153 void DispatchWokeUpEvent() { |
154 DispatchEvent(kOnWokeUp, NULL); | 154 DispatchEvent(kOnWokeUp, NULL); |
155 } | 155 } |
156 | 156 |
157 } // namespace extensions | 157 } // namespace extensions |
OLD | NEW |