| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_DOM_UI_APP_LAUNCHER_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_APP_LAUNCHER_HANDLER_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_APP_LAUNCHER_HANDLER_H_ | 6 #define CHROME_BROWSER_DOM_UI_APP_LAUNCHER_HANDLER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/dom_ui/dom_ui.h" | 8 #include "chrome/browser/dom_ui/dom_ui.h" |
| 9 #include "chrome/common/notification_registrar.h" | 9 #include "chrome/common/notification_registrar.h" |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 virtual void RegisterMessages(); | 28 virtual void RegisterMessages(); |
| 29 | 29 |
| 30 // NotificationObserver | 30 // NotificationObserver |
| 31 virtual void Observe(NotificationType type, | 31 virtual void Observe(NotificationType type, |
| 32 const NotificationSource& source, | 32 const NotificationSource& source, |
| 33 const NotificationDetails& details); | 33 const NotificationDetails& details); |
| 34 | 34 |
| 35 // Populate a dictionary with the information from an extension. | 35 // Populate a dictionary with the information from an extension. |
| 36 static void CreateAppInfo(Extension* extension, DictionaryValue* value); | 36 static void CreateAppInfo(Extension* extension, DictionaryValue* value); |
| 37 | 37 |
| 38 // Callback for the "getAll" message. | 38 // Callback for the "getApps" message. |
| 39 void HandleGetApps(const Value* value); | 39 void HandleGetApps(const Value* value); |
| 40 | 40 |
| 41 // Callback for the "launch" message. | 41 // Callback for the "launchApp" message. |
| 42 void HandleLaunchApp(const Value* value); | 42 void HandleLaunchApp(const Value* value); |
| 43 | 43 |
| 44 // Callback for the "uninstallApp" message. |
| 45 void HandleUninstallApp(const Value* value); |
| 46 |
| 44 private: | 47 private: |
| 45 // Starts the animation of the app icon. | 48 // Starts the animation of the app icon. |
| 46 void AnimateAppIcon(Extension* extension, const gfx::Rect& rect); | 49 void AnimateAppIcon(Extension* extension, const gfx::Rect& rect); |
| 47 | 50 |
| 48 // The apps are represented in the extensions model. | 51 // The apps are represented in the extensions model. |
| 49 scoped_refptr<ExtensionsService> extensions_service_; | 52 scoped_refptr<ExtensionsService> extensions_service_; |
| 50 | 53 |
| 51 // We monitor changes to the extension system so that we can reload the apps | 54 // We monitor changes to the extension system so that we can reload the apps |
| 52 // when necessary. | 55 // when necessary. |
| 53 NotificationRegistrar registrar_; | 56 NotificationRegistrar registrar_; |
| 54 | 57 |
| 55 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); | 58 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 #endif // CHROME_BROWSER_DOM_UI_APP_LAUNCHER_HANDLER_H_ | 61 #endif // CHROME_BROWSER_DOM_UI_APP_LAUNCHER_HANDLER_H_ |
| OLD | NEW |