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

Side by Side Diff: ui/views/controls/button/label_button.cc

Issue 288983010: fix text color of BlueButton on GTK-theme-mode Linux Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/button/label_button.h" 5 #include "ui/views/controls/button/label_button.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/animation/throb_animation.h" 10 #include "ui/gfx/animation/throb_animation.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 void LabelButton::UpdateThemedBorder() { 358 void LabelButton::UpdateThemedBorder() {
359 // Don't override borders set by others. 359 // Don't override borders set by others.
360 if (!border_is_themed_border_) 360 if (!border_is_themed_border_)
361 return; 361 return;
362 362
363 scoped_ptr<Border> label_button_border = CreateDefaultBorder(); 363 scoped_ptr<Border> label_button_border = CreateDefaultBorder();
364 364
365 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 365 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
366 views::LinuxUI* linux_ui = views::LinuxUI::instance(); 366 views::LinuxUI* linux_ui = views::LinuxUI::instance();
367 if (linux_ui) { 367 if (linux_ui) {
368 Border* default_border = label_button_border.get();
368 SetBorder(linux_ui->CreateNativeBorder(this, label_button_border.Pass())); 369 SetBorder(linux_ui->CreateNativeBorder(this, label_button_border.Pass()));
370 label_->SetBackgroundColor(GetNativeTheme()->GetSystemColor(
371 ui::NativeTheme::kColorId_ButtonBackgroundColor));
372 // If we're using a system-themed border, make sure text is legible.
373 label_->SetAutoColorReadabilityEnabled(border() != default_border);
Elliot Glaysher 2014/05/23 21:07:01 Do we want to be executing all this outside of Blu
Evan Stade 2014/05/23 23:39:53 I guess I get why you're asking -- because normal
369 } else 374 } else
370 #endif 375 #endif
371 { 376 {
372 SetBorder(label_button_border.Pass()); 377 SetBorder(label_button_border.Pass());
373 } 378 }
374 379
375 border_is_themed_border_ = true; 380 border_is_themed_border_ = true;
376 } 381 }
377 382
378 void LabelButton::StateChanged() { 383 void LabelButton::StateChanged() {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 return ui::NativeTheme::kNormal; 433 return ui::NativeTheme::kNormal;
429 } 434 }
430 435
431 ui::NativeTheme::State LabelButton::GetForegroundThemeState( 436 ui::NativeTheme::State LabelButton::GetForegroundThemeState(
432 ui::NativeTheme::ExtraParams* params) const { 437 ui::NativeTheme::ExtraParams* params) const {
433 GetExtraParams(params); 438 GetExtraParams(params);
434 return ui::NativeTheme::kHovered; 439 return ui::NativeTheme::kHovered;
435 } 440 }
436 441
437 } // namespace views 442 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698