Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
| 14 #include "ui/gfx/image/image_skia.h" | 14 #include "ui/gfx/image/image_skia.h" |
| 15 #include "ui/gfx/native_widget_types.h" | |
| 15 | 16 |
| 16 class Browser; | 17 class Browser; |
| 17 class Profile; | 18 class Profile; |
| 18 | 19 |
| 19 namespace base { | 20 namespace base { |
| 20 class MessageLoop; | 21 class MessageLoop; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace gfx { | 24 namespace gfx { |
| 24 class Image; | 25 class Image; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 36 // We call this method to signal that the uninstallation should continue. | 37 // We call this method to signal that the uninstallation should continue. |
| 37 virtual void ExtensionUninstallAccepted() = 0; | 38 virtual void ExtensionUninstallAccepted() = 0; |
| 38 | 39 |
| 39 // We call this method to signal that the uninstallation should stop. | 40 // We call this method to signal that the uninstallation should stop. |
| 40 virtual void ExtensionUninstallCanceled() = 0; | 41 virtual void ExtensionUninstallCanceled() = 0; |
| 41 | 42 |
| 42 protected: | 43 protected: |
| 43 virtual ~Delegate() {} | 44 virtual ~Delegate() {} |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 // Creates a platform specific implementation of ExtensionUninstallDialog. | 47 // Creates a platform-specific implementation of ExtensionUninstallDialog for |
| 47 // |profile| and |delegate| can never be NULL. | 48 // the given browser window. |
| 48 // |browser| can be NULL only for Ash when this is used with the applist | |
| 49 // window. | |
| 50 static ExtensionUninstallDialog* Create(Profile* profile, | 49 static ExtensionUninstallDialog* Create(Profile* profile, |
| 51 Browser* browser, | 50 Browser* browser, |
| 52 Delegate* delegate); | 51 Delegate* delegate); |
| 53 | 52 |
| 53 // Create an platform-specific implementation of ExtensionUninstallDialog for | |
| 54 // a non-browser window, such as the app list. | |
| 55 static ExtensionUninstallDialog* CreateForNonBrowserWindow( | |
|
tapted
2014/07/11 04:39:15
I'd probably still call it CreateForAppList - it's
sashab
2014/07/11 05:58:57
Done.
| |
| 56 Profile* profile, | |
| 57 gfx::NativeWindow parent, | |
| 58 Delegate* delegate); | |
| 59 | |
| 54 virtual ~ExtensionUninstallDialog(); | 60 virtual ~ExtensionUninstallDialog(); |
| 55 | 61 |
| 56 // This is called to verify whether the uninstallation should proceed. | 62 // This is called to verify whether the uninstallation should proceed. |
| 57 // Starts the process of showing a confirmation UI, which is split into two. | 63 // Starts the process of showing a confirmation UI, which is split into two. |
| 58 // 1) Set off a 'load icon' task. | 64 // 1) Set off a 'load icon' task. |
| 59 // 2) Handle the load icon response and show the UI (OnImageLoaded). | 65 // 2) Handle the load icon response and show the UI (OnImageLoaded). |
| 60 void ConfirmUninstall(const Extension* extension); | 66 void ConfirmUninstall(const Extension* extension); |
| 61 | 67 |
| 62 // This shows the same dialog as above, except it also shows which extension | 68 // This shows the same dialog as above, except it also shows which extension |
| 63 // triggered the dialog by calling chrome.management.uninstall API. | 69 // triggered the dialog by calling chrome.management.uninstall API. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 base::MessageLoop* ui_loop_; | 123 base::MessageLoop* ui_loop_; |
| 118 | 124 |
| 119 content::NotificationRegistrar registrar_; | 125 content::NotificationRegistrar registrar_; |
| 120 | 126 |
| 121 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialog); | 127 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialog); |
| 122 }; | 128 }; |
| 123 | 129 |
| 124 } // namespace extensions | 130 } // namespace extensions |
| 125 | 131 |
| 126 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ | 132 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ |
| OLD | NEW |