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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_container.cc

Issue 10907038: alternate ntp: clip middle omnibox when resizing browser window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed scott's comments 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.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_container.cc b/chrome/browser/ui/views/location_bar/location_bar_container.cc
index f66f46456c04f38af326f20ee3bcbf59ff318890..19a0894c8b08c1e97e0e0d11d395f50c28fc8c55 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_container.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_container.cc
@@ -8,7 +8,6 @@
#include "chrome/browser/ui/webui/instant_ui.h"
#include "ui/base/events/event.h"
#include "ui/views/background.h"
-#include "ui/views/layout/fill_layout.h"
namespace {
@@ -32,7 +31,6 @@ LocationBarContainer::LocationBarContainer(views::View* parent,
view_parent_->set_background(
views::Background::CreateSolidBackground(GetBackgroundColor()));
}
- SetLayoutManager(new views::FillLayout);
}
LocationBarContainer::~LocationBarContainer() {
@@ -67,6 +65,14 @@ gfx::Size LocationBarContainer::GetPreferredSize() {
return location_bar_view_->GetPreferredSize();
}
+void LocationBarContainer::Layout() {
+ // |location_bar_view_| fills the entire width of the container, but retains
+ // its preferred height, so that it's not resized which, if shrunk, will
+ // squish the placeholder text within a smaller vertical space.
+ location_bar_view_->SetBounds(0, 0, bounds().width(),
+ location_bar_view_->GetPreferredSize().height());
+}
+
bool LocationBarContainer::SkipDefaultKeyEventProcessing(
const ui::KeyEvent& event) {
return location_bar_view_->SkipDefaultKeyEventProcessing(event);

Powered by Google App Engine
This is Rietveld 408576698