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/chromeos/screensaver/screensaver_controller.h" | 5 #include "chrome/browser/chromeos/screensaver/screensaver_controller.h" |
6 | 6 |
7 #include "ash/screensaver/screensaver_view.h" | 7 #include "ash/screensaver/screensaver_view.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/wm/user_activity_detector.h" | 9 #include "ash/wm/user_activity_detector.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // the one with exclude_id. | 38 // the one with exclude_id. |
39 std::string FindScreensaverExtension(ExtensionService* service, | 39 std::string FindScreensaverExtension(ExtensionService* service, |
40 const std::string& exclude_id) { | 40 const std::string& exclude_id) { |
41 const ExtensionSet* extensions = service->extensions(); | 41 const ExtensionSet* extensions = service->extensions(); |
42 if (!extensions) | 42 if (!extensions) |
43 return std::string(); | 43 return std::string(); |
44 | 44 |
45 for (ExtensionSet::const_iterator it = extensions->begin(); | 45 for (ExtensionSet::const_iterator it = extensions->begin(); |
46 it != extensions->end(); | 46 it != extensions->end(); |
47 ++it) { | 47 ++it) { |
48 const extensions::Extension* extension = *it; | 48 const extensions::Extension* extension = it->get(); |
49 if (extension && | 49 if (extension && |
50 extension->id() != exclude_id && | 50 extension->id() != exclude_id && |
51 extension->HasAPIPermission(extensions::APIPermission::kScreensaver)) { | 51 extension->HasAPIPermission(extensions::APIPermission::kScreensaver)) { |
52 return extension->id(); | 52 return extension->id(); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 return std::string(); | 56 return std::string(); |
57 } | 57 } |
58 | 58 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 ash::CloseScreensaver(); | 178 ash::CloseScreensaver(); |
179 screensaver_extension_id_ = ""; | 179 screensaver_extension_id_ = ""; |
180 } | 180 } |
181 | 181 |
182 void ScreensaverController::RequestNextIdleNotification() { | 182 void ScreensaverController::RequestNextIdleNotification() { |
183 DBusThreadManager::Get()->GetPowerManagerClient()-> | 183 DBusThreadManager::Get()->GetPowerManagerClient()-> |
184 RequestIdleNotification(threshold_.InMilliseconds()); | 184 RequestIdleNotification(threshold_.InMilliseconds()); |
185 } | 185 } |
186 | 186 |
187 } // namespace chromeos | 187 } // namespace chromeos |
OLD | NEW |