| 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_VIEWS_COLLECTED_COOKIES_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_COLLECTED_COOKIES_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_COLLECTED_COOKIES_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_COLLECTED_COOKIES_VIEWS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "chrome/common/content_settings.h" | 10 #include "chrome/common/content_settings.h" |
| 11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
| 13 #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" | 13 #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" |
| 14 #include "ui/views/controls/tree/tree_view_controller.h" | 14 #include "ui/views/controls/tree/tree_view_controller.h" |
| 15 #include "ui/views/window/dialog_delegate.h" | 15 #include "ui/views/window/dialog_delegate.h" |
| 16 | 16 |
| 17 class ConstrainedWindow; | 17 class ConstrainedWindow; |
| 18 class CookieInfoView; | 18 class CookieInfoView; |
| 19 class CookiesTreeModel; | 19 class CookiesTreeModel; |
| 20 class InfobarView; | 20 class InfobarView; |
| 21 class TabContents; | 21 class TabContents; |
| 22 typedef TabContents TabContentsWrapper; | |
| 23 | 22 |
| 24 namespace views { | 23 namespace views { |
| 25 class Label; | 24 class Label; |
| 26 class TextButton; | 25 class TextButton; |
| 27 class TreeView; | 26 class TreeView; |
| 28 } | 27 } |
| 29 | 28 |
| 30 // This is the Views implementation of the collected cookies dialog. | 29 // This is the Views implementation of the collected cookies dialog. |
| 31 // | 30 // |
| 32 // CollectedCookiesViews is a dialog that displays the allowed and blocked | 31 // CollectedCookiesViews is a dialog that displays the allowed and blocked |
| 33 // cookies of the current tab contents. To display the dialog, invoke | 32 // cookies of the current tab contents. To display the dialog, invoke |
| 34 // ShowCollectedCookiesDialog() on the delegate of the tab contents wrapper's | 33 // ShowCollectedCookiesDialog() on the delegate of the TabContents's |
| 35 // content settings tab helper. | 34 // content settings tab helper. |
| 36 class CollectedCookiesViews : public views::DialogDelegateView, | 35 class CollectedCookiesViews : public views::DialogDelegateView, |
| 37 public content::NotificationObserver, | 36 public content::NotificationObserver, |
| 38 public views::ButtonListener, | 37 public views::ButtonListener, |
| 39 public views::TabbedPaneListener, | 38 public views::TabbedPaneListener, |
| 40 public views::TreeViewController { | 39 public views::TreeViewController { |
| 41 public: | 40 public: |
| 42 // Use BrowserWindow::ShowCollectedCookiesDialog to show. | 41 // Use BrowserWindow::ShowCollectedCookiesDialog to show. |
| 43 explicit CollectedCookiesViews(TabContentsWrapper* wrapper); | 42 explicit CollectedCookiesViews(TabContents* tab_contents); |
| 44 | 43 |
| 45 // views::DialogDelegate: | 44 // views::DialogDelegate: |
| 46 virtual string16 GetWindowTitle() const OVERRIDE; | 45 virtual string16 GetWindowTitle() const OVERRIDE; |
| 47 virtual int GetDialogButtons() const OVERRIDE; | 46 virtual int GetDialogButtons() const OVERRIDE; |
| 48 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; | 47 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; |
| 49 virtual void DeleteDelegate() OVERRIDE; | 48 virtual void DeleteDelegate() OVERRIDE; |
| 50 virtual bool Cancel() OVERRIDE; | 49 virtual bool Cancel() OVERRIDE; |
| 51 virtual views::View* GetContentsView() OVERRIDE; | 50 virtual views::View* GetContentsView() OVERRIDE; |
| 52 | 51 |
| 53 // views::ButtonListener: | 52 // views::ButtonListener: |
| (...skipping 29 matching lines...) Expand all Loading... |
| 83 // content::NotificationObserver: | 82 // content::NotificationObserver: |
| 84 virtual void Observe(int type, | 83 virtual void Observe(int type, |
| 85 const content::NotificationSource& source, | 84 const content::NotificationSource& source, |
| 86 const content::NotificationDetails& details) OVERRIDE; | 85 const content::NotificationDetails& details) OVERRIDE; |
| 87 | 86 |
| 88 content::NotificationRegistrar registrar_; | 87 content::NotificationRegistrar registrar_; |
| 89 | 88 |
| 90 ConstrainedWindow* window_; | 89 ConstrainedWindow* window_; |
| 91 | 90 |
| 92 // The tab contents. | 91 // The tab contents. |
| 93 TabContentsWrapper* wrapper_; | 92 TabContents* tab_contents_; |
| 94 | 93 |
| 95 // Assorted views. | 94 // Assorted views. |
| 96 views::Label* allowed_label_; | 95 views::Label* allowed_label_; |
| 97 views::Label* blocked_label_; | 96 views::Label* blocked_label_; |
| 98 | 97 |
| 99 views::TreeView* allowed_cookies_tree_; | 98 views::TreeView* allowed_cookies_tree_; |
| 100 views::TreeView* blocked_cookies_tree_; | 99 views::TreeView* blocked_cookies_tree_; |
| 101 | 100 |
| 102 views::TextButton* block_allowed_button_; | 101 views::TextButton* block_allowed_button_; |
| 103 views::TextButton* allow_blocked_button_; | 102 views::TextButton* allow_blocked_button_; |
| 104 views::TextButton* for_session_blocked_button_; | 103 views::TextButton* for_session_blocked_button_; |
| 105 | 104 |
| 106 scoped_ptr<CookiesTreeModel> allowed_cookies_tree_model_; | 105 scoped_ptr<CookiesTreeModel> allowed_cookies_tree_model_; |
| 107 scoped_ptr<CookiesTreeModel> blocked_cookies_tree_model_; | 106 scoped_ptr<CookiesTreeModel> blocked_cookies_tree_model_; |
| 108 | 107 |
| 109 CookieInfoView* cookie_info_view_; | 108 CookieInfoView* cookie_info_view_; |
| 110 | 109 |
| 111 InfobarView* infobar_; | 110 InfobarView* infobar_; |
| 112 | 111 |
| 113 bool status_changed_; | 112 bool status_changed_; |
| 114 | 113 |
| 115 DISALLOW_COPY_AND_ASSIGN(CollectedCookiesViews); | 114 DISALLOW_COPY_AND_ASSIGN(CollectedCookiesViews); |
| 116 }; | 115 }; |
| 117 | 116 |
| 118 #endif // CHROME_BROWSER_UI_VIEWS_COLLECTED_COOKIES_VIEWS_H_ | 117 #endif // CHROME_BROWSER_UI_VIEWS_COLLECTED_COOKIES_VIEWS_H_ |
| OLD | NEW |