Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1013)

Unified Diff: chrome/browser/ui/gtk/web_intent_picker_gtk.h

Issue 7715037: Web Intent Picker UI (implemented as a constrained dialog, linux only) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: linux_views/chromeos fix Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm ('k') | chrome/browser/ui/gtk/web_intent_picker_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/web_intent_picker_gtk.h
diff --git a/chrome/browser/ui/gtk/web_intent_picker_gtk.h b/chrome/browser/ui/gtk/web_intent_picker_gtk.h
new file mode 100644
index 0000000000000000000000000000000000000000..b85fd808abd02236f651af6d0c236fdb79d79cac
--- /dev/null
+++ b/chrome/browser/ui/gtk/web_intent_picker_gtk.h
@@ -0,0 +1,76 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_
+#define CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_
+#pragma once
+
+#include <vector>
+
+#include <gtk/gtk.h>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/gtk/constrained_window_gtk.h"
+#include "chrome/browser/ui/intents/web_intent_picker.h"
+#include "ui/base/gtk/gtk_signal.h"
+
+class CustomDrawButton;
+class GURL;
+class TabContents;
+class WebIntentController;
+class WebIntentPickerDelegate;
+
+// Gtk implementation of WebIntentPicker.
+class WebIntentPickerGtk : public WebIntentPicker,
+ public ConstrainedDialogDelegate {
+ public:
+ WebIntentPickerGtk(TabContents* tab_contents,
+ WebIntentPickerDelegate* delegate);
+ virtual ~WebIntentPickerGtk();
+
+ // WebIntentPicker implementation.
+ virtual void SetServiceURLs(const std::vector<GURL>& urls) OVERRIDE;
+ virtual void SetServiceIcon(size_t index, const SkBitmap& icon) OVERRIDE;
+ virtual void SetDefaultServiceIcon(size_t index) OVERRIDE;
+ virtual void Show() OVERRIDE;
+ virtual void Close() OVERRIDE;
+
+ // ConstrainedDialogDelegate implementation.
+ virtual GtkWidget* GetWidgetRoot() OVERRIDE;
+ virtual GtkWidget* GetFocusWidget() OVERRIDE;
+ virtual void DeleteDelegate() OVERRIDE;
+
+ private:
+ // Callback when a service button is clicked.
+ CHROMEGTK_CALLBACK_0(WebIntentPickerGtk, void, OnServiceButtonClick);
+ // Callback when close button is clicked.
+ CHROMEGTK_CALLBACK_0(WebIntentPickerGtk, void, OnCloseButtonClick);
+
+ // A weak pointer to the tab contents on which to display the picker UI.
+ TabContents* tab_contents_;
+
+ // A weak pointer to the WebIntentPickerDelegate to notify when the user
+ // chooses a service or cancels.
+ WebIntentPickerDelegate* delegate_;
+
+ // The root GtkWidget of the dialog.
+ ui::OwnedWidgetGtk root_;
+
+ // A weak pointer to the hbox that contains the buttons used to choose the
+ // service.
+ GtkWidget* button_hbox_;
+
+ // A button to close the dialog delegate.
+ scoped_ptr<CustomDrawButton> close_button_;
+
+ // The displayed constrained window. Technically owned by the TabContents
+ // page, but this object tells it when to destroy.
+ ConstrainedWindow* window_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebIntentPickerGtk);
+};
+
+#endif // CHROME_BROWSER_UI_GTK_WEB_INTENT_PICKER_GTK_H_
« no previous file with comments | « chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm ('k') | chrome/browser/ui/gtk/web_intent_picker_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698