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

Unified Diff: chrome/browser/views/frame/opaque_non_client_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/app/theme/locationbg_readonly_right.png ('k') | chrome/browser/views/location_bar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/opaque_non_client_view.cc
===================================================================
--- chrome/browser/views/frame/opaque_non_client_view.cc (revision 8726)
+++ chrome/browser/views/frame/opaque_non_client_view.cc (working copy)
@@ -63,6 +63,10 @@
FRAME_CLIENT_EDGE_BOTTOM_LEFT,
FRAME_CLIENT_EDGE_LEFT,
+ // Popup-mode toolbar edges.
+ FRAME_TOOLBAR_POPUP_EDGE_LEFT,
+ FRAME_TOOLBAR_POPUP_EDGE_RIGHT,
+
FRAME_PART_BITMAP_COUNT // Must be last.
};
@@ -98,6 +102,7 @@
IDR_CONTENT_TOP_RIGHT_CORNER, IDR_CONTENT_RIGHT_SIDE,
IDR_CONTENT_BOTTOM_RIGHT_CORNER, IDR_CONTENT_BOTTOM_CENTER,
IDR_CONTENT_BOTTOM_LEFT_CORNER, IDR_CONTENT_LEFT_SIDE,
+ IDR_LOCATIONBG_POPUPMODE_LEFT, IDR_LOCATIONBG_POPUPMODE_RIGHT,
0
};
@@ -149,6 +154,7 @@
IDR_CONTENT_TOP_RIGHT_CORNER, IDR_CONTENT_RIGHT_SIDE,
IDR_CONTENT_BOTTOM_RIGHT_CORNER, IDR_CONTENT_BOTTOM_CENTER,
IDR_CONTENT_BOTTOM_LEFT_CORNER, IDR_CONTENT_LEFT_SIDE,
+ IDR_LOCATIONBG_POPUPMODE_LEFT, IDR_LOCATIONBG_POPUPMODE_RIGHT,
0
};
@@ -200,6 +206,7 @@
IDR_CONTENT_TOP_RIGHT_CORNER, IDR_CONTENT_RIGHT_SIDE,
IDR_CONTENT_BOTTOM_RIGHT_CORNER, IDR_CONTENT_BOTTOM_CENTER,
IDR_CONTENT_BOTTOM_LEFT_CORNER, IDR_CONTENT_LEFT_SIDE,
+ IDR_LOCATIONBG_POPUPMODE_LEFT, IDR_LOCATIONBG_POPUPMODE_RIGHT,
0
};
@@ -251,6 +258,7 @@
IDR_CONTENT_TOP_RIGHT_CORNER, IDR_CONTENT_RIGHT_SIDE,
IDR_CONTENT_BOTTOM_RIGHT_CORNER, IDR_CONTENT_BOTTOM_CENTER,
IDR_CONTENT_BOTTOM_LEFT_CORNER, IDR_CONTENT_LEFT_SIDE,
+ IDR_LOCATIONBG_POPUPMODE_LEFT, IDR_LOCATIONBG_POPUPMODE_RIGHT,
0
};
@@ -861,28 +869,30 @@
}
void OpaqueNonClientView::PaintToolbarBackground(ChromeCanvas* canvas) {
- if (!browser_view_->IsToolbarVisible() ||
- !browser_view_->IsToolbarDisplayModeNormal())
+ if (!browser_view_->IsToolbarVisible())
return;
-
+
gfx::Rect toolbar_bounds(browser_view_->GetToolbarBounds());
gfx::Point toolbar_origin(toolbar_bounds.origin());
View::ConvertPointToView(frame_->client_view(), this, &toolbar_origin);
toolbar_bounds.set_origin(toolbar_origin);
- SkBitmap* toolbar_left =
- resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_LEFT);
+ bool normal_mode = browser_view_->IsToolbarDisplayModeNormal();
+ SkBitmap* toolbar_left = resources()->GetPartBitmap(normal_mode ?
+ FRAME_CLIENT_EDGE_TOP_LEFT : FRAME_TOOLBAR_POPUP_EDGE_LEFT);
canvas->DrawBitmapInt(*toolbar_left,
toolbar_bounds.x() - toolbar_left->width(),
toolbar_bounds.y());
- SkBitmap* toolbar_center =
- resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP);
- canvas->TileImageInt(*toolbar_center, toolbar_bounds.x(), toolbar_bounds.y(),
- toolbar_bounds.width(), toolbar_center->height());
+ if (normal_mode) {
+ SkBitmap* toolbar_center =
+ resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP);
+ canvas->TileImageInt(*toolbar_center, toolbar_bounds.x(),
+ toolbar_bounds.y(), toolbar_bounds.width(), toolbar_center->height());
+ }
- canvas->DrawBitmapInt(
- *resources()->GetPartBitmap(FRAME_CLIENT_EDGE_TOP_RIGHT),
+ canvas->DrawBitmapInt(*resources()->GetPartBitmap(normal_mode ?
+ FRAME_CLIENT_EDGE_TOP_RIGHT : FRAME_TOOLBAR_POPUP_EDGE_RIGHT),
toolbar_bounds.right(), toolbar_bounds.y());
}
« no previous file with comments | « chrome/app/theme/locationbg_readonly_right.png ('k') | chrome/browser/views/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698