| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ | |
| 6 #define CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <vector> | |
| 10 | |
| 11 #include <gtk/gtk.h> | |
| 12 | |
| 13 #include "base/basictypes.h" | |
| 14 #include "base/compiler_specific.h" | |
| 15 #include "base/memory/scoped_ptr.h" | |
| 16 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | |
| 17 #include "chrome/browser/ui/intents/web_intent_picker.h" | |
| 18 #include "ui/base/gtk/gtk_signal.h" | |
| 19 | |
| 20 class CustomDrawButton; | |
| 21 class GURL; | |
| 22 class TabContents; | |
| 23 class WebIntentController; | |
| 24 class WebIntentPickerDelegate; | |
| 25 | |
| 26 // Gtk implementation of WebIntentPicker. | |
| 27 class WebIntentPickerGtk : public WebIntentPicker, | |
| 28 public ConstrainedWindowGtkDelegate { | |
| 29 public: | |
| 30 WebIntentPickerGtk(TabContents* tab_contents, | |
| 31 WebIntentPickerDelegate* delegate); | |
| 32 virtual ~WebIntentPickerGtk(); | |
| 33 | |
| 34 // WebIntentPicker implementation. | |
| 35 virtual void SetServiceURLs(const std::vector<GURL>& urls) OVERRIDE; | |
| 36 virtual void SetServiceIcon(size_t index, const SkBitmap& icon) OVERRIDE; | |
| 37 virtual void SetDefaultServiceIcon(size_t index) OVERRIDE; | |
| 38 virtual void Show() OVERRIDE; | |
| 39 virtual void Close() OVERRIDE; | |
| 40 | |
| 41 // ConstrainedWindowGtkDelegate implementation. | |
| 42 virtual GtkWidget* GetWidgetRoot() OVERRIDE; | |
| 43 virtual GtkWidget* GetFocusWidget() OVERRIDE; | |
| 44 virtual void DeleteDelegate() OVERRIDE; | |
| 45 | |
| 46 private: | |
| 47 // Callback when a service button is clicked. | |
| 48 CHROMEGTK_CALLBACK_0(WebIntentPickerGtk, void, OnServiceButtonClick); | |
| 49 // Callback when close button is clicked. | |
| 50 CHROMEGTK_CALLBACK_0(WebIntentPickerGtk, void, OnCloseButtonClick); | |
| 51 | |
| 52 // A weak pointer to the tab contents on which to display the picker UI. | |
| 53 TabContents* tab_contents_; | |
| 54 | |
| 55 // A weak pointer to the WebIntentPickerDelegate to notify when the user | |
| 56 // chooses a service or cancels. | |
| 57 WebIntentPickerDelegate* delegate_; | |
| 58 | |
| 59 // The root GtkWidget of the dialog. | |
| 60 ui::OwnedWidgetGtk root_; | |
| 61 | |
| 62 // A weak pointer to the hbox that contains the buttons used to choose the | |
| 63 // service. | |
| 64 GtkWidget* button_hbox_; | |
| 65 | |
| 66 // A button to close the dialog delegate. | |
| 67 scoped_ptr<CustomDrawButton> close_button_; | |
| 68 | |
| 69 // The displayed constrained window. Technically owned by the TabContents | |
| 70 // page, but this object tells it when to destroy. | |
| 71 ConstrainedWindow* window_; | |
| 72 | |
| 73 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerGtk); | |
| 74 }; | |
| 75 | |
| 76 #endif // CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_ | |
| OLD | NEW |