| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "app/gfx/chrome_font.h" | 11 #include "app/gfx/font.h" |
| 12 #include "base/gfx/rect.h" | 12 #include "base/gfx/rect.h" |
| 13 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 13 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 14 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" | 14 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" |
| 15 #include "chrome/browser/icon_manager.h" | 15 #include "chrome/browser/icon_manager.h" |
| 16 #include "chrome/browser/location_bar.h" | 16 #include "chrome/browser/location_bar.h" |
| 17 #include "chrome/browser/tab_contents/tab_contents.h" | 17 #include "chrome/browser/tab_contents/tab_contents.h" |
| 18 #include "chrome/browser/toolbar_model.h" | 18 #include "chrome/browser/toolbar_model.h" |
| 19 #include "chrome/browser/views/info_bubble.h" | 19 #include "chrome/browser/views/info_bubble.h" |
| 20 #include "views/controls/hwnd_view.h" | 20 #include "views/controls/hwnd_view.h" |
| 21 #include "views/controls/image_view.h" | 21 #include "views/controls/image_view.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void Update(const TabContents* tab_for_state_restoring); | 71 void Update(const TabContents* tab_for_state_restoring); |
| 72 | 72 |
| 73 void SetProfile(Profile* profile); | 73 void SetProfile(Profile* profile); |
| 74 Profile* profile() { return profile_; } | 74 Profile* profile() { return profile_; } |
| 75 | 75 |
| 76 // Sizing functions | 76 // Sizing functions |
| 77 virtual gfx::Size GetPreferredSize(); | 77 virtual gfx::Size GetPreferredSize(); |
| 78 | 78 |
| 79 // Layout and Painting functions | 79 // Layout and Painting functions |
| 80 virtual void Layout(); | 80 virtual void Layout(); |
| 81 virtual void Paint(ChromeCanvas* canvas); | 81 virtual void Paint(gfx::Canvas* canvas); |
| 82 | 82 |
| 83 // No focus border for the location bar, the caret is enough. | 83 // No focus border for the location bar, the caret is enough. |
| 84 virtual void PaintFocusBorder(ChromeCanvas* canvas) { } | 84 virtual void PaintFocusBorder(gfx::Canvas* canvas) { } |
| 85 | 85 |
| 86 // Called when any ancestor changes its size, asks the AutocompleteEditModel | 86 // Called when any ancestor changes its size, asks the AutocompleteEditModel |
| 87 // to close its popup. | 87 // to close its popup. |
| 88 virtual void VisibleBoundsInRootChanged(); | 88 virtual void VisibleBoundsInRootChanged(); |
| 89 | 89 |
| 90 // Event Handlers | 90 // Event Handlers |
| 91 virtual bool OnMousePressed(const views::MouseEvent& event); | 91 virtual bool OnMousePressed(const views::MouseEvent& event); |
| 92 virtual bool OnMouseDragged(const views::MouseEvent& event); | 92 virtual bool OnMouseDragged(const views::MouseEvent& event); |
| 93 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); | 93 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); |
| 94 | 94 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // complete description of the keyword, the second contains a truncated | 142 // complete description of the keyword, the second contains a truncated |
| 143 // version of the description. The second is used if there is not enough room | 143 // version of the description. The second is used if there is not enough room |
| 144 // to display the complete description. | 144 // to display the complete description. |
| 145 class SelectedKeywordView : public views::View { | 145 class SelectedKeywordView : public views::View { |
| 146 public: | 146 public: |
| 147 explicit SelectedKeywordView(Profile* profile); | 147 explicit SelectedKeywordView(Profile* profile); |
| 148 virtual ~SelectedKeywordView(); | 148 virtual ~SelectedKeywordView(); |
| 149 | 149 |
| 150 void SetFont(const gfx::Font& font); | 150 void SetFont(const gfx::Font& font); |
| 151 | 151 |
| 152 virtual void Paint(ChromeCanvas* canvas); | 152 virtual void Paint(gfx::Canvas* canvas); |
| 153 | 153 |
| 154 virtual gfx::Size GetPreferredSize(); | 154 virtual gfx::Size GetPreferredSize(); |
| 155 virtual gfx::Size GetMinimumSize(); | 155 virtual gfx::Size GetMinimumSize(); |
| 156 virtual void Layout(); | 156 virtual void Layout(); |
| 157 | 157 |
| 158 // The current keyword, or an empty string if no keyword is displayed. | 158 // The current keyword, or an empty string if no keyword is displayed. |
| 159 void SetKeyword(const std::wstring& keyword); | 159 void SetKeyword(const std::wstring& keyword); |
| 160 std::wstring keyword() const { return keyword_; } | 160 std::wstring keyword() const { return keyword_; } |
| 161 | 161 |
| 162 void set_profile(Profile* profile) { profile_ = profile; } | 162 void set_profile(Profile* profile) { profile_ = profile; } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 explicit KeywordHintView(Profile* profile); | 197 explicit KeywordHintView(Profile* profile); |
| 198 virtual ~KeywordHintView(); | 198 virtual ~KeywordHintView(); |
| 199 | 199 |
| 200 void SetFont(const gfx::Font& font); | 200 void SetFont(const gfx::Font& font); |
| 201 | 201 |
| 202 void SetColor(const SkColor& color); | 202 void SetColor(const SkColor& color); |
| 203 | 203 |
| 204 void SetKeyword(const std::wstring& keyword); | 204 void SetKeyword(const std::wstring& keyword); |
| 205 std::wstring keyword() const { return keyword_; } | 205 std::wstring keyword() const { return keyword_; } |
| 206 | 206 |
| 207 virtual void Paint(ChromeCanvas* canvas); | 207 virtual void Paint(gfx::Canvas* canvas); |
| 208 virtual gfx::Size GetPreferredSize(); | 208 virtual gfx::Size GetPreferredSize(); |
| 209 // The minimum size is just big enough to show the tab. | 209 // The minimum size is just big enough to show the tab. |
| 210 virtual gfx::Size GetMinimumSize(); | 210 virtual gfx::Size GetMinimumSize(); |
| 211 virtual void Layout(); | 211 virtual void Layout(); |
| 212 | 212 |
| 213 void set_profile(Profile* profile) { profile_ = profile; } | 213 void set_profile(Profile* profile) { profile_ = profile; } |
| 214 | 214 |
| 215 private: | 215 private: |
| 216 views::Label leading_label_; | 216 views::Label leading_label_; |
| 217 views::Label trailing_label_; | 217 views::Label trailing_label_; |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 bool popup_window_mode_; | 477 bool popup_window_mode_; |
| 478 | 478 |
| 479 // Used schedule a task for the first run info bubble. | 479 // Used schedule a task for the first run info bubble. |
| 480 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; | 480 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; |
| 481 | 481 |
| 482 // The positioner that places the autocomplete popup. | 482 // The positioner that places the autocomplete popup. |
| 483 AutocompletePopupPositioner* popup_positioner_; | 483 AutocompletePopupPositioner* popup_positioner_; |
| 484 }; | 484 }; |
| 485 | 485 |
| 486 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ | 486 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |