OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
11 #include "chrome/browser/extensions/image_loading_tracker.h" | 12 #include "chrome/browser/extensions/image_loading_tracker.h" |
12 #include "chrome/browser/shell_integration.h" | 13 #include "chrome/browser/shell_integration.h" |
13 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
15 #include "ui/base/gtk/gtk_signal.h" | 16 #include "ui/base/gtk/gtk_signal.h" |
16 | 17 |
17 using content::BrowserThread; | 18 using content::BrowserThread; |
18 | 19 |
19 typedef struct _GdkPixbuf GdkPixbuf; | 20 typedef struct _GdkPixbuf GdkPixbuf; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 class CreateWebApplicationShortcutsDialogGtk | 79 class CreateWebApplicationShortcutsDialogGtk |
79 : public CreateApplicationShortcutsDialogGtk { | 80 : public CreateApplicationShortcutsDialogGtk { |
80 public: | 81 public: |
81 // Displays the dialog box to create application shortcuts for |tab_contents|. | 82 // Displays the dialog box to create application shortcuts for |tab_contents|. |
82 static void Show(GtkWindow* parent, TabContentsWrapper* tab_contents); | 83 static void Show(GtkWindow* parent, TabContentsWrapper* tab_contents); |
83 | 84 |
84 CreateWebApplicationShortcutsDialogGtk(GtkWindow* parent, | 85 CreateWebApplicationShortcutsDialogGtk(GtkWindow* parent, |
85 TabContentsWrapper* tab_contents); | 86 TabContentsWrapper* tab_contents); |
86 virtual ~CreateWebApplicationShortcutsDialogGtk() {} | 87 virtual ~CreateWebApplicationShortcutsDialogGtk() {} |
87 | 88 |
88 virtual void OnCreatedShortcut(void); | 89 virtual void OnCreatedShortcut(void) OVERRIDE; |
89 | 90 |
90 private: | 91 private: |
91 | 92 |
92 // TabContentsWrapper for which the shortcut will be created. | 93 // TabContentsWrapper for which the shortcut will be created. |
93 TabContentsWrapper* tab_contents_; | 94 TabContentsWrapper* tab_contents_; |
94 | 95 |
95 DISALLOW_COPY_AND_ASSIGN(CreateWebApplicationShortcutsDialogGtk); | 96 DISALLOW_COPY_AND_ASSIGN(CreateWebApplicationShortcutsDialogGtk); |
96 }; | 97 }; |
97 | 98 |
98 class CreateChromeApplicationShortcutsDialogGtk | 99 class CreateChromeApplicationShortcutsDialogGtk |
99 : public CreateApplicationShortcutsDialogGtk, | 100 : public CreateApplicationShortcutsDialogGtk, |
100 public ImageLoadingTracker::Observer { | 101 public ImageLoadingTracker::Observer { |
101 public: | 102 public: |
102 // Displays the dialog box to create application shortcuts for |app|. | 103 // Displays the dialog box to create application shortcuts for |app|. |
103 static void Show(GtkWindow* parent, const Extension* app); | 104 static void Show(GtkWindow* parent, const Extension* app); |
104 | 105 |
105 CreateChromeApplicationShortcutsDialogGtk(GtkWindow* parent, | 106 CreateChromeApplicationShortcutsDialogGtk(GtkWindow* parent, |
106 const Extension* app); | 107 const Extension* app); |
107 virtual ~CreateChromeApplicationShortcutsDialogGtk() {} | 108 virtual ~CreateChromeApplicationShortcutsDialogGtk() {} |
108 | 109 |
109 // Implement ImageLoadingTracker::Observer. |tracker_| is used to | 110 // Implement ImageLoadingTracker::Observer. |tracker_| is used to |
110 // load the app's icon. This method recieves the icon, and adds | 111 // load the app's icon. This method recieves the icon, and adds |
111 // it to the "Create Shortcut" dailog box. | 112 // it to the "Create Shortcut" dailog box. |
112 virtual void OnImageLoaded(SkBitmap* image, | 113 virtual void OnImageLoaded(SkBitmap* image, |
113 const ExtensionResource& resource, | 114 const ExtensionResource& resource, |
114 int index); | 115 int index) OVERRIDE; |
115 | 116 |
116 private: | 117 private: |
117 const Extension* app_; | 118 const Extension* app_; |
118 ImageLoadingTracker tracker_; | 119 ImageLoadingTracker tracker_; |
119 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutsDialogGtk); | 120 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutsDialogGtk); |
120 }; | 121 }; |
121 | 122 |
122 #endif // CHROME_BROWSER_UI_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ | 123 #endif // CHROME_BROWSER_UI_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ |
OLD | NEW |