| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_POPUP_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_POPUP_VIEW_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
| 12 #include "ui/base/models/combobox_model.h" |
| 13 #include "ui/views/bubble/bubble_delegate.h" |
| 14 #include "ui/views/controls/combobox/combobox_listener.h" |
| 15 #include "ui/views/controls/link_listener.h" |
| 16 #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" |
| 17 #include "ui/views/view.h" |
| 18 |
| 19 class GURL; |
| 20 class PopupHeader; |
| 21 class Profile; |
| 22 class TabContentsWrapper; |
| 23 |
| 24 namespace content { |
| 25 struct SSLStatus; |
| 26 } |
| 27 |
| 28 namespace views { |
| 29 class Combobox; |
| 30 class Link; |
| 31 class Label; |
| 32 class TabbedPane; |
| 33 } // namespace views |
| 34 |
| 35 // The views implementation of the website settings UI. |
| 36 class WebsiteSettingsPopupView : public WebsiteSettingsUI, |
| 37 public views::BubbleDelegateView, |
| 38 public views::ComboboxListener, |
| 39 public views::LinkListener, |
| 40 public views::TabbedPaneListener { |
| 41 public: |
| 42 static void ShowPopup(views::View* anchor_view, |
| 43 Profile* profile, |
| 44 TabContentsWrapper* wrapper, |
| 45 const GURL& gurl, |
| 46 const content::SSLStatus& ssl); |
| 47 |
| 48 WebsiteSettingsPopupView(views::View* anchor_view, |
| 49 Profile* profile, |
| 50 TabContentsWrapper* wrapper, |
| 51 const GURL& url, |
| 52 const content::SSLStatus& ssl); |
| 53 |
| 54 virtual ~WebsiteSettingsPopupView(); |
| 55 |
| 56 private: |
| 57 // WebsiteSettingsUI implementations. |
| 58 virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) OVERRIDE; |
| 59 virtual void SetPermissionInfo( |
| 60 const PermissionInfoList& permission_info_list) OVERRIDE; |
| 61 virtual void SetIdentityInfo(const IdentityInfo& identity_info) OVERRIDE; |
| 62 virtual void SetFirstVisit(const string16& first_visit) OVERRIDE; |
| 63 |
| 64 // views::View implementation. |
| 65 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 66 |
| 67 // views::BubbleDelegate implementations. |
| 68 virtual gfx::Rect GetAnchorRect() OVERRIDE; |
| 69 |
| 70 // views::ComboboxListener implementation. |
| 71 virtual void OnSelectedIndexChanged(views::Combobox* combobox) OVERRIDE; |
| 72 |
| 73 // LinkListener implementation. |
| 74 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; |
| 75 |
| 76 // views::TabbedPaneListener implementations. |
| 77 virtual void TabSelectedAt(int index) OVERRIDE; |
| 78 |
| 79 // Each tab contains several sections with a |headline| followed by the |
| 80 // section |contents| and an optional |link|. This method creates a section |
| 81 // for the given |headline|, |contents| and |link|. |link| can be NULL if the |
| 82 // section should not contain a link. |
| 83 views::View* CreateSection(const string16& headline, |
| 84 views::View* contents, |
| 85 views::Link* link) WARN_UNUSED_RESULT; |
| 86 |
| 87 // Creates a single row for the "Permissions" section from the "Permissions" |
| 88 // tab. Such a row contains a |permissions_label| with the name of the |
| 89 // permission and a |combobox| that allows to select setting for the given |
| 90 // permission. |
| 91 views::View* CreatePermissionRow( |
| 92 views::Label* permission_label, |
| 93 views::Combobox* combobox) WARN_UNUSED_RESULT; |
| 94 |
| 95 // Creates the contents of the "Permissions" tab. |
| 96 views::View* CreatePermissionsTab() WARN_UNUSED_RESULT; |
| 97 |
| 98 // Creates the contents of the "Identity" tab. |
| 99 views::View* CreateIdentityTab() WARN_UNUSED_RESULT; |
| 100 |
| 101 // Creates a multiline text label that is initialized with the given |text|. |
| 102 views::Label* CreateTextLabel(const string16& text) WARN_UNUSED_RESULT; |
| 103 |
| 104 TabContentsWrapper* tab_contents_wrapper_; |
| 105 |
| 106 // The presenter that controlls the Website Settings UI. |
| 107 scoped_ptr<WebsiteSettings> presenter_; |
| 108 |
| 109 PopupHeader* header_; |
| 110 |
| 111 // The |TabbedPane| that contains the tabs of the Website Settings UI. |
| 112 views::TabbedPane* tabbed_pane_; |
| 113 |
| 114 // The view that contains the contents of the "Cookies and Site data" section |
| 115 // from the "Permissions" tab. |
| 116 views::View* site_data_content_; |
| 117 // The link that opend the "Cookies" dialog. |
| 118 views::Link* cookie_dialog_link_; |
| 119 // The view that contains the contents of the "Permissions" section from the |
| 120 // "Permissions" tab. |
| 121 views::View* permissions_content_; |
| 122 |
| 123 views::Label* identity_info_text_; |
| 124 views::Label* connection_info_text_; |
| 125 views::Label* page_info_text_; |
| 126 |
| 127 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView); |
| 128 }; |
| 129 |
| 130 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_POPUP_VIEW_H_ |
| OLD | NEW |