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

Unified Diff: chrome/browser/ui/views/website_settings/permission_selector_view.cc

Issue 298813002: views: Move MenuButton from TextButton to LabelButton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable DragDirectlyToSecondWindow. Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/website_settings/permission_selector_view.cc
diff --git a/chrome/browser/ui/views/website_settings/permission_selector_view.cc b/chrome/browser/ui/views/website_settings/permission_selector_view.cc
index 40fab862ae0618a9e5fa45ae0ebd15a9407e5a38..6b44308e798eeb7f65093a999f37b825e0c92afa 100644
--- a/chrome/browser/ui/views/website_settings/permission_selector_view.cc
+++ b/chrome/browser/ui/views/website_settings/permission_selector_view.cc
@@ -45,9 +45,6 @@ class PermissionMenuButton : public views::MenuButton,
bool show_menu_marker);
virtual ~PermissionMenuButton();
- // Overridden from views::MenuButton.
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
-
// Overridden from views::TextButton.
virtual void SetText(const base::string16& text) OVERRIDE;
@@ -75,28 +72,11 @@ PermissionMenuButton::PermissionMenuButton(const base::string16& text,
bool show_menu_marker)
: MenuButton(NULL, text, this, show_menu_marker),
menu_model_(model) {
-
}
PermissionMenuButton::~PermissionMenuButton() {
}
-gfx::Size PermissionMenuButton::GetPreferredSize() const {
- gfx::Insets insets = GetInsets();
- // Scale the button to the current text size.
- gfx::Size prefsize(text_size_.width() + insets.width(),
- text_size_.height() + insets.height());
- if (max_width_ > 0)
- prefsize.set_width(std::min(max_width_, prefsize.width()));
- if (show_menu_marker()) {
- prefsize.Enlarge(menu_marker()->width() +
- views::MenuButton::kMenuMarkerPaddingLeft +
- views::MenuButton::kMenuMarkerPaddingRight,
- 0);
- }
- return prefsize;
-}
-
void PermissionMenuButton::SetText(const base::string16& text) {
MenuButton::SetText(text);
SizeToPreferredSize();
@@ -104,15 +84,15 @@ void PermissionMenuButton::SetText(const base::string16& text) {
void PermissionMenuButton::GetAccessibleState(ui::AXViewState* state) {
MenuButton::GetAccessibleState(state);
- state->value = text();
+ state->value = GetText();
}
void PermissionMenuButton::OnNativeThemeChanged(const ui::NativeTheme* theme) {
- SetEnabledColor(theme->GetSystemColor(
+ SetTextColor(views::Button::STATE_NORMAL, GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_LabelEnabledColor));
- SetHoverColor(theme->GetSystemColor(
+ SetTextColor(views::Button::STATE_HOVERED, GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_LabelEnabledColor));
- SetDisabledColor(theme->GetSystemColor(
+ SetTextColor(views::Button::STATE_DISABLED, GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_LabelDisabledColor));
}

Powered by Google App Engine
This is Rietveld 408576698