| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/controls/button/text_button.h" | 5 #include "views/controls/button/text_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/throb_animation.h" | 9 #include "app/throb_animation.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 if (enabled != IsEnabled()) { | 390 if (enabled != IsEnabled()) { |
| 391 CustomButton::SetEnabled(enabled); | 391 CustomButton::SetEnabled(enabled); |
| 392 } | 392 } |
| 393 // We should always call UpdateColor() since the state of the button might be | 393 // We should always call UpdateColor() since the state of the button might be |
| 394 // changed by other functions like CustomButton::SetState(). | 394 // changed by other functions like CustomButton::SetState(). |
| 395 UpdateColor(); | 395 UpdateColor(); |
| 396 SchedulePaint(); | 396 SchedulePaint(); |
| 397 } | 397 } |
| 398 | 398 |
| 399 bool TextButton::OnMousePressed(const MouseEvent& e) { | 399 bool TextButton::OnMousePressed(const MouseEvent& e) { |
| 400 RequestFocus(); | 400 if (request_focus_on_press()) |
| 401 RequestFocus(); |
| 401 return true; | 402 return true; |
| 402 } | 403 } |
| 403 | 404 |
| 404 void TextButton::Paint(gfx::Canvas* canvas) { | 405 void TextButton::Paint(gfx::Canvas* canvas) { |
| 405 Paint(canvas, false); | 406 Paint(canvas, false); |
| 406 } | 407 } |
| 407 | 408 |
| 408 } // namespace views | 409 } // namespace views |
| OLD | NEW |