| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/extensions/extension_app_api.h" |
| 10 #include "chrome/browser/extensions/extension_install_ui.h" | 11 #include "chrome/browser/extensions/extension_install_ui.h" |
| 11 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 12 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| 12 #include "chrome/browser/prefs/pref_change_registrar.h" | 13 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 13 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
| 14 #include "chrome/common/extensions/extension_constants.h" | 15 #include "chrome/common/extensions/extension_constants.h" |
| 15 #include "content/browser/webui/web_ui.h" | 16 #include "content/browser/webui/web_ui.h" |
| 16 #include "content/common/notification_observer.h" | 17 #include "content/common/notification_observer.h" |
| 17 #include "content/common/notification_registrar.h" | 18 #include "content/common/notification_registrar.h" |
| 18 | 19 |
| 19 class ExtensionPrefs; | 20 class ExtensionPrefs; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 30 class AppLauncherHandler : public WebUIMessageHandler, | 31 class AppLauncherHandler : public WebUIMessageHandler, |
| 31 public ExtensionUninstallDialog::Delegate, | 32 public ExtensionUninstallDialog::Delegate, |
| 32 public ExtensionInstallUI::Delegate, | 33 public ExtensionInstallUI::Delegate, |
| 33 public NotificationObserver { | 34 public NotificationObserver { |
| 34 public: | 35 public: |
| 35 explicit AppLauncherHandler(ExtensionService* extension_service); | 36 explicit AppLauncherHandler(ExtensionService* extension_service); |
| 36 virtual ~AppLauncherHandler(); | 37 virtual ~AppLauncherHandler(); |
| 37 | 38 |
| 38 // Populate a dictionary with the information from an extension. | 39 // Populate a dictionary with the information from an extension. |
| 39 static void CreateAppInfo(const Extension* extension, | 40 static void CreateAppInfo(const Extension* extension, |
| 41 const AppNotificationList* notifications, |
| 40 ExtensionPrefs* extension_prefs, | 42 ExtensionPrefs* extension_prefs, |
| 41 DictionaryValue* value); | 43 DictionaryValue* value); |
| 42 | 44 |
| 43 // Callback for pings related to launching apps on the NTP. | 45 // Callback for pings related to launching apps on the NTP. |
| 44 static bool HandlePing(Profile* profile, const std::string& path); | 46 static bool HandlePing(Profile* profile, const std::string& path); |
| 45 | 47 |
| 46 // WebUIMessageHandler implementation. | 48 // WebUIMessageHandler implementation. |
| 47 virtual WebUIMessageHandler* Attach(WebUI* web_ui); | 49 virtual WebUIMessageHandler* Attach(WebUI* web_ui); |
| 48 virtual void RegisterMessages(); | 50 virtual void RegisterMessages(); |
| 49 | 51 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 bool promo_active_; | 149 bool promo_active_; |
| 148 | 150 |
| 149 // When true, we ignore changes to the underlying data rather than immediately | 151 // When true, we ignore changes to the underlying data rather than immediately |
| 150 // refreshing. This is useful when making many batch updates to avoid flicker. | 152 // refreshing. This is useful when making many batch updates to avoid flicker. |
| 151 bool ignore_changes_; | 153 bool ignore_changes_; |
| 152 | 154 |
| 153 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); | 155 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); |
| 154 }; | 156 }; |
| 155 | 157 |
| 156 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 158 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
| OLD | NEW |