| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 PermissionMenuButton::PermissionMenuButton(const base::string16& text, | 64 PermissionMenuButton::PermissionMenuButton(const base::string16& text, |
| 65 PermissionMenuModel* model, | 65 PermissionMenuModel* model, |
| 66 bool show_menu_marker) | 66 bool show_menu_marker) |
| 67 : MenuButton(text, this, show_menu_marker), menu_model_(model) { | 67 : MenuButton(text, this, show_menu_marker), menu_model_(model) { |
| 68 // Update the themed border before the NativeTheme is applied. Usually this | 68 // Update the themed border before the NativeTheme is applied. Usually this |
| 69 // happens in a call to LabelButton::OnNativeThemeChanged(). However, if | 69 // happens in a call to LabelButton::OnNativeThemeChanged(). However, if |
| 70 // PermissionMenuButton called that from its override, the NativeTheme would | 70 // PermissionMenuButton called that from its override, the NativeTheme would |
| 71 // be available, and the button would get native GTK styling on Linux. | 71 // be available, and the button would get native GTK styling on Linux. |
| 72 UpdateThemedBorder(); | 72 UpdateThemedBorder(); |
| 73 | 73 |
| 74 SetFocusBehavior(FocusBehavior::ALWAYS); | 74 Button::ConfigureDefaultFocus(this); |
| 75 is_rtl_display_ = | 75 is_rtl_display_ = |
| 76 base::i18n::RIGHT_TO_LEFT == base::i18n::GetStringDirection(text); | 76 base::i18n::RIGHT_TO_LEFT == base::i18n::GetStringDirection(text); |
| 77 } | 77 } |
| 78 | 78 |
| 79 PermissionMenuButton::~PermissionMenuButton() { | 79 PermissionMenuButton::~PermissionMenuButton() { |
| 80 } | 80 } |
| 81 | 81 |
| 82 void PermissionMenuButton::GetAccessibleState(ui::AXViewState* state) { | 82 void PermissionMenuButton::GetAccessibleState(ui::AXViewState* state) { |
| 83 MenuButton::GetAccessibleState(state); | 83 MenuButton::GetAccessibleState(state); |
| 84 state->value = GetText(); | 84 state->value = GetText(); |
| (...skipping 125 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 |