Chromium Code Reviews| Index: chrome/browser/ui/views/website_settings_popup_view.h |
| diff --git a/chrome/browser/ui/views/website_settings_popup_view.h b/chrome/browser/ui/views/website_settings_popup_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..db3343620d85a103405f3c85fa4e64106d289f5d |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/website_settings_popup_view.h |
| @@ -0,0 +1,134 @@ |
| +// Copyright (c) 2012 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_UI_VIEWS_WEBSITE_SETTINGS_POPUP_VIEW_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_POPUP_VIEW_H_ |
| +#pragma once |
| + |
| +#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
|
| +#include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/ui/website_settings/website_settings_ui.h" |
| +#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
|
| +#include "ui/views/bubble/bubble_delegate.h" |
| +#include "ui/views/controls/combobox/combobox_listener.h" |
| +#include "ui/views/controls/link_listener.h" |
| +#include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" |
| +#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
|
| + |
| +class GURL; |
| +class PopupHeader; |
| +class Profile; |
| +class TabContentsWrapper; |
| + |
| +namespace content { |
| +struct SSLStatus; |
| +} |
| + |
| +namespace views { |
| +class Combobox; |
| +class Link; |
| +class Label; |
| +class TabbedPane; |
| +} // 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.
|
| + |
| +// The views implementation of the website settings UI. |
| +class WebsiteSettingsPopupView : public WebsiteSettingsUI, |
| + public views::BubbleDelegateView, |
| + public views::ComboboxListener, |
| + public views::LinkListener, |
| + public views::TabbedPaneListener { |
| + public: |
| + 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.
|
| + Profile* profile, |
| + TabContentsWrapper* wrapper, |
| + const GURL& gurl, |
| + const content::SSLStatus& ssl); |
| + |
| + 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.
|
| + Profile* profile, |
| + TabContentsWrapper* wrapper, |
| + const GURL& url, |
| + const content::SSLStatus& ssl); |
| + |
| + virtual ~WebsiteSettingsPopupView(); |
| + |
| + private: |
| + // WebsiteSettingsUI implementations. |
| + virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) OVERRIDE; |
| + virtual void SetPermissionInfo( |
| + const PermissionInfoList& permission_info_list) OVERRIDE; |
| + virtual void SetIdentityInfo(const IdentityInfo& identity_info) OVERRIDE; |
| + virtual void SetFirstVisit(const string16& first_visit) OVERRIDE; |
| + |
| + // views::View implementation. |
| + virtual gfx::Size GetPreferredSize() OVERRIDE; |
| + |
| + // views::BubbleDelegate implementations. |
| + virtual gfx::Rect GetAnchorRect() OVERRIDE; |
| + |
| + // views::ComboboxListener implementation. |
| + virtual void OnSelectedIndexChanged(views::Combobox* combobox) OVERRIDE; |
| + |
| + // LinkListener implementation. |
| + virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; |
| + |
| + // views::TabbedPaneListener implementations. |
| + virtual void TabSelectedAt(int index) OVERRIDE; |
| + |
| + // Each tab contains several sections with a |headline| followed by the |
| + // section |contents| and an optional |link|. This method creates a section |
| + // for the given |headline|, |contents| and |link|. |link| can be NULL if the |
| + // section should not contain a link. |
| + views::View* CreateSection(const string16& headline, |
| + views::View* contents, |
| + views::Link* link) WARN_UNUSED_RESULT; |
| + |
| + // Creates a single row for the "Permissions" section from the "Permissions" |
| + // tab. Such a row contains a |permissions_label| with the name of the |
| + // permission and a |combobox| that allows to select setting for the given |
| + // permission. The ownership of the returned view is transferred to the |
| + // caller. |
| + views::View* CreatePermissionRow( |
| + views::Label* permission_label, |
| + views::Combobox* combobox) WARN_UNUSED_RESULT; |
| + |
| + // Creates the contents of the "Permissions" tab. The ownership of the |
| + // returned view is transferred to the caller. |
| + views::View* CreatePermissionsTab() WARN_UNUSED_RESULT; |
| + |
| + // Creates the contents of the "Identity" tab. The ownership of the returned |
| + // view is transferred to the caller. |
| + views::View* CreateIdentityTab() WARN_UNUSED_RESULT; |
| + |
| + // Creates a multiline text label that is initialized with the given |text|. |
| + // The ownership of the returned label is transferred to the caller. |
| + views::Label* CreateTextLabel(const string16& text) WARN_UNUSED_RESULT; |
| + |
| + 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.
|
| + |
| + // The presenter that controlls the Website Settings UI. |
| + scoped_ptr<WebsiteSettings> presenter_; |
| + |
| + PopupHeader* header_; |
| + |
| + // The |TabbedPane| that contains the tabs of the Website Settings UI. |
| + views::TabbedPane* tabbed_pane_; |
| + |
| + // The view that contains the contents of the "Cookies and Site data" section |
| + // from the "Permissions" tab. |
| + views::View* site_data_content_; |
| + // The link that opend the "Cookies" dialog. |
| + views::Link* cookie_dialog_link_; |
| + // The view that contains the contents of the "Permissions" section from the |
| + // "Permissions" tab. |
| + views::View* permissions_content_; |
| + |
| + views::Label* identity_info_text_; |
| + views::Label* connection_info_text_; |
| + views::Label* page_info_text_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_POPUP_VIEW_H_ |