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 | |
tapted
2014/07/11 06:10:41
nit: an -> a
sashab
2014/07/13 22:57:25
Done.
| |
54 // the app list (or a child widget in the app list). | |
55 static ExtensionUninstallDialog* CreateForAppList(Profile* profile, | |
56 gfx::NativeWindow parent, | |
57 Delegate* delegate); | |
58 | |
59 // Create an platform-specific implementation of ExtensionUninstallDialog with | |
tapted
2014/07/11 06:10:40
nit: an -> a
sashab
2014/07/13 22:57:25
Done.
| |
60 // no parent widget (behaves like a standalone window). | |
61 static ExtensionUninstallDialog* CreateAsStandaloneDialog(Profile* profile, | |
62 Delegate* delegate); | |
63 | |
54 virtual ~ExtensionUninstallDialog(); | 64 virtual ~ExtensionUninstallDialog(); |
55 | 65 |
56 // This is called to verify whether the uninstallation should proceed. | 66 // This is called to verify whether the uninstallation should proceed. |
57 // Starts the process of showing a confirmation UI, which is split into two. | 67 // Starts the process of showing a confirmation UI, which is split into two. |
58 // 1) Set off a 'load icon' task. | 68 // 1) Set off a 'load icon' task. |
59 // 2) Handle the load icon response and show the UI (OnImageLoaded). | 69 // 2) Handle the load icon response and show the UI (OnImageLoaded). |
60 void ConfirmUninstall(const Extension* extension); | 70 void ConfirmUninstall(const Extension* extension); |
61 | 71 |
62 // This shows the same dialog as above, except it also shows which extension | 72 // This shows the same dialog as above, except it also shows which extension |
63 // triggered the dialog by calling chrome.management.uninstall API. | 73 // 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_; | 127 base::MessageLoop* ui_loop_; |
118 | 128 |
119 content::NotificationRegistrar registrar_; | 129 content::NotificationRegistrar registrar_; |
120 | 130 |
121 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialog); | 131 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialog); |
122 }; | 132 }; |
123 | 133 |
124 } // namespace extensions | 134 } // namespace extensions |
125 | 135 |
126 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ | 136 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ |
OLD | NEW |