Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_container.h

Issue 10630013: Adds LocationBarContainer that contains (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove set_view_to_focus Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_CONTAINER_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_CONTAINER_H_
7
8 #include "third_party/skia/include/core/SkColor.h"
9 #include "ui/views/view.h"
10 #include "ui/views/animation/bounds_animator.h"
11 #include "ui/views/animation/bounds_animator_observer.h"
12
13 class LocationBarView;
14
15 namespace views {
16 class NativeViewHost;
17 }
18
19 // LocationBarContainer contains the LocationBarView. Under aura it directly
20 // contains the LocationBarView, on windows an intermediary widget is used. The
21 // intermediary widget is used so that LocationBarContainer can be placed on top
22 // of other native views (such as web content).
23 // LocationBarContainer is positioned by ToolbarView, but it is a child of
24 // BrowserView. This is used when on the NTP.
25 class LocationBarContainer : public views::View,
26 public views::BoundsAnimatorObserver {
27 public:
28 // Creates a new LocationBarContainer as a child of |parent|.
29 explicit LocationBarContainer(views::View* parent);
30 virtual ~LocationBarContainer();
31
32 void SetLocationBarView(LocationBarView* view);
33
34 // Stacks this view at the top. More specifically stacks the layer (aura)
35 // or widget (windows) at the top of the stack. Used to ensure this is over
36 // web contents.
37 void StackAtTop();
38
39 // Animates to the specified position.
40 void AnimateTo(const gfx::Rect& bounds);
41
42 // Returns true if animating.
43 bool IsAnimating() const;
44
45 // Returns the target bounds if animating, or the actual bounds if not
46 // animating.
47 gfx::Rect GetTargetBounds();
48
49 // views::View overrides:
50 virtual gfx::Size GetPreferredSize() OVERRIDE;
51 virtual bool SkipDefaultKeyEventProcessing(
52 const views::KeyEvent& event) OVERRIDE;
53 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
54
55 // views::BoundsAnimator overrides:
56 virtual void OnBoundsAnimatorProgressed(
57 views::BoundsAnimator* animator) OVERRIDE {}
58 virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) OVERRIDE;
59
60 protected:
61 virtual void OnFocus() OVERRIDE;
62
63 private:
64 // Sets up platform specific state.
65 void PlatformInit();
66
67 // Returns the background color.
68 static SkColor GetBackgroundColor();
69
70 // Used to animate this view.
71 views::BoundsAnimator animator_;
72
73 // Parent the LocationBarView is added to.
74 views::View* view_parent_;
75
76 LocationBarView* location_bar_view_;
77
78 views::NativeViewHost* native_view_host_;
79
80 DISALLOW_COPY_AND_ASSIGN(LocationBarContainer);
81 };
82
83 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_CONTAINER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/location_bar/location_bar_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698