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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/location_bar/location_bar_container.h
diff --git a/chrome/browser/ui/views/location_bar/location_bar_container.h b/chrome/browser/ui/views/location_bar/location_bar_container.h
index ae25cb069237fdfd37dfe3d28e4eed63e5796247..1459e01725a456759ce32002e8ba633177f63d91 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_container.h
+++ b/chrome/browser/ui/views/location_bar/location_bar_container.h
@@ -49,9 +49,19 @@ class LocationBarContainer : public views::View,
// animating.
gfx::Rect GetTargetBounds();
+ // Set bounds for container and its child |location_bar_view_|.
+ // |location_bar_view_| is always at coordinates 0,0 of container, so only its
+ // size is required.
+ // If the |location_bar_container| is not contained within the parent
+ // BrowserView, it'll be smaller than child |location_bar_view_| and clip it.
+ void SetBoundsForContainerAndView(
+ const gfx::Rect& location_bar_container_bounds,
+ const gfx::Size& location_bar_view_size);
+
// views::View overrides:
virtual std::string GetClassName() const OVERRIDE;
virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual void Layout() OVERRIDE;
virtual bool SkipDefaultKeyEventProcessing(
const ui::KeyEvent& event) OVERRIDE;
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
@@ -82,6 +92,10 @@ class LocationBarContainer : public views::View,
LocationBarView* location_bar_view_;
+ // Remember the size of |location_bar_view_| set via
+ // |SetBoundsForContainerAndView|.
+ gfx::Size location_bar_view_size_;
+
views::NativeViewHost* native_view_host_;
bool in_toolbar_;

Powered by Google App Engine
This is Rietveld 408576698