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_WEB_INTENT_PICKER_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | 15 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
16 #include "chrome/browser/ui/intents/web_intent_inline_disposition_delegate.h" | 16 #include "chrome/browser/ui/intents/web_intent_inline_disposition_delegate.h" |
17 #include "chrome/browser/ui/intents/web_intent_picker.h" | 17 #include "chrome/browser/ui/intents/web_intent_picker.h" |
18 #include "chrome/browser/ui/intents/web_intent_picker_model_observer.h" | 18 #include "chrome/browser/ui/intents/web_intent_picker_model_observer.h" |
19 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
21 #include "ui/base/gtk/gtk_signal.h" | 21 #include "ui/base/gtk/gtk_signal.h" |
22 #include "ui/base/gtk/owned_widget_gtk.h" | 22 #include "ui/base/gtk/owned_widget_gtk.h" |
23 | 23 |
24 namespace ui { | 24 namespace ui { |
25 class GtkSignalRegistrar; | 25 class GtkSignalRegistrar; |
26 } | 26 } |
27 | 27 |
28 class CustomDrawButton; | 28 class CustomDrawButton; |
29 class GURL; | 29 class GURL; |
30 class TabContents; | |
31 class ThrobberGtk; | 30 class ThrobberGtk; |
32 class WebIntentPickerDelegate; | 31 class WebIntentPickerDelegate; |
33 class WaitingDialog; | 32 class WaitingDialog; |
34 | 33 |
35 // GTK implementation of WebIntentPicker. | 34 // GTK implementation of WebIntentPicker. |
36 class WebIntentPickerGtk : public WebIntentPicker, | 35 class WebIntentPickerGtk : public WebIntentPicker, |
37 public WebIntentPickerModelObserver, | 36 public WebIntentPickerModelObserver, |
38 public ConstrainedWindowGtkDelegate, | 37 public ConstrainedWindowGtkDelegate, |
39 public content::NotificationObserver { | 38 public content::NotificationObserver { |
40 public: | 39 public: |
41 WebIntentPickerGtk(TabContents* tab_contents, | 40 WebIntentPickerGtk(content::WebContents* tab_contents, |
42 WebIntentPickerDelegate* delegate, | 41 WebIntentPickerDelegate* delegate, |
43 WebIntentPickerModel* model); | 42 WebIntentPickerModel* model); |
44 virtual ~WebIntentPickerGtk(); | 43 virtual ~WebIntentPickerGtk(); |
45 | 44 |
46 // WebIntentPicker implementation. | 45 // WebIntentPicker implementation. |
47 virtual void Close() OVERRIDE; | 46 virtual void Close() OVERRIDE; |
48 virtual void SetActionString(const string16& action) OVERRIDE; | 47 virtual void SetActionString(const string16& action) OVERRIDE; |
49 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; | 48 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; |
50 virtual void OnExtensionInstallFailure(const std::string& id) OVERRIDE; | 49 virtual void OnExtensionInstallFailure(const std::string& id) OVERRIDE; |
51 virtual void OnInlineDispositionAutoResize(const gfx::Size& size) OVERRIDE; | 50 virtual void OnInlineDispositionAutoResize(const gfx::Size& size) OVERRIDE; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 void SetWidgetsEnabled(bool enabled); | 128 void SetWidgetsEnabled(bool enabled); |
130 | 129 |
131 // Adds a throbber to the extension at |index|. Returns the alignment widget | 130 // Adds a throbber to the extension at |index|. Returns the alignment widget |
132 // containing the throbber. | 131 // containing the throbber. |
133 GtkWidget* AddThrobberToExtensionAt(size_t index); | 132 GtkWidget* AddThrobberToExtensionAt(size_t index); |
134 | 133 |
135 // Removes the added throbber. | 134 // Removes the added throbber. |
136 void RemoveThrobber(); | 135 void RemoveThrobber(); |
137 | 136 |
138 // A weak pointer to the tab contents on which to display the picker UI. | 137 // A weak pointer to the tab contents on which to display the picker UI. |
139 TabContents* tab_contents_; | 138 content::WebContents* web_contents_; |
140 | 139 |
141 // A weak pointer to the WebIntentPickerDelegate to notify when the user | 140 // A weak pointer to the WebIntentPickerDelegate to notify when the user |
142 // chooses a service or cancels. | 141 // chooses a service or cancels. |
143 WebIntentPickerDelegate* delegate_; | 142 WebIntentPickerDelegate* delegate_; |
144 | 143 |
145 // A weak pointer to the picker model. | 144 // A weak pointer to the picker model. |
146 WebIntentPickerModel* model_; | 145 WebIntentPickerModel* model_; |
147 | 146 |
148 // A weak pointer to the widget that contains all other widgets in | 147 // A weak pointer to the widget that contains all other widgets in |
149 // the picker. | 148 // the picker. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 content::NotificationRegistrar registrar_; | 187 content::NotificationRegistrar registrar_; |
189 | 188 |
190 // Used to connect to signals fired on the host tab contents (only used while | 189 // Used to connect to signals fired on the host tab contents (only used while |
191 // showing an inline intent handler). | 190 // showing an inline intent handler). |
192 scoped_ptr<ui::GtkSignalRegistrar> host_signals_; | 191 scoped_ptr<ui::GtkSignalRegistrar> host_signals_; |
193 | 192 |
194 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerGtk); | 193 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerGtk); |
195 }; | 194 }; |
196 | 195 |
197 #endif // CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ | 196 #endif // CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ |
OLD | NEW |