OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CONTENT_SETTING_BUBBLE_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 public views::LinkListener, | 47 public views::LinkListener, |
48 public views::MenuButtonListener { | 48 public views::MenuButtonListener { |
49 public: | 49 public: |
50 ContentSettingBubbleContents( | 50 ContentSettingBubbleContents( |
51 ContentSettingBubbleModel* content_setting_bubble_model, | 51 ContentSettingBubbleModel* content_setting_bubble_model, |
52 content::WebContents* web_contents, | 52 content::WebContents* web_contents, |
53 views::View* anchor_view, | 53 views::View* anchor_view, |
54 views::BubbleBorder::Arrow arrow); | 54 views::BubbleBorder::Arrow arrow); |
55 virtual ~ContentSettingBubbleContents(); | 55 virtual ~ContentSettingBubbleContents(); |
56 | 56 |
57 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 57 virtual gfx::Size GetPreferredSize() const override; |
58 | 58 |
59 // Callback to allow ContentSettingMediaMenuModel to update the menu label. | 59 // Callback to allow ContentSettingMediaMenuModel to update the menu label. |
60 void UpdateMenuLabel(content::MediaStreamType type, | 60 void UpdateMenuLabel(content::MediaStreamType type, |
61 const std::string& label); | 61 const std::string& label); |
62 | 62 |
63 protected: | 63 protected: |
64 // views::BubbleDelegateView: | 64 // views::BubbleDelegateView: |
65 virtual void Init() OVERRIDE; | 65 virtual void Init() override; |
66 | 66 |
67 private: | 67 private: |
68 class Favicon; | 68 class Favicon; |
69 struct MediaMenuParts; | 69 struct MediaMenuParts; |
70 | 70 |
71 typedef std::map<views::Link*, int> PopupLinks; | 71 typedef std::map<views::Link*, int> PopupLinks; |
72 typedef std::map<views::MenuButton*, MediaMenuParts*> MediaMenuPartsMap; | 72 typedef std::map<views::MenuButton*, MediaMenuParts*> MediaMenuPartsMap; |
73 | 73 |
74 // content::WebContentsObserver: | 74 // content::WebContentsObserver: |
75 virtual void DidNavigateMainFrame( | 75 virtual void DidNavigateMainFrame( |
76 const content::LoadCommittedDetails& details, | 76 const content::LoadCommittedDetails& details, |
77 const content::FrameNavigateParams& params) OVERRIDE; | 77 const content::FrameNavigateParams& params) override; |
78 | 78 |
79 // views::View: | 79 // views::View: |
80 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; | 80 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
81 | 81 |
82 // views::ButtonListener: | 82 // views::ButtonListener: |
83 virtual void ButtonPressed(views::Button* sender, | 83 virtual void ButtonPressed(views::Button* sender, |
84 const ui::Event& event) OVERRIDE; | 84 const ui::Event& event) override; |
85 | 85 |
86 // views::LinkListener: | 86 // views::LinkListener: |
87 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 87 virtual void LinkClicked(views::Link* source, int event_flags) override; |
88 | 88 |
89 // views::MenuButtonListener: | 89 // views::MenuButtonListener: |
90 virtual void OnMenuButtonClicked(views::View* source, | 90 virtual void OnMenuButtonClicked(views::View* source, |
91 const gfx::Point& point) OVERRIDE; | 91 const gfx::Point& point) override; |
92 | 92 |
93 // Helper to get the preferred width of the media menu. | 93 // Helper to get the preferred width of the media menu. |
94 void UpdateMenuButtonSizes(const ui::NativeTheme* theme); | 94 void UpdateMenuButtonSizes(const ui::NativeTheme* theme); |
95 | 95 |
96 // Provides data for this bubble. | 96 // Provides data for this bubble. |
97 scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model_; | 97 scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model_; |
98 | 98 |
99 // Some of our controls, so we can tell what's been clicked when we get a | 99 // Some of our controls, so we can tell what's been clicked when we get a |
100 // message. | 100 // message. |
101 PopupLinks popup_links_; | 101 PopupLinks popup_links_; |
102 typedef std::vector<views::RadioButton*> RadioGroup; | 102 typedef std::vector<views::RadioButton*> RadioGroup; |
103 RadioGroup radio_group_; | 103 RadioGroup radio_group_; |
104 views::Link* custom_link_; | 104 views::Link* custom_link_; |
105 views::Link* manage_link_; | 105 views::Link* manage_link_; |
106 views::Link* learn_more_link_; | 106 views::Link* learn_more_link_; |
107 views::LabelButton* close_button_; | 107 views::LabelButton* close_button_; |
108 scoped_ptr<views::MenuRunner> menu_runner_; | 108 scoped_ptr<views::MenuRunner> menu_runner_; |
109 MediaMenuPartsMap media_menus_; | 109 MediaMenuPartsMap media_menus_; |
110 | 110 |
111 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingBubbleContents); | 111 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingBubbleContents); |
112 }; | 112 }; |
113 | 113 |
114 #endif // CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_ | 114 #endif // CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_BUBBLE_CONTENTS_H_ |
OLD | NEW |