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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 TabContentsWrapper* tab_contents_; | 98 TabContentsWrapper* tab_contents_; |
96 | 99 |
97 DISALLOW_COPY_AND_ASSIGN(CreateWebApplicationShortcutsDialogGtk); | 100 DISALLOW_COPY_AND_ASSIGN(CreateWebApplicationShortcutsDialogGtk); |
98 }; | 101 }; |
99 | 102 |
100 class CreateChromeApplicationShortcutsDialogGtk | 103 class CreateChromeApplicationShortcutsDialogGtk |
101 : public CreateApplicationShortcutsDialogGtk, | 104 : public CreateApplicationShortcutsDialogGtk, |
102 public ImageLoadingTracker::Observer { | 105 public ImageLoadingTracker::Observer { |
103 public: | 106 public: |
104 // Displays the dialog box to create application shortcuts for |app|. | 107 // Displays the dialog box to create application shortcuts for |app|. |
105 static void Show(GtkWindow* parent, Profile* profile, const Extension* app); | 108 static void Show(GtkWindow* parent, Profile* profile, |
| 109 const extensions::Extension* app); |
106 | 110 |
107 CreateChromeApplicationShortcutsDialogGtk(GtkWindow* parent, | 111 CreateChromeApplicationShortcutsDialogGtk(GtkWindow* parent, |
108 Profile* profile, | 112 Profile* profile, |
109 const Extension* app); | 113 const extensions::Extension* app); |
110 virtual ~CreateChromeApplicationShortcutsDialogGtk() {} | 114 virtual ~CreateChromeApplicationShortcutsDialogGtk() {} |
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 void CreateDesktopShortcut( | 124 virtual void CreateDesktopShortcut( |
121 const ShellIntegration::ShortcutInfo& shortcut_info) OVERRIDE; | 125 const ShellIntegration::ShortcutInfo& shortcut_info) OVERRIDE; |
122 | 126 |
123 private: | 127 private: |
124 const Extension* app_; | 128 const extensions::Extension* app_; |
125 FilePath profile_path_; | 129 FilePath profile_path_; |
126 ImageLoadingTracker tracker_; | 130 ImageLoadingTracker tracker_; |
127 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutsDialogGtk); | 131 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutsDialogGtk); |
128 }; | 132 }; |
129 | 133 |
130 #endif // CHROME_BROWSER_UI_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ | 134 #endif // CHROME_BROWSER_UI_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ |
OLD | NEW |