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 "chrome/views/dialog_delegate.h" | 9 #include "chrome/views/dialog_delegate.h" |
10 #include "chrome/views/image_view.h" | 10 #include "chrome/views/image_view.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 public ChromeViews::LinkController, | 32 public ChromeViews::LinkController, |
33 public GoogleUpdateStatusListener { | 33 public GoogleUpdateStatusListener { |
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 ChromeViews::View: | 41 // Overridden from ChromeViews::View: |
42 virtual void GetPreferredSize(CSize *out); | 42 virtual gfx::Size GetPreferredSize(); |
43 virtual void Layout(); | 43 virtual void Layout(); |
44 virtual void Paint(ChromeCanvas* canvas); | 44 virtual void Paint(ChromeCanvas* canvas); |
45 virtual void ViewHierarchyChanged(bool is_add, | 45 virtual void ViewHierarchyChanged(bool is_add, |
46 ChromeViews::View* parent, | 46 ChromeViews::View* parent, |
47 ChromeViews::View* child); | 47 ChromeViews::View* child); |
48 | 48 |
49 // Overridden from ChromeViews::DialogDelegate: | 49 // Overridden from ChromeViews::DialogDelegate: |
50 virtual int GetDialogButtons() const; | 50 virtual int GetDialogButtons() const; |
51 virtual std::wstring GetDialogButtonLabel(DialogButton button) const; | 51 virtual std::wstring GetDialogButtonLabel(DialogButton button) const; |
52 virtual bool IsDialogButtonEnabled(DialogButton button) const; | 52 virtual bool IsDialogButtonEnabled(DialogButton button) const; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // the function returns, the parameter |rect| contains where to draw the URL | 88 // the function returns, the parameter |rect| contains where to draw the URL |
89 // (to the right of where we just drew the text) and |position| is updated to | 89 // (to the right of where we just drew the text) and |position| is updated to |
90 // reflect where to draw the next string after the URL. | 90 // reflect where to draw the next string after the URL. |
91 // NOTE: The reason why we need this function is because while Skia knows how | 91 // NOTE: The reason why we need this function is because while Skia knows how |
92 // to wrap text appropriately, it doesn't tell us where it drew the last | 92 // to wrap text appropriately, it doesn't tell us where it drew the last |
93 // character, which we need to position the URLs within the text. | 93 // character, which we need to position the URLs within the text. |
94 void DrawTextAndPositionUrl(ChromeCanvas* canvas, | 94 void DrawTextAndPositionUrl(ChromeCanvas* canvas, |
95 const std::wstring& text, | 95 const std::wstring& text, |
96 ChromeViews::Link* link, | 96 ChromeViews::Link* link, |
97 gfx::Rect* rect, | 97 gfx::Rect* rect, |
98 CSize* position, | 98 gfx::Size* position, |
99 const gfx::Rect& bounds, | 99 const gfx::Rect& bounds, |
100 const ChromeFont& font); | 100 const ChromeFont& font); |
101 | 101 |
102 // A helper function for DrawTextAndPositionUrl, which simply draws the text | 102 // A helper function for DrawTextAndPositionUrl, which simply draws the text |
103 // from a certain starting point |position| and wraps within bounds. For | 103 // from a certain starting point |position| and wraps within bounds. For |
104 // details on the parameters, see DrawTextAndPositionUrl. | 104 // details on the parameters, see DrawTextAndPositionUrl. |
105 void DrawTextStartingFrom(ChromeCanvas* canvas, | 105 void DrawTextStartingFrom(ChromeCanvas* canvas, |
106 const std::wstring& text, | 106 const std::wstring& text, |
107 CSize* position, | 107 gfx::Size* position, |
108 const gfx::Rect& bounds, | 108 const gfx::Rect& bounds, |
109 const ChromeFont& font); | 109 const ChromeFont& font); |
110 | 110 |
111 // A simply utility function that calculates whether a word of width | 111 // A simply utility function that calculates whether a word of width |
112 // |word_width| fits at position |position| within the |bounds| rectangle. If | 112 // |word_width| fits at position |position| within the |bounds| rectangle. If |
113 // not, |position| is updated to wrap to the beginning of the next line. | 113 // not, |position| is updated to wrap to the beginning of the next line. |
114 void WrapIfWordDoesntFit(int word_width, | 114 void WrapIfWordDoesntFit(int word_width, |
115 int font_height, | 115 int font_height, |
116 CSize* position, | 116 gfx::Size* position, |
117 const gfx::Rect& bounds); | 117 const gfx::Rect& bounds); |
118 | 118 |
119 Profile* profile_; | 119 Profile* profile_; |
120 | 120 |
121 // UI elements on the dialog. | 121 // UI elements on the dialog. |
122 ChromeViews::ImageView* about_dlg_background_; | 122 ChromeViews::ImageView* about_dlg_background_; |
123 ChromeViews::Label* about_title_label_; | 123 ChromeViews::Label* about_title_label_; |
124 ChromeViews::TextField* version_label_; | 124 ChromeViews::TextField* version_label_; |
125 ChromeViews::Label* copyright_label_; | 125 ChromeViews::Label* copyright_label_; |
126 ChromeViews::Label* main_text_label_; | 126 ChromeViews::Label* main_text_label_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 std::wstring current_version_; | 160 std::wstring current_version_; |
161 | 161 |
162 // The version Google Update reports is available to us. | 162 // The version Google Update reports is available to us. |
163 std::wstring new_version_available_; | 163 std::wstring new_version_available_; |
164 | 164 |
165 DISALLOW_COPY_AND_ASSIGN(AboutChromeView); | 165 DISALLOW_COPY_AND_ASSIGN(AboutChromeView); |
166 }; | 166 }; |
167 | 167 |
168 #endif // CHROME_BROWSER_VIEWS_ABOUT_CHROME_VIEW_H_ | 168 #endif // CHROME_BROWSER_VIEWS_ABOUT_CHROME_VIEW_H_ |
169 | 169 |
OLD | NEW |