| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_CONTAINER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_CONTAINER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_CONTAINER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_CONTAINER_H_ |
| 7 | 7 |
| 8 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
| 9 #include "ui/views/animation/bounds_animator.h" | 9 #include "ui/views/animation/bounds_animator.h" |
| 10 #include "ui/views/animation/bounds_animator_observer.h" | 10 #include "ui/views/animation/bounds_animator_observer.h" |
| 11 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
| 12 | 12 |
| 13 class LocationBarView; | 13 class LocationBarView; |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 class AccessiblePaneView; |
| 17 class FocusTraversable; |
| 16 class NativeViewHost; | 18 class NativeViewHost; |
| 17 } | 19 } |
| 18 | 20 |
| 19 // LocationBarContainer contains the LocationBarView. Under aura it directly | 21 // LocationBarContainer contains the LocationBarView. Under aura it directly |
| 20 // contains the LocationBarView, on windows an intermediary widget is used. The | 22 // contains the LocationBarView, on windows an intermediary widget is used. The |
| 21 // intermediary widget is used so that LocationBarContainer can be placed on top | 23 // intermediary widget is used so that LocationBarContainer can be placed on top |
| 22 // of other native views (such as web content). | 24 // of other native views (such as web content). |
| 23 // LocationBarContainer is positioned by ToolbarView, but it is a child of | 25 // LocationBarContainer is positioned by ToolbarView, but it is a child of |
| 24 // BrowserView. This is used when on the NTP. | 26 // BrowserView. This is used when on the NTP. |
| 25 class LocationBarContainer : public views::View, | 27 class LocationBarContainer : public views::View, |
| 26 public views::BoundsAnimatorObserver { | 28 public views::BoundsAnimatorObserver { |
| 27 public: | 29 public: |
| 28 // Creates a new LocationBarContainer as a child of |parent|. | 30 // Creates a new LocationBarContainer as a child of |parent|, |
| 29 LocationBarContainer(views::View* parent, bool instant_extended_api_enabled); | 31 // with |accessible_pane_view| as the owning view for focus searching. |
| 32 LocationBarContainer(views::View* parent, |
| 33 views::AccessiblePaneView* accessible_pane_view, |
| 34 bool instant_extended_api_enabled); |
| 30 virtual ~LocationBarContainer(); | 35 virtual ~LocationBarContainer(); |
| 31 | 36 |
| 32 // Sets whether the LocationBarContainer is in the toolbar. | 37 // Sets whether the LocationBarContainer is in the toolbar. |
| 33 void SetInToolbar(bool in_toolbar); | 38 void SetInToolbar(bool in_toolbar); |
| 34 | 39 |
| 35 void SetLocationBarView(LocationBarView* view); | 40 void SetLocationBarView(LocationBarView* view); |
| 36 | 41 |
| 37 // Stacks this view at the top. More specifically stacks the layer (aura) | 42 // Stacks this view at the top. More specifically stacks the layer (aura) |
| 38 // or widget (windows) at the top of the stack. Used to ensure this is over | 43 // or widget (windows) at the top of the stack. Used to ensure this is over |
| 39 // web contents. | 44 // web contents. |
| 40 void StackAtTop(); | 45 void StackAtTop(); |
| 41 | 46 |
| 42 // Animates to the specified position. | 47 // Animates to the specified position. |
| 43 void AnimateTo(const gfx::Rect& bounds); | 48 void AnimateTo(const gfx::Rect& bounds); |
| 44 | 49 |
| 45 // Returns true if animating. | 50 // Returns true if animating. |
| 46 bool IsAnimating() const; | 51 bool IsAnimating() const; |
| 47 | 52 |
| 48 // Returns the target bounds if animating, or the actual bounds if not | 53 // Returns the target bounds if animating, or the actual bounds if not |
| 49 // animating. | 54 // animating. |
| 50 gfx::Rect GetTargetBounds(); | 55 gfx::Rect GetTargetBounds(); |
| 51 | 56 |
| 52 // views::View overrides: | 57 // views::View overrides: |
| 53 virtual std::string GetClassName() const OVERRIDE; | 58 virtual std::string GetClassName() const OVERRIDE; |
| 54 virtual gfx::Size GetPreferredSize() OVERRIDE; | 59 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 55 virtual void Layout() OVERRIDE; | 60 virtual void Layout() OVERRIDE; |
| 56 virtual bool SkipDefaultKeyEventProcessing( | 61 virtual bool SkipDefaultKeyEventProcessing( |
| 57 const ui::KeyEvent& event) OVERRIDE; | 62 const ui::KeyEvent& event) OVERRIDE; |
| 58 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 63 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| 64 virtual views::FocusTraversable* GetPaneFocusTraversable() OVERRIDE; |
| 59 | 65 |
| 60 // views::BoundsAnimatorObserver overrides: | 66 // views::BoundsAnimatorObserver overrides: |
| 61 virtual void OnBoundsAnimatorProgressed( | 67 virtual void OnBoundsAnimatorProgressed( |
| 62 views::BoundsAnimator* animator) OVERRIDE {} | 68 views::BoundsAnimator* animator) OVERRIDE {} |
| 63 virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) OVERRIDE; | 69 virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) OVERRIDE; |
| 64 | 70 |
| 65 protected: | 71 protected: |
| 66 virtual void OnFocus() OVERRIDE; | 72 virtual void OnFocus() OVERRIDE; |
| 67 | 73 |
| 68 private: | 74 private: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 80 | 86 |
| 81 // Parent the LocationBarView is added to. | 87 // Parent the LocationBarView is added to. |
| 82 views::View* view_parent_; | 88 views::View* view_parent_; |
| 83 | 89 |
| 84 LocationBarView* location_bar_view_; | 90 LocationBarView* location_bar_view_; |
| 85 | 91 |
| 86 views::NativeViewHost* native_view_host_; | 92 views::NativeViewHost* native_view_host_; |
| 87 | 93 |
| 88 bool in_toolbar_; | 94 bool in_toolbar_; |
| 89 | 95 |
| 96 views::AccessiblePaneView* accessible_pane_view_; |
| 97 |
| 90 bool instant_extended_api_enabled_; | 98 bool instant_extended_api_enabled_; |
| 91 | 99 |
| 92 DISALLOW_COPY_AND_ASSIGN(LocationBarContainer); | 100 DISALLOW_COPY_AND_ASSIGN(LocationBarContainer); |
| 93 }; | 101 }; |
| 94 | 102 |
| 95 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_CONTAINER_H_ | 103 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_CONTAINER_H_ |
| OLD | NEW |