Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1515)

Side by Side Diff: chrome/browser/ui/views/website_settings/permission_selector_view.cc

Issue 1682603002: [UI Views] Don't allow a ButtonListener and a MenuButtonListener (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 DISALLOW_COPY_AND_ASSIGN(PermissionMenuButton); 55 DISALLOW_COPY_AND_ASSIGN(PermissionMenuButton);
56 }; 56 };
57 57
58 /////////////////////////////////////////////////////////////////////////////// 58 ///////////////////////////////////////////////////////////////////////////////
59 // PermissionMenuButton 59 // PermissionMenuButton
60 /////////////////////////////////////////////////////////////////////////////// 60 ///////////////////////////////////////////////////////////////////////////////
61 61
62 PermissionMenuButton::PermissionMenuButton(const base::string16& text, 62 PermissionMenuButton::PermissionMenuButton(const base::string16& text,
63 PermissionMenuModel* model, 63 PermissionMenuModel* model,
64 bool show_menu_marker) 64 bool show_menu_marker)
65 : MenuButton(NULL, text, this, show_menu_marker), 65 : MenuButton(text, this, show_menu_marker), menu_model_(model) {
66 menu_model_(model) {
67 // Update the themed border before the NativeTheme is applied. Usually this 66 // Update the themed border before the NativeTheme is applied. Usually this
68 // happens in a call to LabelButton::OnNativeThemeChanged(). However, if 67 // happens in a call to LabelButton::OnNativeThemeChanged(). However, if
69 // PermissionMenuButton called that from its override, the NativeTheme would 68 // PermissionMenuButton called that from its override, the NativeTheme would
70 // be available, and the button would get native GTK styling on Linux. 69 // be available, and the button would get native GTK styling on Linux.
71 UpdateThemedBorder(); 70 UpdateThemedBorder();
72 71
73 is_rtl_display_ = 72 is_rtl_display_ =
74 base::i18n::RIGHT_TO_LEFT == base::i18n::GetStringDirection(text); 73 base::i18n::RIGHT_TO_LEFT == base::i18n::GetStringDirection(text);
75 } 74 }
76 75
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // Update the menu button text to reflect the new setting. 207 // Update the menu button text to reflect the new setting.
209 menu_button_->SetText(WebsiteSettingsUI::PermissionActionToUIString( 208 menu_button_->SetText(WebsiteSettingsUI::PermissionActionToUIString(
210 permission.type, permission.setting, permission.default_setting, 209 permission.type, permission.setting, permission.default_setting,
211 content_settings::SETTING_SOURCE_USER)); 210 content_settings::SETTING_SOURCE_USER));
212 menu_button_->SizeToPreferredSize(); 211 menu_button_->SizeToPreferredSize();
213 212
214 FOR_EACH_OBSERVER(PermissionSelectorViewObserver, 213 FOR_EACH_OBSERVER(PermissionSelectorViewObserver,
215 observer_list_, 214 observer_list_,
216 OnPermissionChanged(permission)); 215 OnPermissionChanged(permission));
217 } 216 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698