| 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 class CustomDrawButton; | 24 class CustomDrawButton; |
| 25 class GURL; | 25 class GURL; |
| 26 class TabContentsContainerGtk; | 26 class TabContentsContainerGtk; |
| 27 class TabContents; | 27 class TabContents; |
| 28 class ThrobberGtk; | 28 class ThrobberGtk; |
| 29 class WebIntentPickerDelegate; | 29 class WebIntentPickerDelegate; |
| 30 class WaitingDialog; |
| 30 | 31 |
| 31 // GTK implementation of WebIntentPicker. | 32 // GTK implementation of WebIntentPicker. |
| 32 class WebIntentPickerGtk : public WebIntentPicker, | 33 class WebIntentPickerGtk : public WebIntentPicker, |
| 33 public WebIntentPickerModelObserver, | 34 public WebIntentPickerModelObserver, |
| 34 public ConstrainedWindowGtkDelegate, | 35 public ConstrainedWindowGtkDelegate, |
| 35 public content::NotificationObserver { | 36 public content::NotificationObserver { |
| 36 public: | 37 public: |
| 37 WebIntentPickerGtk(TabContents* tab_contents, | 38 WebIntentPickerGtk(TabContents* tab_contents, |
| 38 WebIntentPickerDelegate* delegate, | 39 WebIntentPickerDelegate* delegate, |
| 39 WebIntentPickerModel* model); | 40 WebIntentPickerModel* model); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 CHROMEGTK_CALLBACK_0(WebIntentPickerGtk, void, OnExtensionInstallButtonClick); | 82 CHROMEGTK_CALLBACK_0(WebIntentPickerGtk, void, OnExtensionInstallButtonClick); |
| 82 // Callback when "more suggestions" link is clicked. | 83 // Callback when "more suggestions" link is clicked. |
| 83 CHROMEGTK_CALLBACK_0(WebIntentPickerGtk, void, OnMoreSuggestionsLinkClick); | 84 CHROMEGTK_CALLBACK_0(WebIntentPickerGtk, void, OnMoreSuggestionsLinkClick); |
| 84 // Callback when "or choose another service" link is clicked. | 85 // Callback when "or choose another service" link is clicked. |
| 85 CHROMEGTK_CALLBACK_0(WebIntentPickerGtk, void, OnChooseAnotherServiceClick); | 86 CHROMEGTK_CALLBACK_0(WebIntentPickerGtk, void, OnChooseAnotherServiceClick); |
| 86 | 87 |
| 87 // Initialize the contents of the picker. After this call, contents_ will be | 88 // Initialize the contents of the picker. After this call, contents_ will be |
| 88 // non-NULL. | 89 // non-NULL. |
| 89 void InitContents(); | 90 void InitContents(); |
| 90 | 91 |
| 92 // Initialize the main picker dialog. |
| 93 void InitMainContents(); |
| 94 |
| 91 // Reset contents to the initial picker state. | 95 // Reset contents to the initial picker state. |
| 92 void ResetContents(); | 96 void ResetContents(); |
| 93 | 97 |
| 94 // Create the (inset relative to |box|) container for dialog elements. | 98 // Create the (inset relative to |box|) container for dialog elements. |
| 95 GtkWidget* CreateSubContents(GtkWidget* box); | 99 GtkWidget* CreateSubContents(GtkWidget* box); |
| 96 | 100 |
| 97 // Add a close button to dialog contents | 101 // Add a close button to dialog contents |
| 98 void AddCloseButton(GtkWidget* containingBox); | 102 void AddCloseButton(GtkWidget* containingBox); |
| 99 | 103 |
| 100 // Add title to dialog contents | 104 // Add title to dialog contents |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 152 |
| 149 // A weak pointer to the suggested extensions vbox. | 153 // A weak pointer to the suggested extensions vbox. |
| 150 GtkWidget* extensions_vbox_; | 154 GtkWidget* extensions_vbox_; |
| 151 | 155 |
| 152 // A button to close the picker. | 156 // A button to close the picker. |
| 153 scoped_ptr<CustomDrawButton> close_button_; | 157 scoped_ptr<CustomDrawButton> close_button_; |
| 154 | 158 |
| 155 // The throbber to display when installing an extension. | 159 // The throbber to display when installing an extension. |
| 156 scoped_ptr<ThrobberGtk> throbber_; | 160 scoped_ptr<ThrobberGtk> throbber_; |
| 157 | 161 |
| 162 scoped_ptr<WaitingDialog> waiting_dialog_; |
| 163 |
| 158 // A weak pointer to the constrained window. | 164 // A weak pointer to the constrained window. |
| 159 ConstrainedWindowGtk* window_; | 165 ConstrainedWindowGtk* window_; |
| 160 | 166 |
| 161 // Container for the HTML in the inline disposition case. | 167 // Container for the HTML in the inline disposition case. |
| 162 scoped_ptr<TabContents> inline_disposition_tab_contents_; | 168 scoped_ptr<TabContents> inline_disposition_tab_contents_; |
| 163 | 169 |
| 164 // Widget for displaying the HTML in the inline disposition case. | 170 // Widget for displaying the HTML in the inline disposition case. |
| 165 scoped_ptr<TabContentsContainerGtk> tab_contents_container_; | 171 scoped_ptr<TabContentsContainerGtk> tab_contents_container_; |
| 166 | 172 |
| 167 // content::WebContentsDelegate for the inline disposition dialog. | 173 // content::WebContentsDelegate for the inline disposition dialog. |
| 168 scoped_ptr<WebIntentInlineDispositionDelegate> inline_disposition_delegate_; | 174 scoped_ptr<WebIntentInlineDispositionDelegate> inline_disposition_delegate_; |
| 169 | 175 |
| 170 content::NotificationRegistrar registrar_; | 176 content::NotificationRegistrar registrar_; |
| 171 | 177 |
| 172 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerGtk); | 178 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerGtk); |
| 173 }; | 179 }; |
| 174 | 180 |
| 175 #endif // CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ | 181 #endif // CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ |
| OLD | NEW |