summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/gtk/collected_cookies_gtk.h
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-14 00:19:04 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-14 00:19:04 +0000
commit736d1898191dc530e603a996d8c4bf2415326aa7 (patch)
tree79c524d49f164c8c970b119279be072aaaaee91d /chrome/browser/ui/gtk/collected_cookies_gtk.h
parent2dee6d5003f0d5a9fffd55856b9f54b404988cab (diff)
downloadchromium_src-736d1898191dc530e603a996d8c4bf2415326aa7.zip
chromium_src-736d1898191dc530e603a996d8c4bf2415326aa7.tar.gz
chromium_src-736d1898191dc530e603a996d8c4bf2415326aa7.tar.bz2
Move chrome/browser/gtk/ to chrome/browser/ui/gtk/
(moved *.cc using 'svn mv' to preserve history) (copied *.h using 'svn cp' to preserve history and stub out originals) Stubbed out original headers in chrome/browser/gtk/ Update header guards & copyright dates in chrome/browser/ui/gtk/ Update .gypi files Remove chrome/chrome_browser.gypi:4228 reference to nonexistant: ['include', '^browser/gtk/pk11_password_dialog.h'], Remove stray header guard in: chrome/browser/ui/gtk/bookmark_bar_instructions_gtk.cc Add #pragma once to the following files: chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h chrome/browser/ui/gtk/infobar_arrow_model.h Ran the following to appease presubmit: 'svn pset svn:eol-style LF \ chrome/browser/ui/gtk/info_bubble_accelerators_gtk.cc \ chrome/browser/ui/gtk/gtk_custom_menu.cc \ chrome/browser/ui/gtk/info_bubble_accelerators_gtk.h \ chrome/browser/ui/gtk/gtk_custom_menu.h \ chrome/browser/ui/gtk/options/managed_prefs_banner_gtk.h \ chrome/browser/ui/gtk/chrome_gtk_frame.h \ chrome/browser/ui/gtk/chrome_gtk_frame.cc \ chrome/browser/ui/gtk/gtk_custom_menu_item.h \ chrome/browser/gtk/info_bubble_accelerators_gtk.h \ chrome/browser/gtk/gtk_custom_menu.h \ chrome/browser/gtk/options/managed_prefs_banner_gtk.h \ chrome/browser/gtk/chrome_gtk_frame.h \ chrome/browser/gtk/gtk_custom_menu_item.h' BUG=69289 TEST=Compile&Trybots Review URL: http://codereview.chromium.org/6251001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71397 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/gtk/collected_cookies_gtk.h')
-rw-r--r--chrome/browser/ui/gtk/collected_cookies_gtk.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/chrome/browser/ui/gtk/collected_cookies_gtk.h b/chrome/browser/ui/gtk/collected_cookies_gtk.h
new file mode 100644
index 0000000..2e55ec1
--- /dev/null
+++ b/chrome/browser/ui/gtk/collected_cookies_gtk.h
@@ -0,0 +1,108 @@
+// 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.
+
+// This is the Gtk implementation of the collected Cookies dialog.
+
+#ifndef CHROME_BROWSER_UI_GTK_COLLECTED_COOKIES_GTK_H_
+#define CHROME_BROWSER_UI_GTK_COLLECTED_COOKIES_GTK_H_
+#pragma once
+
+#include <gtk/gtk.h>
+
+#include "app/gtk_signal.h"
+#include "base/scoped_ptr.h"
+#include "chrome/browser/gtk/constrained_window_gtk.h"
+#include "chrome/browser/gtk/gtk_tree.h"
+#include "chrome/common/content_settings.h"
+#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
+
+class CookiesTreeModel;
+
+// CollectedCookiesGtk is a dialog that displays the allowed and blocked
+// cookies of the current tab contents. To display the dialog, invoke
+// ShowCollectedCookiesDialog() on the delegate of the tab contents.
+
+class CollectedCookiesGtk : public ConstrainedDialogDelegate,
+ gtk_tree::TreeAdapter::Delegate,
+ NotificationObserver {
+ public:
+ CollectedCookiesGtk(GtkWindow* parent, TabContents* tab_contents);
+
+ // ConstrainedDialogDelegate methods.
+ virtual GtkWidget* GetWidgetRoot();
+ virtual void DeleteDelegate();
+
+ private:
+ virtual ~CollectedCookiesGtk();
+
+ // Initialize all widgets of this dialog.
+ void Init();
+
+ // True if the selection contains at least one origin node.
+ bool SelectionContainsOriginNode(GtkTreeSelection* selection,
+ gtk_tree::TreeAdapter* adapter);
+
+ // Enable the allow/block buttons if at least one origin node is selected.
+ void EnableControls();
+
+ // Add exceptions for all origin nodes within the selection.
+ void AddExceptions(GtkTreeSelection* selection,
+ gtk_tree::TreeAdapter* adapter,
+ ContentSetting setting);
+
+ // Notification Observer implementation.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ // Callbacks.
+ CHROMEGTK_CALLBACK_2(CollectedCookiesGtk, void, OnTreeViewRowExpanded,
+ GtkTreeIter*, GtkTreePath*);
+ CHROMEGTK_CALLBACK_0(CollectedCookiesGtk, void, OnTreeViewSelectionChange);
+ CHROMEGTK_CALLBACK_0(CollectedCookiesGtk, void, OnClose);
+ CHROMEGTK_CALLBACK_0(CollectedCookiesGtk, void, OnBlockAllowedButtonClicked);
+ CHROMEGTK_CALLBACK_0(CollectedCookiesGtk, void, OnAllowBlockedButtonClicked);
+ CHROMEGTK_CALLBACK_0(CollectedCookiesGtk, void,
+ OnForSessionBlockedButtonClicked);
+
+ NotificationRegistrar registrar_;
+
+ ConstrainedWindow* window_;
+
+ // Widgets of the dialog.
+ GtkWidget* dialog_;
+
+ GtkWidget* allowed_description_label_;
+ GtkWidget* blocked_description_label_;
+
+ GtkWidget* block_allowed_cookie_button_;
+
+ GtkWidget* allow_blocked_cookie_button_;
+ GtkWidget* for_session_blocked_cookie_button_;
+
+ // The table listing the cookies.
+ GtkWidget* allowed_tree_;
+ GtkWidget* blocked_tree_;
+
+ GtkTreeSelection* allowed_selection_;
+ GtkTreeSelection* blocked_selection_;
+
+ // The infobar widget.
+ GtkWidget* infobar_;
+ GtkWidget* infobar_label_;
+
+ // The tab contents.
+ TabContents* tab_contents_;
+
+ // The Cookies Table model.
+ scoped_ptr<CookiesTreeModel> allowed_cookies_tree_model_;
+ scoped_ptr<CookiesTreeModel> blocked_cookies_tree_model_;
+ scoped_ptr<gtk_tree::TreeAdapter> allowed_cookies_tree_adapter_;
+ scoped_ptr<gtk_tree::TreeAdapter> blocked_cookies_tree_adapter_;
+
+ DISALLOW_COPY_AND_ASSIGN(CollectedCookiesGtk);
+};
+
+#endif // CHROME_BROWSER_UI_GTK_COLLECTED_COOKIES_GTK_H_