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

Unified Diff: chrome/browser/gtk/blocked_popup_container_view_gtk.h

Issue 118480: GTK: Implement BlockedPopupContainerView for linux. (Closed)
Patch Set: Fix for the CreateBorderBin case. Created 11 years, 6 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/browser_prefs.cc ('k') | chrome/browser/gtk/blocked_popup_container_view_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/blocked_popup_container_view_gtk.h
diff --git a/chrome/browser/gtk/blocked_popup_container_view_gtk.h b/chrome/browser/gtk/blocked_popup_container_view_gtk.h
new file mode 100644
index 0000000000000000000000000000000000000000..234754fcd74130272ed5e313072c137906125214
--- /dev/null
+++ b/chrome/browser/gtk/blocked_popup_container_view_gtk.h
@@ -0,0 +1,101 @@
+// Copyright (c) 2009 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_GTK_BLOCKED_POPUP_CONTAINER_VIEW_GTK_H_
+#define CHROME_BROWSER_GTK_BLOCKED_POPUP_CONTAINER_VIEW_GTK_H_
+
+#include <gtk/gtk.h>
+
+#include <set>
+#include <utility>
+#include <vector>
+
+#include "app/slide_animation.h"
+#include "base/basictypes.h"
+#include "base/gfx/native_widget_types.h"
+#include "base/gfx/rect.h"
+#include "base/scoped_ptr.h"
+#include "base/string_util.h"
+#include "chrome/browser/blocked_popup_container.h"
+#include "chrome/browser/gtk/menu_gtk.h"
+#include "chrome/browser/tab_contents/tab_contents_delegate.h"
+#include "chrome/common/owned_widget_gtk.h"
+
+class BlockedPopupContainerInternalView;
+class CustomDrawButton;
+class MenuGtk;
+class PrefService;
+class Profile;
+class TabContents;
+class TabContentsViewGtk;
+class TextButton;
+
+namespace views {
+class ImageButton;
+}
+
+// The GTK blocked popup container notification.
+class BlockedPopupContainerViewGtk : public BlockedPopupContainerView,
+ public MenuGtk::Delegate {
+ public:
+ virtual ~BlockedPopupContainerViewGtk();
+
+ // Returns the Gtk view that currently owns us.
+ TabContentsViewGtk* ContainingView();
+
+ // Returns the URL and title for popup |index|, used to construct a string for
+ // display.
+ void GetURLAndTitleForPopup(size_t index,
+ string16* url,
+ string16* title) const;
+
+ GtkWidget* widget() { return container_.get(); }
+
+ // Overridden from BlockedPopupContainerView:
+ virtual void SetPosition();
+ virtual void ShowView();
+ virtual void UpdateLabel();
+ virtual void HideView();
+ virtual void Destroy();
+
+ // Overridden from MenuGtk::Delegate:
+ virtual bool IsCommandEnabled(int command_id) const;
+ virtual bool IsItemChecked(int command_id) const;
+ virtual void ExecuteCommand(int command_id);
+
+ private:
+ // For the static constructor BlockedPopupContainerView::Create().
+ friend class BlockedPopupContainerView;
+
+ // Creates a container for a certain TabContents.
+ explicit BlockedPopupContainerViewGtk(BlockedPopupContainer* container);
+
+ // Builds all the messy GTK stuff.
+ void Init();
+
+ // Callbacks for the two buttons in the notification
+ static void OnMenuButtonClicked(GtkButton *button,
+ BlockedPopupContainerViewGtk* container);
+ static void OnCloseButtonClicked(GtkButton *button,
+ BlockedPopupContainerViewGtk* container);
+
+ // Our model; calling the shots.
+ BlockedPopupContainer* model_;
+
+ // The top level of our local GTK hierarchy.
+ OwnedWidgetGtk container_;
+
+ // The "Blocked Popups: XXX" button.
+ GtkWidget* menu_button_;
+
+ // Closes the container.
+ scoped_ptr<CustomDrawButton> close_button_;
+
+ // The popup menu with options to launch blocked popups.
+ scoped_ptr<MenuGtk> launch_menu_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlockedPopupContainerViewGtk);
+};
+
+#endif // CHROME_BROWSER_GTK_BLOCKED_POPUP_CONTAINER_VIEW_GTK_H_
« no previous file with comments | « chrome/browser/browser_prefs.cc ('k') | chrome/browser/gtk/blocked_popup_container_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698