Chromium Code Reviews| 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" | |
|
tfarina
2012/06/06 16:58:29
nit: basictypes.h for DISALLOW ;)
markusheintz_
2012/06/07 20:10:38
Done. I promiss to create a checklist and the firs
| |
| 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" | |
|
tfarina
2012/06/06 16:58:29
are you using this header file here?
markusheintz_
2012/06/07 20:10:38
moved to .cc file. I forgot this when I move the c
| |
| 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" | |
|
tfarina
2012/06/06 16:58:29
nit: doesn't this come from bubble_delegate.h?
markusheintz_
2012/06/07 20:10:38
Don't we include all header for all classes we exp
| |
| 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 | |
|
tfarina
2012/06/06 16:58:29
nit: I'd remove this "// namespace views", in ui/v
markusheintz_
2012/06/07 20:10:38
Done.
| |
| 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, | |
|
sky
2012/06/06 17:57:10
constructor/destructor before statics.
markusheintz_
2012/06/07 20:10:38
Done.
| |
| 43 Profile* profile, | |
| 44 TabContentsWrapper* wrapper, | |
| 45 const GURL& gurl, | |
| 46 const content::SSLStatus& ssl); | |
| 47 | |
| 48 WebsiteSettingsPopupView(views::View* anchor_view, | |
|
tfarina
2012/06/06 16:58:29
can you make this constructor private?
markusheintz_
2012/06/07 20:10:38
Done.
| |
| 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. The ownership of the returned view is transferred to the | |
| 91 // caller. | |
| 92 views::View* CreatePermissionRow( | |
| 93 views::Label* permission_label, | |
| 94 views::Combobox* combobox) WARN_UNUSED_RESULT; | |
| 95 | |
| 96 // Creates the contents of the "Permissions" tab. The ownership of the | |
| 97 // returned view is transferred to the caller. | |
| 98 views::View* CreatePermissionsTab() WARN_UNUSED_RESULT; | |
| 99 | |
| 100 // Creates the contents of the "Identity" tab. The ownership of the returned | |
| 101 // view is transferred to the caller. | |
| 102 views::View* CreateIdentityTab() WARN_UNUSED_RESULT; | |
| 103 | |
| 104 // Creates a multiline text label that is initialized with the given |text|. | |
| 105 // The ownership of the returned label is transferred to the caller. | |
| 106 views::Label* CreateTextLabel(const string16& text) WARN_UNUSED_RESULT; | |
| 107 | |
| 108 TabContentsWrapper* tab_contents_wrapper_; | |
|
sky
2012/06/06 17:57:10
Document ownership of all non-views classes.
markusheintz_
2012/06/07 20:10:38
Done.
| |
| 109 | |
| 110 // The presenter that controlls the Website Settings UI. | |
| 111 scoped_ptr<WebsiteSettings> presenter_; | |
| 112 | |
| 113 PopupHeader* header_; | |
| 114 | |
| 115 // The |TabbedPane| that contains the tabs of the Website Settings UI. | |
| 116 views::TabbedPane* tabbed_pane_; | |
| 117 | |
| 118 // The view that contains the contents of the "Cookies and Site data" section | |
| 119 // from the "Permissions" tab. | |
| 120 views::View* site_data_content_; | |
| 121 // The link that opend the "Cookies" dialog. | |
| 122 views::Link* cookie_dialog_link_; | |
| 123 // The view that contains the contents of the "Permissions" section from the | |
| 124 // "Permissions" tab. | |
| 125 views::View* permissions_content_; | |
| 126 | |
| 127 views::Label* identity_info_text_; | |
| 128 views::Label* connection_info_text_; | |
| 129 views::Label* page_info_text_; | |
| 130 | |
| 131 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView); | |
| 132 }; | |
| 133 | |
| 134 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_POPUP_VIEW_H_ | |
| OLD | NEW |