Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_LOCATION_BAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 // The LocationBarView class is a View subclass that paints the background | 52 // The LocationBarView class is a View subclass that paints the background |
| 53 // of the URL bar strip and contains its content. | 53 // of the URL bar strip and contains its content. |
| 54 // | 54 // |
| 55 ///////////////////////////////////////////////////////////////////////////// | 55 ///////////////////////////////////////////////////////////////////////////// |
| 56 class LocationBarView : public LocationBar, | 56 class LocationBarView : public LocationBar, |
| 57 public LocationBarTesting, | 57 public LocationBarTesting, |
| 58 public views::View, | 58 public views::View, |
| 59 public views::DragController, | 59 public views::DragController, |
| 60 public AutocompleteEditController { | 60 public AutocompleteEditController { |
| 61 public: | 61 public: |
| 62 // The location bar view's class name. | |
| 63 static const char kViewClassName[]; | |
| 64 | |
| 62 class Delegate { | 65 class Delegate { |
| 63 public: | 66 public: |
| 64 // Should return the current tab contents. | 67 // Should return the current tab contents. |
| 65 virtual TabContents* GetTabContents() = 0; | 68 virtual TabContents* GetTabContents() = 0; |
| 66 | 69 |
| 67 // Called by the location bar view when the user starts typing in the edit. | 70 // Called by the location bar view when the user starts typing in the edit. |
| 68 // This forces our security style to be UNKNOWN for the duration of the | 71 // This forces our security style to be UNKNOWN for the duration of the |
| 69 // editing. | 72 // editing. |
| 70 virtual void OnInputInProgress(bool in_progress) = 0; | 73 virtual void OnInputInProgress(bool in_progress) = 0; |
| 71 }; | 74 }; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 virtual void Layout(); | 146 virtual void Layout(); |
| 144 virtual void Paint(gfx::Canvas* canvas); | 147 virtual void Paint(gfx::Canvas* canvas); |
| 145 | 148 |
| 146 // No focus border for the location bar, the caret is enough. | 149 // No focus border for the location bar, the caret is enough. |
| 147 virtual void PaintFocusBorder(gfx::Canvas* canvas) { } | 150 virtual void PaintFocusBorder(gfx::Canvas* canvas) { } |
| 148 | 151 |
| 149 // Called when any ancestor changes its size, asks the AutocompleteEditModel | 152 // Called when any ancestor changes its size, asks the AutocompleteEditModel |
| 150 // to close its popup. | 153 // to close its popup. |
| 151 virtual void VisibleBoundsInRootChanged(); | 154 virtual void VisibleBoundsInRootChanged(); |
| 152 | 155 |
| 156 // Set if we should show a focus rect while the location entry field is | |
| 157 // focused. Used when the toolbar is in full keyboard accessibility mode. | |
| 158 void set_show_focus_rect(bool show) { | |
|
sky
2010/06/21 20:55:32
Since you've got a SchedulePaint in here, it's no
| |
| 159 show_focus_rect_ = show; | |
| 160 SchedulePaint(); | |
| 161 } | |
| 162 | |
| 153 #if defined(OS_WIN) | 163 #if defined(OS_WIN) |
| 154 // Event Handlers | 164 // Event Handlers |
| 155 virtual bool OnMousePressed(const views::MouseEvent& event); | 165 virtual bool OnMousePressed(const views::MouseEvent& event); |
| 156 virtual bool OnMouseDragged(const views::MouseEvent& event); | 166 virtual bool OnMouseDragged(const views::MouseEvent& event); |
| 157 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); | 167 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); |
| 158 #endif | 168 #endif |
| 159 | 169 |
| 160 // AutocompleteEditController | 170 // AutocompleteEditController |
| 161 virtual void OnAutocompleteAccept(const GURL& url, | 171 virtual void OnAutocompleteAccept(const GURL& url, |
| 162 WindowOpenDisposition disposition, | 172 WindowOpenDisposition disposition, |
| 163 PageTransition::Type transition, | 173 PageTransition::Type transition, |
| 164 const GURL& alternate_nav_url); | 174 const GURL& alternate_nav_url); |
| 165 virtual void OnChanged(); | 175 virtual void OnChanged(); |
| 166 virtual void OnInputInProgress(bool in_progress); | 176 virtual void OnInputInProgress(bool in_progress); |
| 167 virtual void OnKillFocus(); | 177 virtual void OnKillFocus(); |
| 168 virtual void OnSetFocus(); | 178 virtual void OnSetFocus(); |
| 169 virtual SkBitmap GetFavIcon() const; | 179 virtual SkBitmap GetFavIcon() const; |
| 170 virtual std::wstring GetTitle() const; | 180 virtual std::wstring GetTitle() const; |
| 171 | 181 |
| 172 // Overridden from views::View: | 182 // Overridden from views::View: |
| 183 virtual std::string GetClassName() const; | |
| 173 virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e); | 184 virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e); |
| 174 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); | 185 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); |
| 175 | 186 |
| 176 // Overridden from views::DragController: | 187 // Overridden from views::DragController: |
| 177 virtual void WriteDragData(View* sender, | 188 virtual void WriteDragData(View* sender, |
| 178 const gfx::Point& press_pt, | 189 const gfx::Point& press_pt, |
| 179 OSExchangeData* data); | 190 OSExchangeData* data); |
| 180 virtual int GetDragOperations(View* sender, const gfx::Point& p); | 191 virtual int GetDragOperations(View* sender, const gfx::Point& p); |
| 181 virtual bool CanStartDrag(View* sender, | 192 virtual bool CanStartDrag(View* sender, |
| 182 const gfx::Point& press_pt, | 193 const gfx::Point& press_pt, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 // The star. | 347 // The star. |
| 337 StarView* star_view_; | 348 StarView* star_view_; |
| 338 | 349 |
| 339 // The mode that dictates how the bar shows. | 350 // The mode that dictates how the bar shows. |
| 340 Mode mode_; | 351 Mode mode_; |
| 341 | 352 |
| 342 // Counts the number of times consumers have asked us to be hidden. | 353 // Counts the number of times consumers have asked us to be hidden. |
| 343 // We should actually be hidden iff this is greater than zero. | 354 // We should actually be hidden iff this is greater than zero. |
| 344 int force_hidden_count_; | 355 int force_hidden_count_; |
| 345 | 356 |
| 357 // True if we should show a focus rect while the location entry field is | |
| 358 // focused. Used when the toolbar is in full keyboard accessibility mode. | |
| 359 bool show_focus_rect_; | |
| 360 | |
| 346 // Used schedule a task for the first run info bubble. | 361 // Used schedule a task for the first run info bubble. |
| 347 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; | 362 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; |
| 348 | 363 |
| 349 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); | 364 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); |
| 350 }; | 365 }; |
| 351 | 366 |
| 352 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 367 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |