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

Unified Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc

Issue 6904160: Implement new gray mock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed power test Created 9 years, 8 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/frame/opaque_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
index 20616aa7b4921c7bb067eac7ebc2d44b35d30c34..d5a346aff302eb168ef3016927ca49382d1a4b15 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -495,6 +495,10 @@ int OpaqueBrowserFrameView::NonClientTopBorderHeight(
window->IsMaximized()) ? kTabstripTopShadowThickness : 0);
}
+void OpaqueBrowserFrameView::ModifyMaximizedFramePainting(
+ int* theme_offset, SkBitmap** left_corner, SkBitmap** right_corner) {
+}
+
int OpaqueBrowserFrameView::CaptionButtonY(bool restored) const {
// Maximized buttons start at window top so that even if their images aren't
// drawn flush with the screen edge, they still obey Fitts' Law.
@@ -668,13 +672,19 @@ void OpaqueBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) {
height() - top_left_height - bottom_left_corner->height());
}
-
void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) {
ui::ThemeProvider* tp = GetThemeProvider();
views::Window* window = frame_->GetWindow();
// Window frame mode and color
SkBitmap* theme_frame;
+
+ // Allow customization of these attributes.
+ SkBitmap* left = NULL;
+ SkBitmap* right = NULL;
+ int top_offset = 0;
+ ModifyMaximizedFramePainting(&top_offset, &left, &right);
+
// Never theme app and popup windows.
if (!browser_view_->IsBrowserTypeNormal()) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
@@ -692,9 +702,21 @@ void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) {
// kTabstripTopShadowThickness px off the top of the screen.
int theme_background_y = -(GetHorizontalTabStripVerticalOffset(true) +
kTabstripTopShadowThickness);
- canvas->TileImageInt(*theme_frame, 0, theme_background_y, width(),
- theme_frame->height());
+ int left_offset = 0, right_offset = 0;
+
+ if (left || right) {
+ DCHECK(left && right);
sky 2011/05/02 14:26:27 The DCHECK and if don't match.
+ left_offset = left->width();
+ right_offset = right->width();
+ canvas->DrawBitmapInt(*left, 0, 0);
+ canvas->DrawBitmapInt(*right, width() - right_offset, 0);
+ }
+ canvas->TileImageInt(*theme_frame,
+ left_offset,
+ top_offset,
+ width() - (left_offset + right_offset),
+ theme_frame->height());
// Draw the theme frame overlay
if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) &&
browser_view_->IsBrowserTypeNormal()) {

Powered by Google App Engine
This is Rietveld 408576698