Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: chrome/browser/chromeos/screensaver/screensaver_controller.cc

Issue 14238037: Made it possible to tell whether an extension is being installed or updated. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added extra check. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 TeardownScreensaver(); 96 TeardownScreensaver();
97 } 97 }
98 98
99 void ScreensaverController::Observe( 99 void ScreensaverController::Observe(
100 int type, 100 int type,
101 const content::NotificationSource& source, 101 const content::NotificationSource& source,
102 const content::NotificationDetails& details) { 102 const content::NotificationDetails& details) {
103 switch (type) { 103 switch (type) {
104 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { 104 case chrome::NOTIFICATION_EXTENSION_INSTALLED: {
105 const extensions::Extension* extension = 105 const extensions::Extension* extension =
106 content::Details<const extensions::Extension>(details).ptr(); 106 content::Details<const extensions::InstalledExtensionInfo>(details)->
107 extension;
107 // Uninstall any previously installed screensaver extensions if a new 108 // Uninstall any previously installed screensaver extensions if a new
108 // screensaver extension is installed. 109 // screensaver extension is installed.
109 if (extension->HasAPIPermission(extensions::APIPermission::kScreensaver)) 110 if (extension->HasAPIPermission(extensions::APIPermission::kScreensaver))
110 UninstallPreviousScreensavers(extension); 111 UninstallPreviousScreensavers(extension);
111 break; 112 break;
112 } 113 }
113 case chrome::NOTIFICATION_EXTENSION_LOADED: { 114 case chrome::NOTIFICATION_EXTENSION_LOADED: {
114 const extensions::Extension* extension = 115 const extensions::Extension* extension =
115 content::Details<const extensions::Extension>(details).ptr(); 116 content::Details<const extensions::Extension>(details).ptr();
116 if (extension->HasAPIPermission(extensions::APIPermission::kScreensaver)) 117 if (extension->HasAPIPermission(extensions::APIPermission::kScreensaver))
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 ash::CloseScreensaver(); 176 ash::CloseScreensaver();
176 screensaver_extension_id_ = ""; 177 screensaver_extension_id_ = "";
177 } 178 }
178 179
179 void ScreensaverController::RequestNextIdleNotification() { 180 void ScreensaverController::RequestNextIdleNotification() {
180 DBusThreadManager::Get()->GetPowerManagerClient()-> 181 DBusThreadManager::Get()->GetPowerManagerClient()->
181 RequestIdleNotification(threshold_.InMilliseconds()); 182 RequestIdleNotification(threshold_.InMilliseconds());
182 } 183 }
183 184
184 } // namespace chromeos 185 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/enterprise_extension_observer.cc ('k') | chrome/browser/extensions/api/commands/command_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698