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

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

Issue 1234593002: Changed omnibox rendering to use a single asset. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed baseline. Created 5 years, 5 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index ede1d761ed54513840d4a84c86fb6dc2fb0f6608..a9a6f2b6ed46f9b60389bbea8b09ea292c8f190f 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -178,11 +178,7 @@ void LocationBarView::Init() {
// not prepared for that.
DCHECK(GetWidget());
- const int kOmniboxPopupBorderImages[] =
- IMAGE_GRID(IDR_OMNIBOX_POPUP_BORDER_AND_SHADOW);
- const int kOmniboxBorderImages[] = IMAGE_GRID(IDR_TEXTFIELD);
- border_painter_.reset(views::Painter::CreateImageGridPainter(
- is_popup_mode_ ? kOmniboxPopupBorderImages : kOmniboxBorderImages));
+ CreateBorderPainter();
Peter Kasting 2015/07/10 15:57:09 Just leave your new code inlined here instead of c
bruthig 2015/07/10 17:04:09 Done.
location_icon_view_ = new LocationIconView(this);
location_icon_view_->set_drag_controller(this);
@@ -836,6 +832,20 @@ int LocationBarView::IncrementalMinimumWidth(views::View* view) {
return view->visible() ? (kItemPadding + view->GetMinimumSize().width()) : 0;
}
+void LocationBarView::CreateBorderPainter() {
+ if (is_popup_mode_) {
+ const int kOmniboxPopupBorderImages[] =
+ IMAGE_GRID(IDR_OMNIBOX_POPUP_BORDER_AND_SHADOW);
+ border_painter_.reset(
+ views::Painter::CreateImageGridPainter(kOmniboxPopupBorderImages));
+ } else {
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ const gfx::Insets omnibox_border_insets(14, 9, 14, 9);
+ border_painter_.reset(views::Painter::CreateImagePainter(
+ *rb.GetImageSkiaNamed(IDR_OMNIBOX_BORDER), omnibox_border_insets));
+ }
+}
+
int LocationBarView::GetHorizontalEdgeThickness() const {
// In maximized popup mode, there isn't any edge.
return (is_popup_mode_ && browser_ && browser_->window() &&
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698