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

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

Issue 18862: Extend the popup-mode location bar out into the nonclient view. This makes p... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 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/views/frame/opaque_non_client_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/location_bar_view.cc
===================================================================
--- chrome/browser/views/location_bar_view.cc (revision 8725)
+++ chrome/browser/views/location_bar_view.cc (working copy)
@@ -53,11 +53,8 @@
static const SkBitmap* kBackground = NULL;
-static const SkBitmap* kPopupBackgroundLeft = NULL;
-static const SkBitmap* kPopupBackgroundCenter = NULL;
-static const SkBitmap* kPopupBackgroundRight = NULL;
+static const SkBitmap* kPopupBackground = NULL;
static const int kPopupBackgroundVertMargin = 2;
-static const int kPopupBackgroundHorzMargin = 2;
// The delay the mouse has to be hovering over the lock/warning icon before the
// info bubble is shown.
@@ -101,12 +98,7 @@
if (!kBackground) {
ResourceBundle &rb = ResourceBundle::GetSharedInstance();
kBackground = rb.GetBitmapNamed(IDR_LOCATIONBG);
- kPopupBackgroundLeft =
- rb.GetBitmapNamed(IDR_LOCATIONBG_POPUPMODE_LEFT);
- kPopupBackgroundCenter =
- rb.GetBitmapNamed(IDR_LOCATIONBG_POPUPMODE_CENTER);
- kPopupBackgroundRight =
- rb.GetBitmapNamed(IDR_LOCATIONBG_POPUPMODE_RIGHT);
+ kPopupBackground = rb.GetBitmapNamed(IDR_LOCATIONBG_POPUPMODE_CENTER);
}
}
@@ -205,12 +197,9 @@
}
gfx::Size LocationBarView::GetPreferredSize() {
- return gfx::Size(
- 0,
- std::max(
- (popup_window_mode_ ? kPopupBackgroundCenter
- : kBackground)->height(),
- security_image_view_.GetPreferredSize().width()));
+ return gfx::Size(0,
+ std::max((popup_window_mode_ ? kPopupBackground : kBackground)->height(),
+ security_image_view_.GetPreferredSize().height()));
}
void LocationBarView::Layout() {
@@ -225,35 +214,18 @@
GetGValue(kBackgroundColorByLevel[model_->GetSchemeSecurityLevel()]),
GetBValue(kBackgroundColorByLevel[model_->GetSchemeSecurityLevel()]));
- if (popup_window_mode_ == false) {
+ if (popup_window_mode_) {
+ canvas->TileImageInt(*kPopupBackground, 0, 0, width(),
+ kPopupBackground->height());
+ canvas->FillRectInt(bg, 0, kPopupBackgroundVertMargin, width(),
+ kPopupBackground->height() - (kPopupBackgroundVertMargin * 2));
+ } else {
int bh = kBackground->height();
-
canvas->TileImageInt(*kBackground, 0, (height() - bh) / 2, width(),
bh);
-
canvas->FillRectInt(bg, kBackgroundHoriMargin, kBackgroundVertMargin,
width() - 2 * kBackgroundHoriMargin,
bh - kBackgroundVertMargin * 2);
- } else {
- canvas->TileImageInt(*kPopupBackgroundLeft, 0, 0,
- kPopupBackgroundLeft->width(),
- kPopupBackgroundLeft->height());
- canvas->TileImageInt(*kPopupBackgroundCenter,
- kPopupBackgroundLeft->width(), 0,
- width() -
- kPopupBackgroundLeft->width() -
- kPopupBackgroundRight->width(),
- kPopupBackgroundCenter->height());
- canvas->TileImageInt(*kPopupBackgroundRight,
- width() - kPopupBackgroundRight->width(),
- 0, kPopupBackgroundRight->width(),
- kPopupBackgroundRight->height());
-
- canvas->FillRectInt(bg, kPopupBackgroundHorzMargin,
- kPopupBackgroundVertMargin,
- width() - kPopupBackgroundHorzMargin * 2,
- kPopupBackgroundCenter->height() -
- kPopupBackgroundVertMargin * 2);
}
}
@@ -392,8 +364,8 @@
return;
// TODO(sky): baseline layout.
- const SkBitmap* background = popup_window_mode_ ? kPopupBackgroundCenter
- : kBackground;
+ const SkBitmap* background =
+ popup_window_mode_ ? kPopupBackground : kBackground;
int bh = background->height();
int location_y = ((height() - bh) / 2) + kTextVertMargin;
int location_height = bh - (2 * kTextVertMargin);
« no previous file with comments | « chrome/browser/views/frame/opaque_non_client_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698