Chromium Code Reviews| Index: chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h |
| diff --git a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h |
| index 054a0bd13d83ed7fa40357d06b7adafaa6673d02..cd56d50cf681b139b2d05e1bd80c7abe79674988 100644 |
| --- a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h |
| +++ b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h |
| @@ -10,6 +10,7 @@ |
| #include "base/basictypes.h" |
| #include "base/ref_counted.h" |
| #include "chrome/browser/browser_thread.h" |
| +#include "chrome/browser/extensions/image_loading_tracker.h" |
| #include "chrome/browser/shell_integration.h" |
| #include "googleurl/src/gurl.h" |
| @@ -17,21 +18,17 @@ typedef struct _GdkPixbuf GdkPixbuf; |
| typedef struct _GtkWidget GtkWidget; |
| typedef struct _GtkWindow GtkWindow; |
| +class Extension; |
| class TabContents; |
| class CreateApplicationShortcutsDialogGtk |
| : public base::RefCountedThreadSafe<CreateApplicationShortcutsDialogGtk, |
| BrowserThread::DeleteOnUIThread> { |
| - public: |
| - // Displays the dialog box to create application shortcuts for |tab_contents|. |
| - static void Show(GtkWindow* parent, TabContents* tab_contents); |
| - |
| - private: |
| - friend class BrowserThread; |
| - friend class DeleteTask<CreateApplicationShortcutsDialogGtk>; |
| + friend class BrowserThread; |
|
Aaron Boodman
2010/11/30 00:29:28
I usually see friend declarations inside a private
Sam Kerner (Chrome)
2010/11/30 01:21:04
Done.
|
| + friend class DeleteTask<CreateApplicationShortcutsDialogGtk>; |
| - CreateApplicationShortcutsDialogGtk(GtkWindow* parent, |
| - TabContents* tab_contents); |
| + protected: |
| + explicit CreateApplicationShortcutsDialogGtk(GtkWindow* parent); |
| virtual ~CreateApplicationShortcutsDialogGtk(); |
| CHROMEGTK_CALLBACK_1(CreateApplicationShortcutsDialogGtk, void, |
| @@ -43,17 +40,20 @@ class CreateApplicationShortcutsDialogGtk |
| CHROMEGTK_CALLBACK_0(CreateApplicationShortcutsDialogGtk, void, |
| OnToggleCheckbox); |
| + virtual void CreateDialogBox(GtkWindow* parent); |
| + virtual void CreateIconPixBuf(const SkBitmap& bitmap); |
| + virtual void OnCreatedShortcut(void) = 0; |
| + |
| void CreateDesktopShortcut( |
| const ShellIntegration::ShortcutInfo& shortcut_info); |
| void ShowErrorDialog(); |
| + GtkWindow* parent_; |
| + |
| // UI elements. |
| GtkWidget* desktop_checkbox_; |
| GtkWidget* menu_checkbox_; |
| - // TabContents for which the shortcut will be created. |
| - TabContents* tab_contents_; |
| - |
| // ShortcutInfo for the new shortcut. |
| ShellIntegration::ShortcutInfo shortcut_info_; |
| @@ -69,4 +69,50 @@ class CreateApplicationShortcutsDialogGtk |
| DISALLOW_COPY_AND_ASSIGN(CreateApplicationShortcutsDialogGtk); |
| }; |
| +class CreateWebApplicationShortcutsDialogGtk |
| + : public CreateApplicationShortcutsDialogGtk { |
| + public: |
| + // Displays the dialog box to create application shortcuts for |tab_contents|. |
| + static void Show(GtkWindow* parent, TabContents* tab_contents); |
| + |
| + explicit CreateWebApplicationShortcutsDialogGtk(GtkWindow* parent, |
| + TabContents* tab_contents); |
| + virtual ~CreateWebApplicationShortcutsDialogGtk() {} |
| + |
| + virtual void OnCreatedShortcut(void); |
| + |
| + private: |
| + |
| + // TabContents for which the shortcut will be created. |
| + TabContents* tab_contents_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(CreateWebApplicationShortcutsDialogGtk); |
| +}; |
| + |
| +class CreateChromeApplicationShortcutsDialogGtk |
| + : public CreateApplicationShortcutsDialogGtk, |
| + public ImageLoadingTracker::Observer { |
| + public: |
| + // Displays the dialog box to create application shortcuts for |app|. |
| + static void Show(GtkWindow* parent, const Extension* app); |
| + |
| + explicit CreateChromeApplicationShortcutsDialogGtk(GtkWindow* parent, |
| + const Extension* app); |
| + virtual ~CreateChromeApplicationShortcutsDialogGtk() {} |
| + |
| + virtual void OnCreatedShortcut(void); |
| + |
| + // Implement ImageLoadingTracker::Observer. |tracker_| is used to |
| + // load the app's icon. This method recieves the icon, and adds |
| + // it to the "Create Shortcut" dailog box. |
| + virtual void OnImageLoaded(SkBitmap* image, |
| + ExtensionResource resource, |
| + int index); |
| + |
| + private: |
| + const Extension* app_; |
| + ImageLoadingTracker tracker_; |
| + DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutsDialogGtk); |
| +}; |
| + |
| #endif // CHROME_BROWSER_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ |