| 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 23 matching lines...) Expand all Loading... |
| 34 public: | 34 public: |
| 35 explicit AboutChromeView(Profile* profile); | 35 explicit AboutChromeView(Profile* profile); |
| 36 virtual ~AboutChromeView(); | 36 virtual ~AboutChromeView(); |
| 37 | 37 |
| 38 // Initialize the controls on the dialog. | 38 // Initialize the controls on the dialog. |
| 39 void Init(); | 39 void Init(); |
| 40 | 40 |
| 41 // Overridden from views::View: | 41 // Overridden from views::View: |
| 42 virtual gfx::Size GetPreferredSize(); | 42 virtual gfx::Size GetPreferredSize(); |
| 43 virtual void Layout(); | 43 virtual void Layout(); |
| 44 virtual void Paint(ChromeCanvas* canvas); | 44 virtual void Paint(gfx::Canvas* canvas); |
| 45 virtual void ViewHierarchyChanged(bool is_add, | 45 virtual void ViewHierarchyChanged(bool is_add, |
| 46 views::View* parent, | 46 views::View* parent, |
| 47 views::View* child); | 47 views::View* child); |
| 48 | 48 |
| 49 // Overridden from views::DialogDelegate: | 49 // Overridden from views::DialogDelegate: |
| 50 virtual std::wstring GetDialogButtonLabel( | 50 virtual std::wstring GetDialogButtonLabel( |
| 51 MessageBoxFlags::DialogButton button) const; | 51 MessageBoxFlags::DialogButton button) const; |
| 52 virtual bool IsDialogButtonEnabled( | 52 virtual bool IsDialogButtonEnabled( |
| 53 MessageBoxFlags::DialogButton button) const; | 53 MessageBoxFlags::DialogButton button) const; |
| 54 virtual bool IsDialogButtonVisible( | 54 virtual bool IsDialogButtonVisible( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // track of where it ends so we can position a URL after the text. The | 86 // track of where it ends so we can position a URL after the text. The |
| 87 // parameter |bounds| represents the boundary we have to work with, |position| | 87 // parameter |bounds| represents the boundary we have to work with, |position| |
| 88 // specifies where to draw the string (relative to the top left corner of the | 88 // specifies where to draw the string (relative to the top left corner of the |
| 89 // |bounds| rectangle and |font| specifies the font to use when drawing. When | 89 // |bounds| rectangle and |font| specifies the font to use when drawing. When |
| 90 // the function returns, the parameter |rect| contains where to draw the URL | 90 // the function returns, the parameter |rect| contains where to draw the URL |
| 91 // (to the right of where we just drew the text) and |position| is updated to | 91 // (to the right of where we just drew the text) and |position| is updated to |
| 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(gfx::Canvas* 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 gfx::Font& 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(gfx::Canvas* 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 gfx::Font& 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, |
| (...skipping 50 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 |