Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_WEB_STYLE_TEXT_BUTTON_H_ | |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_WEB_STYLE_TEXT_BUTTON_H_ | |
| 7 | |
| 8 #include "ui/views/controls/button/text_button.h" | |
| 9 | |
| 10 namespace views { | |
| 11 | |
| 12 class WebStyleTextButtonBackground; | |
| 13 class WebStyleTextButtonBorder; | |
| 14 | |
| 15 //////////////////////////////////////////////////////////////////////////////// | |
| 16 // | |
| 17 // WebStyleTextButton | |
| 18 // | |
| 19 // Similar to TextButton, but rendered with in a style similar to | |
| 20 // Chrome WebUI. | |
| 21 // | |
| 22 //////////////////////////////////////////////////////////////////////////////// | |
| 23 | |
| 24 class VIEWS_EXPORT WebStyleTextButton : public TextButton { | |
|
Ben Goodger (Google)
2012/09/17 22:37:26
Can we avoid adding Yet-Another-Button-Subclass an
Mike Wittman
2012/09/21 22:53:18
Yes. I've refactored the necessary functionality
| |
| 25 public: | |
| 26 // The button's class name. | |
| 27 static const char kViewClassName[]; | |
| 28 | |
| 29 WebStyleTextButton(ButtonListener* listener, const string16& title); | |
| 30 | |
| 31 // Overridden from View | |
| 32 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
| 33 virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE; | |
| 34 | |
| 35 // Overridden from CustomButton | |
| 36 virtual void StateChanged() OVERRIDE; | |
| 37 | |
| 38 // Overridden from TextButton: | |
| 39 virtual std::string GetClassName() const OVERRIDE; | |
| 40 | |
| 41 private: | |
| 42 void SetBackgroundForState(ButtonState state); | |
| 43 void SetShadowForState(ButtonState state); | |
| 44 void SetBorderColorForState(ButtonState state); | |
| 45 | |
| 46 ButtonState prior_state_; | |
| 47 // Weak pointer to typed background instance. | |
| 48 WebStyleTextButtonBackground* web_style_background_; | |
| 49 // Weak pointer to typed border instance. | |
| 50 WebStyleTextButtonBorder* web_style_border_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(WebStyleTextButton); | |
| 53 }; | |
| 54 | |
| 55 } // namespace views | |
| 56 | |
| 57 #endif // UI_VIEWS_CONTROLS_BUTTON_WEB_STYLE_TEXT_BUTTON_H_ | |
| OLD | NEW |