| 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_LOCATION_BAR_VIEW_H__ | 5 #ifndef CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H__ |
| 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H__ | 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gfx/rect.h" | 10 #include "base/gfx/rect.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 // Updates the location bar. We also reset the bar's permanent text and | 61 // Updates the location bar. We also reset the bar's permanent text and |
| 62 // security style, and, if |tab_for_state_restoring| is non-NULL, also restore | 62 // security style, and, if |tab_for_state_restoring| is non-NULL, also restore |
| 63 // saved state that the tab holds. | 63 // saved state that the tab holds. |
| 64 void Update(const TabContents* tab_for_state_restoring); | 64 void Update(const TabContents* tab_for_state_restoring); |
| 65 | 65 |
| 66 void SetProfile(Profile* profile); | 66 void SetProfile(Profile* profile); |
| 67 Profile* profile() { return profile_; } | 67 Profile* profile() { return profile_; } |
| 68 | 68 |
| 69 // Sizing functions | 69 // Sizing functions |
| 70 virtual void GetPreferredSize(CSize *out); | 70 virtual gfx::Size GetPreferredSize(); |
| 71 | 71 |
| 72 // Layout and Painting functions | 72 // Layout and Painting functions |
| 73 virtual void DidChangeBounds(const CRect& previous, const CRect& current); | 73 virtual void DidChangeBounds(const CRect& previous, const CRect& current); |
| 74 virtual void Layout(); | 74 virtual void Layout(); |
| 75 virtual void Paint(ChromeCanvas* canvas); | 75 virtual void Paint(ChromeCanvas* canvas); |
| 76 | 76 |
| 77 // No focus border for the location bar, the caret is enough. | 77 // No focus border for the location bar, the caret is enough. |
| 78 virtual void PaintFocusBorder(ChromeCanvas* canvas) { } | 78 virtual void PaintFocusBorder(ChromeCanvas* canvas) { } |
| 79 | 79 |
| 80 // Overridden from View so we can use <tab> to go into keyword search mode. | 80 // Overridden from View so we can use <tab> to go into keyword search mode. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // to display the complete description. | 146 // to display the complete description. |
| 147 class SelectedKeywordView : public ChromeViews::View { | 147 class SelectedKeywordView : public ChromeViews::View { |
| 148 public: | 148 public: |
| 149 explicit SelectedKeywordView(Profile* profile); | 149 explicit SelectedKeywordView(Profile* profile); |
| 150 virtual ~SelectedKeywordView(); | 150 virtual ~SelectedKeywordView(); |
| 151 | 151 |
| 152 void SetFont(const ChromeFont& font); | 152 void SetFont(const ChromeFont& font); |
| 153 | 153 |
| 154 virtual void Paint(ChromeCanvas* canvas); | 154 virtual void Paint(ChromeCanvas* canvas); |
| 155 | 155 |
| 156 virtual void GetPreferredSize(CSize* out); | 156 virtual gfx::Size GetPreferredSize(); |
| 157 virtual void GetMinimumSize(CSize* out); | 157 virtual gfx::Size GetMinimumSize(); |
| 158 virtual void DidChangeBounds(const CRect& previous, const CRect& current); | 158 virtual void DidChangeBounds(const CRect& previous, const CRect& current); |
| 159 virtual void Layout(); | 159 virtual void Layout(); |
| 160 | 160 |
| 161 // The current keyword, or an empty string if no keyword is displayed. | 161 // The current keyword, or an empty string if no keyword is displayed. |
| 162 void SetKeyword(const std::wstring& keyword); | 162 void SetKeyword(const std::wstring& keyword); |
| 163 std::wstring keyword() const { return keyword_; } | 163 std::wstring keyword() const { return keyword_; } |
| 164 | 164 |
| 165 void set_profile(Profile* profile) { profile_ = profile; } | 165 void set_profile(Profile* profile) { profile_ = profile; } |
| 166 | 166 |
| 167 private: | 167 private: |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 virtual ~KeywordHintView(); | 201 virtual ~KeywordHintView(); |
| 202 | 202 |
| 203 void SetFont(const ChromeFont& font); | 203 void SetFont(const ChromeFont& font); |
| 204 | 204 |
| 205 void SetColor(const SkColor& color); | 205 void SetColor(const SkColor& color); |
| 206 | 206 |
| 207 void SetKeyword(const std::wstring& keyword); | 207 void SetKeyword(const std::wstring& keyword); |
| 208 std::wstring keyword() const { return keyword_; } | 208 std::wstring keyword() const { return keyword_; } |
| 209 | 209 |
| 210 virtual void Paint(ChromeCanvas* canvas); | 210 virtual void Paint(ChromeCanvas* canvas); |
| 211 virtual void GetPreferredSize(CSize* out); | 211 virtual gfx::Size GetPreferredSize(); |
| 212 // The minimum size is just big enough to show the tab. | 212 // The minimum size is just big enough to show the tab. |
| 213 virtual void GetMinimumSize(CSize* out); | 213 virtual gfx::Size GetMinimumSize(); |
| 214 virtual void Layout(); | 214 virtual void Layout(); |
| 215 void DidChangeBounds(const CRect& previous, const CRect& current); | 215 void DidChangeBounds(const CRect& previous, const CRect& current); |
| 216 | 216 |
| 217 void set_profile(Profile* profile) { profile_ = profile; } | 217 void set_profile(Profile* profile) { profile_ = profile; } |
| 218 | 218 |
| 219 private: | 219 private: |
| 220 ChromeViews::Label leading_label_; | 220 ChromeViews::Label leading_label_; |
| 221 ChromeViews::Label trailing_label_; | 221 ChromeViews::Label trailing_label_; |
| 222 | 222 |
| 223 // The keyword. | 223 // The keyword. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 // When true, the location bar view is read only and also is has a slightly | 391 // When true, the location bar view is read only and also is has a slightly |
| 392 // different presentation (font size / color). This is used for popups. | 392 // different presentation (font size / color). This is used for popups. |
| 393 bool popup_window_mode_; | 393 bool popup_window_mode_; |
| 394 | 394 |
| 395 // Used schedule a task for the first run info bubble. | 395 // Used schedule a task for the first run info bubble. |
| 396 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; | 396 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; |
| 397 }; | 397 }; |
| 398 | 398 |
| 399 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H__ | 399 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H__ |
| 400 | 400 |
| OLD | NEW |