| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| 6 #define VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 6 #define VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 // | 400 // |
| 401 //////////////////////////////////////////////////////////////////////////////// | 401 //////////////////////////////////////////////////////////////////////////////// |
| 402 class VIEWS_EXPORT NativeTextButton : public TextButton { | 402 class VIEWS_EXPORT NativeTextButton : public TextButton { |
| 403 public: | 403 public: |
| 404 // The button's class name. | 404 // The button's class name. |
| 405 static const char kViewClassName[]; | 405 static const char kViewClassName[]; |
| 406 | 406 |
| 407 NativeTextButton(ButtonListener* listener); | 407 NativeTextButton(ButtonListener* listener); |
| 408 NativeTextButton(ButtonListener* listener, const std::wstring& text); | 408 NativeTextButton(ButtonListener* listener, const std::wstring& text); |
| 409 | 409 |
| 410 // Sets/Gets the text to be used as the button's label. | |
| 411 // TODO: Remove this function and replace all call sites with SetText(). | |
| 412 void SetLabel(const std::wstring& label) { | |
| 413 SetText(label); | |
| 414 } | |
| 415 std::wstring label() const { return text(); } | |
| 416 | |
| 417 // Overridden from TextButton: | 410 // Overridden from TextButton: |
| 418 virtual gfx::Size GetMinimumSize() OVERRIDE; | 411 virtual gfx::Size GetMinimumSize() OVERRIDE; |
| 419 | 412 |
| 420 virtual std::string GetClassName() const OVERRIDE; | 413 virtual std::string GetClassName() const OVERRIDE; |
| 421 | 414 |
| 422 private: | 415 private: |
| 423 void Init(); | 416 void Init(); |
| 424 | 417 |
| 425 // Overridden from View: | 418 // Overridden from View: |
| 426 virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE; | 419 virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE; |
| 427 | 420 |
| 428 // Overridden from TextButton: | 421 // Overridden from TextButton: |
| 429 virtual void GetExtraParams( | 422 virtual void GetExtraParams( |
| 430 gfx::NativeTheme::ExtraParams* params) const OVERRIDE; | 423 gfx::NativeTheme::ExtraParams* params) const OVERRIDE; |
| 431 | 424 |
| 432 DISALLOW_COPY_AND_ASSIGN(NativeTextButton); | 425 DISALLOW_COPY_AND_ASSIGN(NativeTextButton); |
| 433 }; | 426 }; |
| 434 | 427 |
| 435 } // namespace views | 428 } // namespace views |
| 436 | 429 |
| 437 #endif // VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 430 #endif // VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| OLD | NEW |