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_UI_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/message_loop_helpers.h" | 12 #include "base/message_loop_helpers.h" |
13 #include "chrome/browser/extensions/image_loading_tracker.h" | 13 #include "chrome/browser/extensions/image_loading_tracker.h" |
14 #include "chrome/browser/shell_integration.h" | 14 #include "chrome/browser/shell_integration.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 #include "ui/base/gtk/gtk_signal.h" | 17 #include "ui/base/gtk/gtk_signal.h" |
18 | 18 |
19 using content::BrowserThread; | 19 using content::BrowserThread; |
20 | 20 |
21 typedef struct _GdkPixbuf GdkPixbuf; | 21 typedef struct _GdkPixbuf GdkPixbuf; |
22 typedef struct _GtkWidget GtkWidget; | 22 typedef struct _GtkWidget GtkWidget; |
23 typedef struct _GtkWindow GtkWindow; | 23 typedef struct _GtkWindow GtkWindow; |
24 | 24 |
25 class Extension; | |
26 class Profile; | 25 class Profile; |
27 class TabContentsWrapper; | 26 class TabContentsWrapper; |
28 | 27 |
| 28 namespace extensions{ |
| 29 class Extension; |
| 30 } |
| 31 |
29 class CreateApplicationShortcutsDialogGtk | 32 class CreateApplicationShortcutsDialogGtk |
30 : public base::RefCountedThreadSafe<CreateApplicationShortcutsDialogGtk, | 33 : public base::RefCountedThreadSafe<CreateApplicationShortcutsDialogGtk, |
31 BrowserThread::DeleteOnUIThread> { | 34 BrowserThread::DeleteOnUIThread> { |
32 protected: | 35 protected: |
33 explicit CreateApplicationShortcutsDialogGtk(GtkWindow* parent); | 36 explicit CreateApplicationShortcutsDialogGtk(GtkWindow* parent); |
34 virtual ~CreateApplicationShortcutsDialogGtk(); | 37 virtual ~CreateApplicationShortcutsDialogGtk(); |
35 | 38 |
36 CHROMEGTK_CALLBACK_1(CreateApplicationShortcutsDialogGtk, void, | 39 CHROMEGTK_CALLBACK_1(CreateApplicationShortcutsDialogGtk, void, |
37 OnCreateDialogResponse, int); | 40 OnCreateDialogResponse, int); |
38 | 41 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 TabContentsWrapper* tab_contents_; | 99 TabContentsWrapper* tab_contents_; |
97 | 100 |
98 DISALLOW_COPY_AND_ASSIGN(CreateWebApplicationShortcutsDialogGtk); | 101 DISALLOW_COPY_AND_ASSIGN(CreateWebApplicationShortcutsDialogGtk); |
99 }; | 102 }; |
100 | 103 |
101 class CreateChromeApplicationShortcutsDialogGtk | 104 class CreateChromeApplicationShortcutsDialogGtk |
102 : public CreateApplicationShortcutsDialogGtk, | 105 : public CreateApplicationShortcutsDialogGtk, |
103 public ImageLoadingTracker::Observer { | 106 public ImageLoadingTracker::Observer { |
104 public: | 107 public: |
105 // Displays the dialog box to create application shortcuts for |app|. | 108 // Displays the dialog box to create application shortcuts for |app|. |
106 static void Show(GtkWindow* parent, Profile* profile, const Extension* app); | 109 static void Show(GtkWindow* parent, Profile* profile, |
| 110 const extensions::Extension* app); |
107 | 111 |
108 CreateChromeApplicationShortcutsDialogGtk(GtkWindow* parent, | 112 CreateChromeApplicationShortcutsDialogGtk(GtkWindow* parent, |
109 Profile* profile, | 113 Profile* profile, |
110 const Extension* app); | 114 const extensions::Extension* app); |
111 | 115 |
112 // Implement ImageLoadingTracker::Observer. |tracker_| is used to | 116 // Implement ImageLoadingTracker::Observer. |tracker_| is used to |
113 // load the app's icon. This method recieves the icon, and adds | 117 // load the app's icon. This method recieves the icon, and adds |
114 // it to the "Create Shortcut" dailog box. | 118 // it to the "Create Shortcut" dailog box. |
115 virtual void OnImageLoaded(const gfx::Image& image, | 119 virtual void OnImageLoaded(const gfx::Image& image, |
116 const std::string& extension_id, | 120 const std::string& extension_id, |
117 int index) OVERRIDE; | 121 int index) OVERRIDE; |
118 | 122 |
119 protected: | 123 protected: |
120 virtual ~CreateChromeApplicationShortcutsDialogGtk() {} | 124 virtual ~CreateChromeApplicationShortcutsDialogGtk() {} |
121 | 125 |
122 virtual void CreateDesktopShortcut( | 126 virtual void CreateDesktopShortcut( |
123 const ShellIntegration::ShortcutInfo& shortcut_info) OVERRIDE; | 127 const ShellIntegration::ShortcutInfo& shortcut_info) OVERRIDE; |
124 | 128 |
125 private: | 129 private: |
126 const Extension* app_; | 130 const extensions::Extension* app_; |
127 FilePath profile_path_; | 131 FilePath profile_path_; |
128 ImageLoadingTracker tracker_; | 132 ImageLoadingTracker tracker_; |
129 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutsDialogGtk); | 133 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutsDialogGtk); |
130 }; | 134 }; |
131 | 135 |
132 #endif // CHROME_BROWSER_UI_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ | 136 #endif // CHROME_BROWSER_UI_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ |
OLD | NEW |