| 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 "ui/views/controls/button/label_button.h" | 5 #include "ui/views/controls/button/label_button.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 // For styled buttons only, platforms other than Desktop Linux either ignore | 90 // For styled buttons only, platforms other than Desktop Linux either ignore |
| 91 // NativeTheme and use a hardcoded black or (on Mac) have a NativeTheme that | 91 // NativeTheme and use a hardcoded black or (on Mac) have a NativeTheme that |
| 92 // reliably returns black. | 92 // reliably returns black. |
| 93 styled_normal_text_color_ = SK_ColorBLACK; | 93 styled_normal_text_color_ = SK_ColorBLACK; |
| 94 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 94 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 95 // The Linux theme provides a non-black highlight text color, but it's not | 95 // The Linux theme provides a non-black highlight text color, but it's not |
| 96 // used for styled buttons. | 96 // used for styled buttons. |
| 97 styled_highlight_text_color_ = styled_normal_text_color_ = | 97 styled_highlight_text_color_ = styled_normal_text_color_ = |
| 98 button_->GetNativeTheme()->GetSystemColor( | 98 button_->GetNativeTheme()->GetSystemColor( |
| 99 ui::NativeTheme::kColorId_ButtonEnabledColor); | 99 ui::NativeTheme::kColorId_TextOnEnabledDialogButton); |
| 100 #elif defined(OS_MACOSX) | 100 #elif defined(OS_MACOSX) |
| 101 styled_highlight_text_color_ = SK_ColorWHITE; | 101 styled_highlight_text_color_ = SK_ColorWHITE; |
| 102 #else | 102 #else |
| 103 styled_highlight_text_color_ = styled_normal_text_color_; | 103 styled_highlight_text_color_ = styled_normal_text_color_; |
| 104 #endif | 104 #endif |
| 105 } | 105 } |
| 106 | 106 |
| 107 void TearDown() override { | 107 void TearDown() override { |
| 108 test_widget_->CloseNow(); | 108 test_widget_->CloseNow(); |
| 109 WidgetTest::TearDown(); | 109 WidgetTest::TearDown(); |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 530 |
| 531 // Verifies the target event handler View is the |LabelButton| and not any of | 531 // Verifies the target event handler View is the |LabelButton| and not any of |
| 532 // the child Views. | 532 // the child Views. |
| 533 TEST_F(InkDropLabelButtonTest, TargetEventHandler) { | 533 TEST_F(InkDropLabelButtonTest, TargetEventHandler) { |
| 534 View* target_view = widget_->GetRootView()->GetEventHandlerForPoint( | 534 View* target_view = widget_->GetRootView()->GetEventHandlerForPoint( |
| 535 button_->bounds().CenterPoint()); | 535 button_->bounds().CenterPoint()); |
| 536 EXPECT_EQ(button_, target_view); | 536 EXPECT_EQ(button_, target_view); |
| 537 } | 537 } |
| 538 | 538 |
| 539 } // namespace views | 539 } // namespace views |
| OLD | NEW |