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

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

Issue 10907038: alternate ntp: clip middle omnibox when resizing browser window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-implement fix Created 8 years, 3 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
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"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // Animates to the specified position. 42 // Animates to the specified position.
43 void AnimateTo(const gfx::Rect& bounds); 43 void AnimateTo(const gfx::Rect& bounds);
44 44
45 // Returns true if animating. 45 // Returns true if animating.
46 bool IsAnimating() const; 46 bool IsAnimating() const;
47 47
48 // Returns the target bounds if animating, or the actual bounds if not 48 // Returns the target bounds if animating, or the actual bounds if not
49 // animating. 49 // animating.
50 gfx::Rect GetTargetBounds(); 50 gfx::Rect GetTargetBounds();
51 51
52 // Set bounds for container and its child |location_bar_view_|.
53 // |location_bar_view_| is always at coordinates 0,0 of container, so only its
54 // size is required.
55 // If the |location_bar_container| is not contained within the parent
56 // BrowserView, it'll be smaller than child |location_bar_view_| and clip it.
57 void SetBoundsForContainerAndView(
58 const gfx::Rect& location_bar_container_bounds,
59 const gfx::Size& location_bar_view_size);
60
52 // views::View overrides: 61 // views::View overrides:
53 virtual std::string GetClassName() const OVERRIDE; 62 virtual std::string GetClassName() const OVERRIDE;
54 virtual gfx::Size GetPreferredSize() OVERRIDE; 63 virtual gfx::Size GetPreferredSize() OVERRIDE;
64 virtual void Layout() OVERRIDE;
55 virtual bool SkipDefaultKeyEventProcessing( 65 virtual bool SkipDefaultKeyEventProcessing(
56 const ui::KeyEvent& event) OVERRIDE; 66 const ui::KeyEvent& event) OVERRIDE;
57 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 67 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
58 68
59 // views::BoundsAnimatorObserver overrides: 69 // views::BoundsAnimatorObserver overrides:
60 virtual void OnBoundsAnimatorProgressed( 70 virtual void OnBoundsAnimatorProgressed(
61 views::BoundsAnimator* animator) OVERRIDE {} 71 views::BoundsAnimator* animator) OVERRIDE {}
62 virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) OVERRIDE; 72 virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) OVERRIDE;
63 73
64 protected: 74 protected:
(...skipping 10 matching lines...) Expand all
75 static int GetAnimationDuration(); 85 static int GetAnimationDuration();
76 86
77 // Used to animate this view. 87 // Used to animate this view.
78 views::BoundsAnimator animator_; 88 views::BoundsAnimator animator_;
79 89
80 // Parent the LocationBarView is added to. 90 // Parent the LocationBarView is added to.
81 views::View* view_parent_; 91 views::View* view_parent_;
82 92
83 LocationBarView* location_bar_view_; 93 LocationBarView* location_bar_view_;
84 94
95 // Remember the size of |location_bar_view_| set via
96 // |SetBoundsForContainerAndView|.
97 gfx::Size location_bar_view_size_;
98
85 views::NativeViewHost* native_view_host_; 99 views::NativeViewHost* native_view_host_;
86 100
87 bool in_toolbar_; 101 bool in_toolbar_;
88 102
89 bool instant_extended_api_enabled_; 103 bool instant_extended_api_enabled_;
90 104
91 DISALLOW_COPY_AND_ASSIGN(LocationBarContainer); 105 DISALLOW_COPY_AND_ASSIGN(LocationBarContainer);
92 }; 106 };
93 107
94 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_CONTAINER_H_ 108 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_CONTAINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698