Chromium Code Reviews| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/browser/dom_ui/dom_ui.h" | 10 #include "chrome/browser/dom_ui/dom_ui.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 | 57 |
| 58 // Callback for the "setLaunchType" message. | 58 // Callback for the "setLaunchType" message. |
| 59 void HandleSetLaunchType(const ListValue* args); | 59 void HandleSetLaunchType(const ListValue* args); |
| 60 | 60 |
| 61 // Callback for the "uninstallApp" message. | 61 // Callback for the "uninstallApp" message. |
| 62 void HandleUninstallApp(const ListValue* args); | 62 void HandleUninstallApp(const ListValue* args); |
| 63 | 63 |
| 64 // Callback for the "hideAppPromo" message. | 64 // Callback for the "hideAppPromo" message. |
| 65 void HandleHideAppsPromo(const ListValue* args); | 65 void HandleHideAppsPromo(const ListValue* args); |
| 66 | 66 |
| 67 // Callback for pings related to launching apps on the NTP. | |
| 68 static bool HandlePing(const std::string& path); | |
|
Aaron Boodman
2010/11/12 19:01:02
We seem to usually put the statics methods togethe
| |
| 69 | |
| 67 private: | 70 private: |
| 68 // ExtensionInstallUI::Delegate implementation, used for receiving | 71 // ExtensionInstallUI::Delegate implementation, used for receiving |
| 69 // notification about uninstall confirmation dialog selections. | 72 // notification about uninstall confirmation dialog selections. |
| 70 virtual void InstallUIProceed(); | 73 virtual void InstallUIProceed(); |
| 71 virtual void InstallUIAbort(); | 74 virtual void InstallUIAbort(); |
| 72 | 75 |
| 73 // Returns the ExtensionInstallUI object for this class, creating it if | 76 // Returns the ExtensionInstallUI object for this class, creating it if |
| 74 // needed. | 77 // needed. |
| 75 ExtensionInstallUI* GetExtensionInstallUI(); | 78 ExtensionInstallUI* GetExtensionInstallUI(); |
| 76 | 79 |
| 77 // Starts the animation of the app icon. | 80 // Starts the animation of the app icon. |
| 78 void AnimateAppIcon(const Extension* extension, const gfx::Rect& rect); | 81 void AnimateAppIcon(const Extension* extension, const gfx::Rect& rect); |
| 79 | 82 |
| 83 // Records a web store launch in the appropriate histograms. |promo_active| | |
| 84 // specifies if the web store promotion was active. | |
| 85 static void RecordWebStoreLaunch(bool promo_active); | |
|
Aaron Boodman
2010/11/12 19:01:02
Same here.
| |
| 86 | |
| 87 // Records an app launch in the appropriate histograms. |promo_active| | |
| 88 // specifies if the web store promotion was active. | |
| 89 static void RecordAppLaunch(bool promo_active); | |
| 90 | |
| 80 // The apps are represented in the extensions model. | 91 // The apps are represented in the extensions model. |
| 81 scoped_refptr<ExtensionsService> extensions_service_; | 92 scoped_refptr<ExtensionsService> extensions_service_; |
| 82 | 93 |
| 83 // We monitor changes to the extension system so that we can reload the apps | 94 // We monitor changes to the extension system so that we can reload the apps |
| 84 // when necessary. | 95 // when necessary. |
| 85 NotificationRegistrar registrar_; | 96 NotificationRegistrar registrar_; |
| 86 | 97 |
| 87 // Monitor extension preference changes so that the DOM UI can be notified. | 98 // Monitor extension preference changes so that the DOM UI can be notified. |
| 88 PrefChangeRegistrar pref_change_registrar_; | 99 PrefChangeRegistrar pref_change_registrar_; |
| 89 | 100 |
| 90 // Used to show confirmation UI for uninstalling/enabling extensions in | 101 // Used to show confirmation UI for uninstalling/enabling extensions in |
| 91 // incognito mode. | 102 // incognito mode. |
| 92 scoped_ptr<ExtensionInstallUI> install_ui_; | 103 scoped_ptr<ExtensionInstallUI> install_ui_; |
| 93 | 104 |
| 94 // The id of the extension we are prompting the user about. | 105 // The id of the extension we are prompting the user about. |
| 95 std::string extension_id_prompting_; | 106 std::string extension_id_prompting_; |
| 96 | 107 |
| 108 // Whether the promo is currently being shown. | |
| 109 bool promo_active_; | |
| 110 | |
| 97 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); | 111 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); |
| 98 }; | 112 }; |
| 99 | 113 |
| 100 #endif // CHROME_BROWSER_DOM_UI_APP_LAUNCHER_HANDLER_H_ | 114 #endif // CHROME_BROWSER_DOM_UI_APP_LAUNCHER_HANDLER_H_ |
| OLD | NEW |