| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_EXTENSIONS_EXTENSION_INSTALL_UI_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ |
| 7 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/gfx/native_widget_types.h" | 9 #include "base/gfx/native_widget_types.h" |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| 11 | 11 |
| 12 #include <string> |
| 13 |
| 12 class Extension; | 14 class Extension; |
| 13 class ExtensionsService; | 15 class ExtensionsService; |
| 14 class MessageLoop; | 16 class MessageLoop; |
| 15 class Profile; | 17 class Profile; |
| 16 class SandboxedExtensionUnpacker; | 18 class SandboxedExtensionUnpacker; |
| 17 class SkBitmap; | 19 class SkBitmap; |
| 18 | 20 |
| 19 // Displays all the UI around extension installation. | 21 // Displays all the UI around extension installation. |
| 20 class ExtensionInstallUI { | 22 class ExtensionInstallUI { |
| 21 public: | 23 public: |
| 22 class Delegate { | 24 class Delegate { |
| 23 public: | 25 public: |
| 24 // We call this method after ConfirmInstall() to signal that the | 26 // We call this method after ConfirmInstall() to signal that the |
| 25 // installation should continue. | 27 // installation should continue. |
| 26 virtual void ContinueInstall() = 0; | 28 virtual void ContinueInstall() = 0; |
| 27 | 29 |
| 28 // We call this method after ConfirmInstall() to signal that the | 30 // We call this method after ConfirmInstall() to signal that the |
| 29 // installation should stop. | 31 // installation should stop. |
| 30 virtual void AbortInstall() = 0; | 32 virtual void AbortInstall() = 0; |
| 31 }; | 33 }; |
| 32 | 34 |
| 33 // NOTE: The implementation of this is platform-specific. | 35 // NOTE: The implementation of this is platform-specific. |
| 34 static void ShowExtensionInstallPrompt(Profile* profile, | 36 static void ShowExtensionInstallPrompt(Profile* profile, |
| 35 Delegate* delegate, | 37 Delegate* delegate, |
| 36 Extension* extension, | 38 Extension* extension, |
| 37 SkBitmap* install_icon); | 39 SkBitmap* install_icon, |
| 40 const std::wstring& warning_text); |
| 38 | 41 |
| 39 ExtensionInstallUI(Profile* profile); | 42 ExtensionInstallUI(Profile* profile); |
| 40 | 43 |
| 41 // This is called by the installer to verify whether the installation should | 44 // This is called by the installer to verify whether the installation should |
| 42 // proceed. | 45 // proceed. |
| 43 // | 46 // |
| 44 // We *MUST* eventually call either ContinueInstall() or AbortInstall() | 47 // We *MUST* eventually call either ContinueInstall() or AbortInstall() |
| 45 // on |delegate|. | 48 // on |delegate|. |
| 46 void ConfirmInstall(Delegate* delegate, Extension* extension, | 49 void ConfirmInstall(Delegate* delegate, Extension* extension, |
| 47 SkBitmap* icon); | 50 SkBitmap* icon); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 58 | 61 |
| 59 private: | 62 private: |
| 60 void ShowThemeInfoBar(Extension* new_theme); | 63 void ShowThemeInfoBar(Extension* new_theme); |
| 61 | 64 |
| 62 Profile* profile_; | 65 Profile* profile_; |
| 63 MessageLoop* ui_loop_; | 66 MessageLoop* ui_loop_; |
| 64 std::string previous_theme_id_; // Used to undo theme installation. | 67 std::string previous_theme_id_; // Used to undo theme installation. |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ | 70 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ |
| OLD | NEW |