| 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/examples/native_theme_button_example.h" | 5 #include "ui/views/examples/native_theme_button_example.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 message = is_checked_ ? "Checked! count:%d" : | 84 message = is_checked_ ? "Checked! count:%d" : |
| 85 is_indeterminate_ ? "Indeterminate! count:%d" : "Unchecked! count:%d"; | 85 is_indeterminate_ ? "Indeterminate! count:%d" : "Unchecked! count:%d"; |
| 86 break; | 86 break; |
| 87 default: | 87 default: |
| 88 DCHECK(false); | 88 DCHECK(false); |
| 89 } | 89 } |
| 90 | 90 |
| 91 return base::StringPrintf(message, ++count_); | 91 return base::StringPrintf(message, ++count_); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void ExampleNativeThemeButton::ItemChanged(Combobox* combo_box, | 94 void ExampleNativeThemeButton::OnSelectedIndexChanged(Combobox* combobox) { |
| 95 int prev_index, | |
| 96 int new_index) { | |
| 97 SchedulePaint(); | 95 SchedulePaint(); |
| 98 } | 96 } |
| 99 | 97 |
| 100 gfx::NativeTheme::Part ExampleNativeThemeButton::GetThemePart() const { | 98 gfx::NativeTheme::Part ExampleNativeThemeButton::GetThemePart() const { |
| 101 switch (cb_part_->selected_index()) { | 99 switch (cb_part_->selected_index()) { |
| 102 case 0: | 100 case 0: |
| 103 return gfx::NativeTheme::kPushButton; | 101 return gfx::NativeTheme::kPushButton; |
| 104 case 1: | 102 case 1: |
| 105 return gfx::NativeTheme::kRadio; | 103 return gfx::NativeTheme::kRadio; |
| 106 case 2: | 104 case 2: |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 layout->AddPaddingRow(0, 8); | 247 layout->AddPaddingRow(0, 8); |
| 250 } | 248 } |
| 251 | 249 |
| 252 void NativeThemeButtonExample::ButtonPressed(Button* sender, | 250 void NativeThemeButtonExample::ButtonPressed(Button* sender, |
| 253 const Event& event) { | 251 const Event& event) { |
| 254 PrintStatus(button_->MessWithState().c_str()); | 252 PrintStatus(button_->MessWithState().c_str()); |
| 255 } | 253 } |
| 256 | 254 |
| 257 } // namespace examples | 255 } // namespace examples |
| 258 } // namespace views | 256 } // namespace views |
| OLD | NEW |