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

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

Issue 9580001: Aura: Update window frames, allow resize from outside window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix caption for maximized windows, new resize cursor tweak Created 8 years, 10 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/browser_frame_aura.cc
diff --git a/chrome/browser/ui/views/frame/browser_frame_aura.cc b/chrome/browser/ui/views/frame/browser_frame_aura.cc
index 82628c0df052c8e96f7b5395e3789aeb8200604b..c46083759f6df8482a630261542a6a993a00e34c 100644
--- a/chrome/browser/ui/views/frame/browser_frame_aura.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_aura.cc
@@ -72,79 +72,23 @@ void ToolbarBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
SkBitmap* toolbar_left = tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER);
int bottom_edge_height = std::min(toolbar_left->height(), h) - split_point;
- // Split our canvas out so we can mask out the corners of the toolbar
- // without masking out the frame.
- canvas->SaveLayerAlpha(
- 255, gfx::Rect(x - views::NonClientFrameView::kClientEdgeThickness,
- y,
- w + views::NonClientFrameView::kClientEdgeThickness * 3,
- h));
- canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
-
canvas->FillRect(gfx::Rect(x, bottom_y, w, bottom_edge_height),
tp->GetColor(ThemeService::COLOR_TOOLBAR));
// Tile the toolbar image starting at the frame edge on the left and where the
// horizontal tabstrip is (or would be) on the top.
SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR);
- canvas->TileImageInt(*theme_toolbar, x,
- bottom_y, x,
- bottom_y, w, theme_toolbar->height());
-
- // Draw rounded corners for the tab.
- SkBitmap* toolbar_left_mask =
- tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER_MASK);
- SkBitmap* toolbar_right_mask =
- tp->GetBitmapNamed(IDR_CONTENT_TOP_RIGHT_CORNER_MASK);
-
- // We mask out the corners by using the DestinationIn transfer mode,
- // which keeps the RGB pixels from the destination and the alpha from
- // the source.
- SkPaint paint;
- paint.setXfermodeMode(SkXfermode::kDstIn_Mode);
-
- // Mask the left edge.
- int left_x = x - kContentEdgeShadowThickness;
- canvas->DrawBitmapInt(*toolbar_left_mask, 0, 0, toolbar_left_mask->width(),
- split_point, left_x, y, toolbar_left_mask->width(),
- split_point, false, paint);
- canvas->DrawBitmapInt(*toolbar_left_mask, 0,
- toolbar_left_mask->height() - bottom_edge_height,
- toolbar_left_mask->width(), bottom_edge_height, left_x, bottom_y,
- toolbar_left_mask->width(), bottom_edge_height, false, paint);
-
- // Mask the right edge.
- int right_x =
- x + w - toolbar_right_mask->width() + kContentEdgeShadowThickness;
- canvas->DrawBitmapInt(*toolbar_right_mask, 0, 0, toolbar_right_mask->width(),
- split_point, right_x, y, toolbar_right_mask->width(),
- split_point, false, paint);
- canvas->DrawBitmapInt(*toolbar_right_mask, 0,
- toolbar_right_mask->height() - bottom_edge_height,
- toolbar_right_mask->width(), bottom_edge_height, right_x, bottom_y,
- toolbar_right_mask->width(), bottom_edge_height, false, paint);
- canvas->Restore();
-
- canvas->DrawBitmapInt(*toolbar_left, 0, 0, toolbar_left->width(), split_point,
- left_x, y, toolbar_left->width(), split_point, false);
- canvas->DrawBitmapInt(*toolbar_left, 0,
- toolbar_left->height() - bottom_edge_height, toolbar_left->width(),
- bottom_edge_height, left_x, bottom_y, toolbar_left->width(),
- bottom_edge_height, false);
+ canvas->TileImageInt(*theme_toolbar,
+ x, bottom_y,
+ x, bottom_y,
+ w, theme_toolbar->height());
SkBitmap* toolbar_center =
tp->GetBitmapNamed(IDR_CONTENT_TOP_CENTER);
- canvas->TileImageInt(*toolbar_center, 0, 0, left_x + toolbar_left->width(),
- y, right_x - (left_x + toolbar_left->width()),
- split_point);
-
- SkBitmap* toolbar_right = tp->GetBitmapNamed(IDR_CONTENT_TOP_RIGHT_CORNER);
- canvas->DrawBitmapInt(*toolbar_right, 0, 0, toolbar_right->width(),
- split_point, right_x, y, toolbar_right->width(), split_point, false);
- canvas->DrawBitmapInt(*toolbar_right, 0,
- toolbar_right->height() - bottom_edge_height, toolbar_right->width(),
- bottom_edge_height, right_x, bottom_y, toolbar_right->width(),
- bottom_edge_height, false);
+ canvas->TileImageInt(*toolbar_center,
+ 0, 0,
+ x, y,
+ w, split_point);
// Draw the content/toolbar separator.
canvas->FillRect(gfx::Rect(
@@ -270,10 +214,6 @@ BrowserFrameAura::BrowserFrameAura(BrowserFrame* browser_frame,
window_property_watcher_(new WindowPropertyWatcher(this, browser_frame)) {
CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(ash::switches::kAuraTranslucentFrames)) {
- // Aura paints layers behind this view, so this must be a layer also.
- // TODO: see if we can avoid this, layers are expensive.
- browser_view_->SetPaintToLayer(true);
- browser_view_->layer()->SetFillsBoundsOpaquely(false);
// Background only needed for Aura-style windows.
browser_view_->set_background(new ToolbarBackground(browser_view));
}

Powered by Google App Engine
This is Rietveld 408576698