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

Side by Side Diff: chrome/browser/ui/views/frame/browser_frame_aura.cc

Issue 8405002: ui/gfx: Convert Canvas::FillRectInt() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: save some vertical space, interactive_ui_tests are fixed by Peter's fix Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/frame/browser_frame_aura.h" 5 #include "chrome/browser/ui/views/frame/browser_frame_aura.h"
6 6
7 #include "chrome/browser/themes/theme_service.h" 7 #include "chrome/browser/themes/theme_service.h"
8 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h" 8 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h"
9 #include "chrome/browser/ui/views/frame/browser_view.h" 9 #include "chrome/browser/ui/views/frame/browser_view.h"
10 #include "grit/theme_resources_standard.h" 10 #include "grit/theme_resources_standard.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 // Split our canvas out so we can mask out the corners of the toolbar 68 // Split our canvas out so we can mask out the corners of the toolbar
69 // without masking out the frame. 69 // without masking out the frame.
70 canvas->SaveLayerAlpha( 70 canvas->SaveLayerAlpha(
71 255, gfx::Rect(x - views::NonClientFrameView::kClientEdgeThickness, 71 255, gfx::Rect(x - views::NonClientFrameView::kClientEdgeThickness,
72 y, 72 y,
73 w + views::NonClientFrameView::kClientEdgeThickness * 3, 73 w + views::NonClientFrameView::kClientEdgeThickness * 3,
74 h)); 74 h));
75 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); 75 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
76 76
77 SkColor theme_toolbar_color = 77 SkColor theme_toolbar_color = tp->GetColor(ThemeService::COLOR_TOOLBAR);
78 tp->GetColor(ThemeService::COLOR_TOOLBAR); 78 canvas->FillRect(theme_toolbar_color,
79 canvas->FillRectInt(theme_toolbar_color, x, bottom_y, w, bottom_edge_height); 79 gfx::Rect(x, bottom_y, w, bottom_edge_height));
80 80
81 // Tile the toolbar image starting at the frame edge on the left and where the 81 // Tile the toolbar image starting at the frame edge on the left and where the
82 // horizontal tabstrip is (or would be) on the top. 82 // horizontal tabstrip is (or would be) on the top.
83 SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR); 83 SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR);
84 canvas->TileImageInt(*theme_toolbar, x, 84 canvas->TileImageInt(*theme_toolbar, x,
85 bottom_y, x, 85 bottom_y, x,
86 bottom_y, w, theme_toolbar->height()); 86 bottom_y, w, theme_toolbar->height());
87 87
88 // Draw rounded corners for the tab. 88 // Draw rounded corners for the tab.
89 SkBitmap* toolbar_left_mask = 89 SkBitmap* toolbar_left_mask =
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 SkBitmap* toolbar_right = tp->GetBitmapNamed(IDR_CONTENT_TOP_RIGHT_CORNER); 135 SkBitmap* toolbar_right = tp->GetBitmapNamed(IDR_CONTENT_TOP_RIGHT_CORNER);
136 canvas->DrawBitmapInt(*toolbar_right, 0, 0, toolbar_right->width(), 136 canvas->DrawBitmapInt(*toolbar_right, 0, 0, toolbar_right->width(),
137 split_point, right_x, y, toolbar_right->width(), split_point, false); 137 split_point, right_x, y, toolbar_right->width(), split_point, false);
138 canvas->DrawBitmapInt(*toolbar_right, 0, 138 canvas->DrawBitmapInt(*toolbar_right, 0,
139 toolbar_right->height() - bottom_edge_height, toolbar_right->width(), 139 toolbar_right->height() - bottom_edge_height, toolbar_right->width(),
140 bottom_edge_height, right_x, bottom_y, toolbar_right->width(), 140 bottom_edge_height, right_x, bottom_y, toolbar_right->width(),
141 bottom_edge_height, false); 141 bottom_edge_height, false);
142 142
143 // Draw the content/toolbar separator. 143 // Draw the content/toolbar separator.
144 canvas->FillRectInt( 144 canvas->FillRect(
145 ResourceBundle::toolbar_separator_color, 145 ResourceBundle::toolbar_separator_color,
146 x + views::NonClientFrameView::kClientEdgeThickness, 146 gfx::Rect(
147 toolbar_bounds.bottom() - views::NonClientFrameView::kClientEdgeThickness, 147 x + views::NonClientFrameView::kClientEdgeThickness,
148 w - (2 * views::NonClientFrameView::kClientEdgeThickness), 148 toolbar_bounds.bottom() - views::NonClientFrameView::kClientEdgeThickn ess,
149 views::NonClientFrameView::kClientEdgeThickness); 149 w - (2 * views::NonClientFrameView::kClientEdgeThickness),
150 views::NonClientFrameView::kClientEdgeThickness));
150 } 151 }
151 152
152 } // namespace 153 } // namespace
153 154
154 /////////////////////////////////////////////////////////////////////////////// 155 ///////////////////////////////////////////////////////////////////////////////
155 // BrowserFrameAura, public: 156 // BrowserFrameAura, public:
156 157
157 BrowserFrameAura::BrowserFrameAura(BrowserFrame* browser_frame, 158 BrowserFrameAura::BrowserFrameAura(BrowserFrame* browser_frame,
158 BrowserView* browser_view) 159 BrowserView* browser_view)
159 : views::NativeWidgetAura(browser_frame), 160 : views::NativeWidgetAura(browser_frame),
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 201
201 //////////////////////////////////////////////////////////////////////////////// 202 ////////////////////////////////////////////////////////////////////////////////
202 // NativeBrowserFrame, public: 203 // NativeBrowserFrame, public:
203 204
204 // static 205 // static
205 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( 206 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame(
206 BrowserFrame* browser_frame, 207 BrowserFrame* browser_frame,
207 BrowserView* browser_view) { 208 BrowserView* browser_view) {
208 return new BrowserFrameAura(browser_frame, browser_view); 209 return new BrowserFrameAura(browser_frame, browser_view);
209 } 210 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698