| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | 16 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
| 17 #include "chrome/browser/ui/intents/web_intent_inline_disposition_delegate.h" | 17 #include "chrome/browser/ui/intents/web_intent_inline_disposition_delegate.h" |
| 18 #include "chrome/browser/ui/intents/web_intent_picker.h" | 18 #include "chrome/browser/ui/intents/web_intent_picker.h" |
| 19 #include "chrome/browser/ui/intents/web_intent_picker_model_observer.h" | 19 #include "chrome/browser/ui/intents/web_intent_picker_model_observer.h" |
| 20 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
| 21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
| 22 #include "ui/base/gtk/gtk_signal.h" | 22 #include "ui/base/gtk/gtk_signal.h" |
| 23 #include "ui/base/gtk/owned_widget_gtk.h" | 23 #include "ui/base/gtk/owned_widget_gtk.h" |
| 24 | 24 |
| 25 class CustomDrawButton; | 25 class CustomDrawButton; |
| 26 class GURL; | 26 class GURL; |
| 27 class TabContentsContainerGtk; | 27 class TabContentsContainerGtk; |
| 28 class TabContents; | 28 class TabContents; |
| 29 typedef TabContents TabContentsWrapper; | |
| 30 class ThrobberGtk; | 29 class ThrobberGtk; |
| 31 class WebIntentPickerDelegate; | 30 class WebIntentPickerDelegate; |
| 32 | 31 |
| 33 // GTK implementation of WebIntentPicker. | 32 // GTK implementation of WebIntentPicker. |
| 34 class WebIntentPickerGtk : public WebIntentPicker, | 33 class WebIntentPickerGtk : public WebIntentPicker, |
| 35 public WebIntentPickerModelObserver, | 34 public WebIntentPickerModelObserver, |
| 36 public ConstrainedWindowGtkDelegate, | 35 public ConstrainedWindowGtkDelegate, |
| 37 public content::NotificationObserver { | 36 public content::NotificationObserver { |
| 38 public: | 37 public: |
| 39 WebIntentPickerGtk(TabContentsWrapper* tab_contents, | 38 WebIntentPickerGtk(TabContents* tab_contents, |
| 40 WebIntentPickerDelegate* delegate, | 39 WebIntentPickerDelegate* delegate, |
| 41 WebIntentPickerModel* model); | 40 WebIntentPickerModel* model); |
| 42 virtual ~WebIntentPickerGtk(); | 41 virtual ~WebIntentPickerGtk(); |
| 43 | 42 |
| 44 // WebIntentPicker implementation. | 43 // WebIntentPicker implementation. |
| 45 virtual void Close() OVERRIDE; | 44 virtual void Close() OVERRIDE; |
| 46 virtual void SetActionString(const string16& action) OVERRIDE; | 45 virtual void SetActionString(const string16& action) OVERRIDE; |
| 47 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; | 46 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; |
| 48 virtual void OnExtensionInstallFailure(const std::string& id) OVERRIDE; | 47 virtual void OnExtensionInstallFailure(const std::string& id) OVERRIDE; |
| 49 | 48 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 void SetWidgetsEnabled(bool enabled); | 109 void SetWidgetsEnabled(bool enabled); |
| 111 | 110 |
| 112 // Adds a throbber to the extension at |index|. Returns the alignment widget | 111 // Adds a throbber to the extension at |index|. Returns the alignment widget |
| 113 // containing the throbber. | 112 // containing the throbber. |
| 114 GtkWidget* AddThrobberToExtensionAt(size_t index); | 113 GtkWidget* AddThrobberToExtensionAt(size_t index); |
| 115 | 114 |
| 116 // Removes the added throbber. | 115 // Removes the added throbber. |
| 117 void RemoveThrobber(); | 116 void RemoveThrobber(); |
| 118 | 117 |
| 119 // A weak pointer to the tab contents on which to display the picker UI. | 118 // A weak pointer to the tab contents on which to display the picker UI. |
| 120 TabContentsWrapper* wrapper_; | 119 TabContents* tab_contents_; |
| 121 | 120 |
| 122 // A weak pointer to the WebIntentPickerDelegate to notify when the user | 121 // A weak pointer to the WebIntentPickerDelegate to notify when the user |
| 123 // chooses a service or cancels. | 122 // chooses a service or cancels. |
| 124 WebIntentPickerDelegate* delegate_; | 123 WebIntentPickerDelegate* delegate_; |
| 125 | 124 |
| 126 // A weak pointer to the picker model. | 125 // A weak pointer to the picker model. |
| 127 WebIntentPickerModel* model_; | 126 WebIntentPickerModel* model_; |
| 128 | 127 |
| 129 // A weak pointer to the widget that contains all other widgets in | 128 // A weak pointer to the widget that contains all other widgets in |
| 130 // the picker. | 129 // the picker. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 146 // A button to close the picker. | 145 // A button to close the picker. |
| 147 scoped_ptr<CustomDrawButton> close_button_; | 146 scoped_ptr<CustomDrawButton> close_button_; |
| 148 | 147 |
| 149 // The throbber to display when installing an extension. | 148 // The throbber to display when installing an extension. |
| 150 scoped_ptr<ThrobberGtk> throbber_; | 149 scoped_ptr<ThrobberGtk> throbber_; |
| 151 | 150 |
| 152 // A weak pointer to the constrained window. | 151 // A weak pointer to the constrained window. |
| 153 ConstrainedWindowGtk* window_; | 152 ConstrainedWindowGtk* window_; |
| 154 | 153 |
| 155 // Container for the HTML in the inline disposition case. | 154 // Container for the HTML in the inline disposition case. |
| 156 scoped_ptr<TabContentsWrapper> inline_disposition_tab_contents_; | 155 scoped_ptr<TabContents> inline_disposition_tab_contents_; |
| 157 | 156 |
| 158 // Widget for displaying the HTML in the inline disposition case. | 157 // Widget for displaying the HTML in the inline disposition case. |
| 159 scoped_ptr<TabContentsContainerGtk> tab_contents_container_; | 158 scoped_ptr<TabContentsContainerGtk> tab_contents_container_; |
| 160 | 159 |
| 161 // content::WebContentsDelegate for the inline disposition dialog. | 160 // content::WebContentsDelegate for the inline disposition dialog. |
| 162 scoped_ptr<WebIntentInlineDispositionDelegate> inline_disposition_delegate_; | 161 scoped_ptr<WebIntentInlineDispositionDelegate> inline_disposition_delegate_; |
| 163 | 162 |
| 164 content::NotificationRegistrar registrar_; | 163 content::NotificationRegistrar registrar_; |
| 165 | 164 |
| 166 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerGtk); | 165 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerGtk); |
| 167 }; | 166 }; |
| 168 | 167 |
| 169 #endif // CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ | 168 #endif // CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ |
| OLD | NEW |