| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_LABEL_H_ | 5 #ifndef VIEWS_CONTROLS_LABEL_H_ |
| 6 #define VIEWS_CONTROLS_LABEL_H_ | 6 #define VIEWS_CONTROLS_LABEL_H_ |
| 7 | 7 |
| 8 #include "app/gfx/chrome_font.h" | 8 #include "app/gfx/font.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| 11 #include "testing/gtest/include/gtest/gtest_prod.h" | 11 #include "testing/gtest/include/gtest/gtest_prod.h" |
| 12 #include "views/view.h" | 12 #include "views/view.h" |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 | 15 |
| 16 ///////////////////////////////////////////////////////////////////////////// | 16 ///////////////////////////////////////////////////////////////////////////// |
| 17 // | 17 // |
| 18 // Label class | 18 // Label class |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 // Return the height necessary to display this label with the provided width. | 61 // Return the height necessary to display this label with the provided width. |
| 62 // This method is used to layout multi-line labels. It is equivalent to | 62 // This method is used to layout multi-line labels. It is equivalent to |
| 63 // GetPreferredSize().height() if the receiver is not multi-line | 63 // GetPreferredSize().height() if the receiver is not multi-line |
| 64 virtual int GetHeightForWidth(int w); | 64 virtual int GetHeightForWidth(int w); |
| 65 | 65 |
| 66 // Returns views/Label. | 66 // Returns views/Label. |
| 67 virtual std::string GetClassName() const; | 67 virtual std::string GetClassName() const; |
| 68 | 68 |
| 69 // Overridden to paint | 69 // Overridden to paint |
| 70 virtual void Paint(ChromeCanvas* canvas); | 70 virtual void Paint(gfx::Canvas* canvas); |
| 71 | 71 |
| 72 // If the mouse is over the label, and a mouse over background has been | 72 // If the mouse is over the label, and a mouse over background has been |
| 73 // specified, its used. Otherwise super's implementation is invoked | 73 // specified, its used. Otherwise super's implementation is invoked |
| 74 virtual void PaintBackground(ChromeCanvas* canvas); | 74 virtual void PaintBackground(gfx::Canvas* canvas); |
| 75 | 75 |
| 76 // Set the font. | 76 // Set the font. |
| 77 void SetFont(const gfx::Font& font); | 77 void SetFont(const gfx::Font& font); |
| 78 | 78 |
| 79 // Return the font used by this label | 79 // Return the font used by this label |
| 80 gfx::Font GetFont() const; | 80 gfx::Font GetFont() const; |
| 81 | 81 |
| 82 // Set the label text. | 82 // Set the label text. |
| 83 void SetText(const std::wstring& text); | 83 void SetText(const std::wstring& text); |
| 84 | 84 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // allows this view to reserve space for a focus border that it otherwise | 241 // allows this view to reserve space for a focus border that it otherwise |
| 242 // might not have because it is not itself focusable. | 242 // might not have because it is not itself focusable. |
| 243 bool has_focus_border_; | 243 bool has_focus_border_; |
| 244 | 244 |
| 245 DISALLOW_COPY_AND_ASSIGN(Label); | 245 DISALLOW_COPY_AND_ASSIGN(Label); |
| 246 }; | 246 }; |
| 247 | 247 |
| 248 } // namespace views | 248 } // namespace views |
| 249 | 249 |
| 250 #endif // VIEWS_CONTROLS_LABEL_H_ | 250 #endif // VIEWS_CONTROLS_LABEL_H_ |
| OLD | NEW |