| 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_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "chrome/browser/ui/views/website_settings/permission_selector_view_obse
rver.h" | 12 #include "chrome/browser/ui/views/website_settings/permission_selector_view_obse
rver.h" |
| 13 #include "chrome/browser/ui/website_settings/website_settings_ui.h" | 13 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
| 14 #include "content/public/browser/web_contents_observer.h" |
| 14 #include "ui/views/bubble/bubble_delegate.h" | 15 #include "ui/views/bubble/bubble_delegate.h" |
| 15 #include "ui/views/controls/button/button.h" | 16 #include "ui/views/controls/button/button.h" |
| 16 #include "ui/views/controls/link_listener.h" | 17 #include "ui/views/controls/link_listener.h" |
| 17 #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" | 18 #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" |
| 18 | 19 |
| 19 class GURL; | 20 class GURL; |
| 20 class PopupHeaderView; | 21 class PopupHeaderView; |
| 21 class Profile; | 22 class Profile; |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 struct SSLStatus; | 25 struct SSLStatus; |
| 25 class WebContents; | 26 class WebContents; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace views { | 29 namespace views { |
| 29 class LabelButton; | 30 class LabelButton; |
| 30 class Link; | 31 class Link; |
| 31 class TabbedPane; | 32 class TabbedPane; |
| 32 class Widget; | 33 class Widget; |
| 33 } | 34 } |
| 34 | 35 |
| 35 // The views implementation of the website settings UI. | 36 // The views implementation of the website settings UI. |
| 36 class WebsiteSettingsPopupView | 37 class WebsiteSettingsPopupView : public content::WebContentsObserver, |
| 37 : public PermissionSelectorViewObserver, | 38 public PermissionSelectorViewObserver, |
| 38 public views::BubbleDelegateView, | 39 public views::BubbleDelegateView, |
| 39 public views::ButtonListener, | 40 public views::ButtonListener, |
| 40 public views::LinkListener, | 41 public views::LinkListener, |
| 41 public views::TabbedPaneListener, | 42 public views::TabbedPaneListener, |
| 42 public WebsiteSettingsUI { | 43 public WebsiteSettingsUI { |
| 43 public: | 44 public: |
| 44 ~WebsiteSettingsPopupView() override; | 45 ~WebsiteSettingsPopupView() override; |
| 45 | 46 |
| 46 // If |anchor_view| is null, |anchor_rect| is used to anchor the bubble. | 47 // If |anchor_view| is null, |anchor_rect| is used to anchor the bubble. |
| 47 static void ShowPopup(views::View* anchor_view, | 48 static void ShowPopup(views::View* anchor_view, |
| 48 const gfx::Rect& anchor_rect, | 49 const gfx::Rect& anchor_rect, |
| 49 Profile* profile, | 50 Profile* profile, |
| 50 content::WebContents* web_contents, | 51 content::WebContents* web_contents, |
| 51 const GURL& url, | 52 const GURL& url, |
| 52 const content::SSLStatus& ssl); | 53 const content::SSLStatus& ssl); |
| 53 | 54 |
| 54 static bool IsPopupShowing(); | 55 static bool IsPopupShowing(); |
| 55 | 56 |
| 56 private: | 57 private: |
| 57 WebsiteSettingsPopupView(views::View* anchor_view, | 58 WebsiteSettingsPopupView(views::View* anchor_view, |
| 58 gfx::NativeView parent_window, | 59 gfx::NativeView parent_window, |
| 59 Profile* profile, | 60 Profile* profile, |
| 60 content::WebContents* web_contents, | 61 content::WebContents* web_contents, |
| 61 const GURL& url, | 62 const GURL& url, |
| 62 const content::SSLStatus& ssl); | 63 const content::SSLStatus& ssl); |
| 63 | 64 |
| 65 // WebContentsObserver implementation. |
| 66 void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; |
| 67 |
| 64 // PermissionSelectorViewObserver implementation. | 68 // PermissionSelectorViewObserver implementation. |
| 65 void OnPermissionChanged( | 69 void OnPermissionChanged( |
| 66 const WebsiteSettingsUI::PermissionInfo& permission) override; | 70 const WebsiteSettingsUI::PermissionInfo& permission) override; |
| 67 | 71 |
| 68 // views::BubbleDelegateView implementation. | 72 // views::BubbleDelegateView implementation. |
| 69 void OnWidgetDestroying(views::Widget* widget) override; | 73 void OnWidgetDestroying(views::Widget* widget) override; |
| 70 | 74 |
| 71 // views::ButtonListener implementation. | 75 // views::ButtonListener implementation. |
| 72 void ButtonPressed(views::Button* button, const ui::Event& event) override; | 76 void ButtonPressed(views::Button* button, const ui::Event& event) override; |
| 73 | 77 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 views::Link* site_settings_link_; | 177 views::Link* site_settings_link_; |
| 174 | 178 |
| 175 views::View* connection_info_content_; | 179 views::View* connection_info_content_; |
| 176 | 180 |
| 177 base::WeakPtrFactory<WebsiteSettingsPopupView> weak_factory_; | 181 base::WeakPtrFactory<WebsiteSettingsPopupView> weak_factory_; |
| 178 | 182 |
| 179 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView); | 183 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView); |
| 180 }; | 184 }; |
| 181 | 185 |
| 182 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_
H_ | 186 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_
H_ |
| OLD | NEW |