OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/ui/views/website_settings/permissions_bubble_view.h" | 5 #include "chrome/browser/ui/views/website_settings/permissions_bubble_view.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" | 8 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" |
9 #include "chrome/browser/ui/views/website_settings/permission_selector_view_obse
rver.h" | 9 #include "chrome/browser/ui/views/website_settings/permission_selector_view_obse
rver.h" |
10 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" | 10 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 }; | 62 }; |
63 | 63 |
64 PermissionCombobox(Listener* listener, | 64 PermissionCombobox(Listener* listener, |
65 int index, | 65 int index, |
66 const GURL& url, | 66 const GURL& url, |
67 ContentSetting setting); | 67 ContentSetting setting); |
68 virtual ~PermissionCombobox(); | 68 virtual ~PermissionCombobox(); |
69 | 69 |
70 int index() const { return index_; } | 70 int index() const { return index_; } |
71 | 71 |
72 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 72 virtual void GetAccessibleState(ui::AXViewState* state) override; |
73 | 73 |
74 // MenuButtonListener: | 74 // MenuButtonListener: |
75 virtual void OnMenuButtonClicked(View* source, | 75 virtual void OnMenuButtonClicked(View* source, |
76 const gfx::Point& point) OVERRIDE; | 76 const gfx::Point& point) override; |
77 | 77 |
78 // Callback when a permission's setting is changed. | 78 // Callback when a permission's setting is changed. |
79 void PermissionChanged(const WebsiteSettingsUI::PermissionInfo& permission); | 79 void PermissionChanged(const WebsiteSettingsUI::PermissionInfo& permission); |
80 | 80 |
81 private: | 81 private: |
82 int index_; | 82 int index_; |
83 Listener* listener_; | 83 Listener* listener_; |
84 scoped_ptr<PermissionMenuModel> model_; | 84 scoped_ptr<PermissionMenuModel> model_; |
85 scoped_ptr<views::MenuRunner> menu_runner_; | 85 scoped_ptr<views::MenuRunner> menu_runner_; |
86 }; | 86 }; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 class CustomizeAllowComboboxModel : public ui::ComboboxModel { | 139 class CustomizeAllowComboboxModel : public ui::ComboboxModel { |
140 public: | 140 public: |
141 enum Item { | 141 enum Item { |
142 INDEX_ALLOW = 0, | 142 INDEX_ALLOW = 0, |
143 INDEX_CUSTOMIZE = 1 | 143 INDEX_CUSTOMIZE = 1 |
144 }; | 144 }; |
145 | 145 |
146 CustomizeAllowComboboxModel() {} | 146 CustomizeAllowComboboxModel() {} |
147 virtual ~CustomizeAllowComboboxModel() {} | 147 virtual ~CustomizeAllowComboboxModel() {} |
148 | 148 |
149 virtual int GetItemCount() const OVERRIDE; | 149 virtual int GetItemCount() const override; |
150 virtual base::string16 GetItemAt(int index) OVERRIDE; | 150 virtual base::string16 GetItemAt(int index) override; |
151 virtual int GetDefaultIndex() const OVERRIDE; | 151 virtual int GetDefaultIndex() const override; |
152 }; | 152 }; |
153 | 153 |
154 int CustomizeAllowComboboxModel::GetItemCount() const { | 154 int CustomizeAllowComboboxModel::GetItemCount() const { |
155 return 2; | 155 return 2; |
156 } | 156 } |
157 | 157 |
158 base::string16 CustomizeAllowComboboxModel::GetItemAt(int index) { | 158 base::string16 CustomizeAllowComboboxModel::GetItemAt(int index) { |
159 if (index == INDEX_ALLOW) | 159 if (index == INDEX_ALLOW) |
160 return l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW); | 160 return l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW); |
161 else | 161 else |
(...skipping 16 matching lines...) Expand all Loading... |
178 PermissionBubbleViewViews* owner, | 178 PermissionBubbleViewViews* owner, |
179 const std::vector<PermissionBubbleRequest*>& requests, | 179 const std::vector<PermissionBubbleRequest*>& requests, |
180 const std::vector<bool>& accept_state, | 180 const std::vector<bool>& accept_state, |
181 bool customization_mode); | 181 bool customization_mode); |
182 virtual ~PermissionsBubbleDelegateView(); | 182 virtual ~PermissionsBubbleDelegateView(); |
183 | 183 |
184 void Close(); | 184 void Close(); |
185 void SizeToContents(); | 185 void SizeToContents(); |
186 | 186 |
187 // BubbleDelegateView: | 187 // BubbleDelegateView: |
188 virtual bool ShouldShowCloseButton() const OVERRIDE; | 188 virtual bool ShouldShowCloseButton() const override; |
189 virtual bool ShouldShowWindowTitle() const OVERRIDE; | 189 virtual bool ShouldShowWindowTitle() const override; |
190 virtual const gfx::FontList& GetTitleFontList() const OVERRIDE; | 190 virtual const gfx::FontList& GetTitleFontList() const override; |
191 virtual base::string16 GetWindowTitle() const OVERRIDE; | 191 virtual base::string16 GetWindowTitle() const override; |
192 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; | 192 virtual void OnWidgetDestroying(views::Widget* widget) override; |
193 | 193 |
194 // ButtonListener: | 194 // ButtonListener: |
195 virtual void ButtonPressed(views::Button* button, | 195 virtual void ButtonPressed(views::Button* button, |
196 const ui::Event& event) OVERRIDE; | 196 const ui::Event& event) override; |
197 | 197 |
198 // ComboboxListener: | 198 // ComboboxListener: |
199 virtual void OnPerformAction(views::Combobox* combobox) OVERRIDE; | 199 virtual void OnPerformAction(views::Combobox* combobox) override; |
200 | 200 |
201 // PermissionCombobox::Listener: | 201 // PermissionCombobox::Listener: |
202 virtual void PermissionSelectionChanged(int index, bool allowed) OVERRIDE; | 202 virtual void PermissionSelectionChanged(int index, bool allowed) override; |
203 | 203 |
204 private: | 204 private: |
205 PermissionBubbleViewViews* owner_; | 205 PermissionBubbleViewViews* owner_; |
206 views::Button* allow_; | 206 views::Button* allow_; |
207 views::Button* deny_; | 207 views::Button* deny_; |
208 views::Combobox* allow_combobox_; | 208 views::Combobox* allow_combobox_; |
209 base::string16 hostname_; | 209 base::string16 hostname_; |
210 scoped_ptr<PermissionMenuModel> menu_button_model_; | 210 scoped_ptr<PermissionMenuModel> menu_button_model_; |
211 std::vector<PermissionCombobox*> customize_comboboxes_; | 211 std::vector<PermissionCombobox*> customize_comboboxes_; |
212 | 212 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 478 |
479 void PermissionBubbleViewViews::Deny() { | 479 void PermissionBubbleViewViews::Deny() { |
480 if (delegate_) | 480 if (delegate_) |
481 delegate_->Deny(); | 481 delegate_->Deny(); |
482 } | 482 } |
483 | 483 |
484 void PermissionBubbleViewViews::SetCustomizationMode() { | 484 void PermissionBubbleViewViews::SetCustomizationMode() { |
485 if (delegate_) | 485 if (delegate_) |
486 delegate_->SetCustomizationMode(); | 486 delegate_->SetCustomizationMode(); |
487 } | 487 } |
OLD | NEW |