| 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 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" | 5 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h
" | 10 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h
" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 void GetAccessibleState(ui::AXViewState* state) override; | 43 void GetAccessibleState(ui::AXViewState* state) override; |
| 44 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 44 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // Overridden from views::MenuButtonListener. | 47 // Overridden from views::MenuButtonListener. |
| 48 void OnMenuButtonClicked(views::MenuButton* source, | 48 void OnMenuButtonClicked(views::MenuButton* source, |
| 49 const gfx::Point& point, | 49 const gfx::Point& point, |
| 50 const ui::Event* event) override; | 50 const ui::Event* event) override; |
| 51 | 51 |
| 52 PermissionMenuModel* menu_model_; // Owned by |PermissionSelectorView|. | 52 PermissionMenuModel* menu_model_; // Owned by |PermissionSelectorView|. |
| 53 scoped_ptr<views::MenuRunner> menu_runner_; | 53 std::unique_ptr<views::MenuRunner> menu_runner_; |
| 54 | 54 |
| 55 bool is_rtl_display_; | 55 bool is_rtl_display_; |
| 56 | 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(PermissionMenuButton); | 57 DISALLOW_COPY_AND_ASSIGN(PermissionMenuButton); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 /////////////////////////////////////////////////////////////////////////////// | 60 /////////////////////////////////////////////////////////////////////////////// |
| 61 // PermissionMenuButton | 61 // PermissionMenuButton |
| 62 /////////////////////////////////////////////////////////////////////////////// | 62 /////////////////////////////////////////////////////////////////////////////// |
| 63 | 63 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 // Update the menu button text to reflect the new setting. | 210 // Update the menu button text to reflect the new setting. |
| 211 menu_button_->SetText(WebsiteSettingsUI::PermissionActionToUIString( | 211 menu_button_->SetText(WebsiteSettingsUI::PermissionActionToUIString( |
| 212 permission.type, permission.setting, permission.default_setting, | 212 permission.type, permission.setting, permission.default_setting, |
| 213 content_settings::SETTING_SOURCE_USER)); | 213 content_settings::SETTING_SOURCE_USER)); |
| 214 menu_button_->SizeToPreferredSize(); | 214 menu_button_->SizeToPreferredSize(); |
| 215 | 215 |
| 216 FOR_EACH_OBSERVER(PermissionSelectorViewObserver, | 216 FOR_EACH_OBSERVER(PermissionSelectorViewObserver, |
| 217 observer_list_, | 217 observer_list_, |
| 218 OnPermissionChanged(permission)); | 218 OnPermissionChanged(permission)); |
| 219 } | 219 } |
| OLD | NEW |