| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/ui/views/website_settings/chosen_object_view_observer.h
" | 14 #include "chrome/browser/ui/views/website_settings/chosen_object_row_observer.h" |
| 15 #include "chrome/browser/ui/views/website_settings/permission_selector_view_obse
rver.h" | 15 #include "chrome/browser/ui/views/website_settings/permission_selector_row_obser
ver.h" |
| 16 #include "chrome/browser/ui/website_settings/website_settings_ui.h" | 16 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
| 17 #include "components/security_state/security_state_model.h" | 17 #include "components/security_state/security_state_model.h" |
| 18 #include "content/public/browser/web_contents_observer.h" | 18 #include "content/public/browser/web_contents_observer.h" |
| 19 #include "ui/views/bubble/bubble_dialog_delegate.h" | 19 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 20 #include "ui/views/controls/button/button.h" | 20 #include "ui/views/controls/button/button.h" |
| 21 #include "ui/views/controls/link_listener.h" | 21 #include "ui/views/controls/link_listener.h" |
| 22 #include "ui/views/controls/separator.h" | 22 #include "ui/views/controls/separator.h" |
| 23 #include "ui/views/controls/styled_label_listener.h" | 23 #include "ui/views/controls/styled_label_listener.h" |
| 24 | 24 |
| 25 class GURL; | 25 class GURL; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 44 | 44 |
| 45 enum : int { | 45 enum : int { |
| 46 // Left icon margin. | 46 // Left icon margin. |
| 47 kPermissionIconMarginLeft = 6, | 47 kPermissionIconMarginLeft = 6, |
| 48 // The width of the column that contains the permissions icons. | 48 // The width of the column that contains the permissions icons. |
| 49 kPermissionIconColumnWidth = 20, | 49 kPermissionIconColumnWidth = 20, |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 // The views implementation of the website settings UI. | 52 // The views implementation of the website settings UI. |
| 53 class WebsiteSettingsPopupView : public content::WebContentsObserver, | 53 class WebsiteSettingsPopupView : public content::WebContentsObserver, |
| 54 public PermissionSelectorViewObserver, | 54 public PermissionSelectorRowObserver, |
| 55 public ChosenObjectViewObserver, | 55 public ChosenObjectRowObserver, |
| 56 public views::BubbleDialogDelegateView, | 56 public views::BubbleDialogDelegateView, |
| 57 public views::ButtonListener, | 57 public views::ButtonListener, |
| 58 public views::LinkListener, | 58 public views::LinkListener, |
| 59 public views::StyledLabelListener, | 59 public views::StyledLabelListener, |
| 60 public WebsiteSettingsUI { | 60 public WebsiteSettingsUI { |
| 61 public: | 61 public: |
| 62 ~WebsiteSettingsPopupView() override; | 62 ~WebsiteSettingsPopupView() override; |
| 63 | 63 |
| 64 // If |anchor_view| is null, |anchor_rect| is used to anchor the bubble. | 64 // If |anchor_view| is null, |anchor_rect| is used to anchor the bubble. |
| 65 static void ShowPopup( | 65 static void ShowPopup( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 80 gfx::NativeView parent_window, | 80 gfx::NativeView parent_window, |
| 81 Profile* profile, | 81 Profile* profile, |
| 82 content::WebContents* web_contents, | 82 content::WebContents* web_contents, |
| 83 const GURL& url, | 83 const GURL& url, |
| 84 const security_state::SecurityStateModel::SecurityInfo& security_info); | 84 const security_state::SecurityStateModel::SecurityInfo& security_info); |
| 85 | 85 |
| 86 // WebContentsObserver implementation. | 86 // WebContentsObserver implementation. |
| 87 void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; | 87 void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; |
| 88 void WebContentsDestroyed() override; | 88 void WebContentsDestroyed() override; |
| 89 | 89 |
| 90 // PermissionSelectorViewObserver implementation. | 90 // PermissionSelectorRowObserver implementation. |
| 91 void OnPermissionChanged( | 91 void OnPermissionChanged( |
| 92 const WebsiteSettingsUI::PermissionInfo& permission) override; | 92 const WebsiteSettingsUI::PermissionInfo& permission) override; |
| 93 | 93 |
| 94 // ChosenObjectViewObserver implementation. | 94 // ChosenObjectRowObserver implementation. |
| 95 void OnChosenObjectDeleted( | 95 void OnChosenObjectDeleted( |
| 96 const WebsiteSettingsUI::ChosenObjectInfo& info) override; | 96 const WebsiteSettingsUI::ChosenObjectInfo& info) override; |
| 97 | 97 |
| 98 // views::BubbleDialogDelegateView implementation. | 98 // views::BubbleDialogDelegateView implementation. |
| 99 void OnWidgetDestroying(views::Widget* widget) override; | 99 void OnWidgetDestroying(views::Widget* widget) override; |
| 100 int GetDialogButtons() const override; | 100 int GetDialogButtons() const override; |
| 101 | 101 |
| 102 // views::ButtonListener implementation. | 102 // views::ButtonListener implementation. |
| 103 void ButtonPressed(views::Button* button, const ui::Event& event) override; | 103 void ButtonPressed(views::Button* button, const ui::Event& event) override; |
| 104 | 104 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // The link to open the site settings page that provides full control over | 169 // The link to open the site settings page that provides full control over |
| 170 // the origin's permissions. | 170 // the origin's permissions. |
| 171 views::Link* site_settings_link_; | 171 views::Link* site_settings_link_; |
| 172 | 172 |
| 173 base::WeakPtrFactory<WebsiteSettingsPopupView> weak_factory_; | 173 base::WeakPtrFactory<WebsiteSettingsPopupView> weak_factory_; |
| 174 | 174 |
| 175 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView); | 175 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView); |
| 176 }; | 176 }; |
| 177 | 177 |
| 178 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_
H_ | 178 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_
H_ |
| OLD | NEW |