| 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 CHROME_BROWSER_VIEWS_ABOUT_CHROME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_ABOUT_CHROME_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_ABOUT_CHROME_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_ABOUT_CHROME_VIEW_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/google_update.h" | 8 #include "chrome/browser/google_update.h" |
| 9 #include "views/controls/image_view.h" | 9 #include "views/controls/image_view.h" |
| 10 #include "views/controls/label.h" | 10 #include "views/controls/label.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // reflect where to draw the next string after the URL. | 92 // reflect where to draw the next string after the URL. |
| 93 // NOTE: The reason why we need this function is because while Skia knows how | 93 // NOTE: The reason why we need this function is because while Skia knows how |
| 94 // to wrap text appropriately, it doesn't tell us where it drew the last | 94 // to wrap text appropriately, it doesn't tell us where it drew the last |
| 95 // character, which we need to position the URLs within the text. | 95 // character, which we need to position the URLs within the text. |
| 96 void DrawTextAndPositionUrl(ChromeCanvas* canvas, | 96 void DrawTextAndPositionUrl(ChromeCanvas* canvas, |
| 97 const std::wstring& text, | 97 const std::wstring& text, |
| 98 views::Link* link, | 98 views::Link* link, |
| 99 gfx::Rect* rect, | 99 gfx::Rect* rect, |
| 100 gfx::Size* position, | 100 gfx::Size* position, |
| 101 const gfx::Rect& bounds, | 101 const gfx::Rect& bounds, |
| 102 const ChromeFont& font); | 102 const gfx::Font& font); |
| 103 | 103 |
| 104 // A helper function for DrawTextAndPositionUrl, which simply draws the text | 104 // A helper function for DrawTextAndPositionUrl, which simply draws the text |
| 105 // from a certain starting point |position| and wraps within bounds. | 105 // from a certain starting point |position| and wraps within bounds. |
| 106 // |word_for_word| specifies whether to draw the text word for word or wheter | 106 // |word_for_word| specifies whether to draw the text word for word or wheter |
| 107 // to treat the text as one blurb (similar to the way url's are treated inside | 107 // to treat the text as one blurb (similar to the way url's are treated inside |
| 108 // RTL text. For details on the other parameters, see DrawTextAndPositionUrl. | 108 // RTL text. For details on the other parameters, see DrawTextAndPositionUrl. |
| 109 void DrawTextStartingFrom(ChromeCanvas* canvas, | 109 void DrawTextStartingFrom(ChromeCanvas* canvas, |
| 110 const std::wstring& text, | 110 const std::wstring& text, |
| 111 gfx::Size* position, | 111 gfx::Size* position, |
| 112 const gfx::Rect& bounds, | 112 const gfx::Rect& bounds, |
| 113 const ChromeFont& font, | 113 const gfx::Font& font, |
| 114 bool word_for_word); | 114 bool word_for_word); |
| 115 | 115 |
| 116 // A simply utility function that calculates whether a word of width | 116 // A simply utility function that calculates whether a word of width |
| 117 // |word_width| fits at position |position| within the |bounds| rectangle. If | 117 // |word_width| fits at position |position| within the |bounds| rectangle. If |
| 118 // not, |position| is updated to wrap to the beginning of the next line. | 118 // not, |position| is updated to wrap to the beginning of the next line. |
| 119 void WrapIfWordDoesntFit(int word_width, | 119 void WrapIfWordDoesntFit(int word_width, |
| 120 int font_height, | 120 int font_height, |
| 121 gfx::Size* position, | 121 gfx::Size* position, |
| 122 const gfx::Rect& bounds); | 122 const gfx::Rect& bounds); |
| 123 | 123 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // The version Google Update reports is available to us. | 170 // The version Google Update reports is available to us. |
| 171 std::wstring new_version_available_; | 171 std::wstring new_version_available_; |
| 172 | 172 |
| 173 // Whether text direction is left-to-right or right-to-left. | 173 // Whether text direction is left-to-right or right-to-left. |
| 174 bool text_direction_is_rtl_; | 174 bool text_direction_is_rtl_; |
| 175 | 175 |
| 176 DISALLOW_COPY_AND_ASSIGN(AboutChromeView); | 176 DISALLOW_COPY_AND_ASSIGN(AboutChromeView); |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 #endif // CHROME_BROWSER_VIEWS_ABOUT_CHROME_VIEW_H_ | 179 #endif // CHROME_BROWSER_VIEWS_ABOUT_CHROME_VIEW_H_ |
| OLD | NEW |