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

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

Issue 9021046: Pass const gfx::Rect& as the first parameter to FillRect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: one more fix 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "chrome/browser/chromeos/status/status_area_view.h" 10 #include "chrome/browser/chromeos/status/status_area_view.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 // Split our canvas out so we can mask out the corners of the toolbar 76 // Split our canvas out so we can mask out the corners of the toolbar
77 // without masking out the frame. 77 // without masking out the frame.
78 canvas->SaveLayerAlpha( 78 canvas->SaveLayerAlpha(
79 255, gfx::Rect(x - views::NonClientFrameView::kClientEdgeThickness, 79 255, gfx::Rect(x - views::NonClientFrameView::kClientEdgeThickness,
80 y, 80 y,
81 w + views::NonClientFrameView::kClientEdgeThickness * 3, 81 w + views::NonClientFrameView::kClientEdgeThickness * 3,
82 h)); 82 h));
83 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); 83 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
84 84
85 SkColor theme_toolbar_color = tp->GetColor(ThemeService::COLOR_TOOLBAR); 85 canvas->FillRect(gfx::Rect(x, bottom_y, w, bottom_edge_height),
86 canvas->FillRect(theme_toolbar_color, 86 tp->GetColor(ThemeService::COLOR_TOOLBAR));
87 gfx::Rect(x, bottom_y, w, bottom_edge_height));
88 87
89 // Tile the toolbar image starting at the frame edge on the left and where the 88 // Tile the toolbar image starting at the frame edge on the left and where the
90 // horizontal tabstrip is (or would be) on the top. 89 // horizontal tabstrip is (or would be) on the top.
91 SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR); 90 SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR);
92 canvas->TileImageInt(*theme_toolbar, x, 91 canvas->TileImageInt(*theme_toolbar, x,
93 bottom_y, x, 92 bottom_y, x,
94 bottom_y, w, theme_toolbar->height()); 93 bottom_y, w, theme_toolbar->height());
95 94
96 // Draw rounded corners for the tab. 95 // Draw rounded corners for the tab.
97 SkBitmap* toolbar_left_mask = 96 SkBitmap* toolbar_left_mask =
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 141
143 SkBitmap* toolbar_right = tp->GetBitmapNamed(IDR_CONTENT_TOP_RIGHT_CORNER); 142 SkBitmap* toolbar_right = tp->GetBitmapNamed(IDR_CONTENT_TOP_RIGHT_CORNER);
144 canvas->DrawBitmapInt(*toolbar_right, 0, 0, toolbar_right->width(), 143 canvas->DrawBitmapInt(*toolbar_right, 0, 0, toolbar_right->width(),
145 split_point, right_x, y, toolbar_right->width(), split_point, false); 144 split_point, right_x, y, toolbar_right->width(), split_point, false);
146 canvas->DrawBitmapInt(*toolbar_right, 0, 145 canvas->DrawBitmapInt(*toolbar_right, 0,
147 toolbar_right->height() - bottom_edge_height, toolbar_right->width(), 146 toolbar_right->height() - bottom_edge_height, toolbar_right->width(),
148 bottom_edge_height, right_x, bottom_y, toolbar_right->width(), 147 bottom_edge_height, right_x, bottom_y, toolbar_right->width(),
149 bottom_edge_height, false); 148 bottom_edge_height, false);
150 149
151 // Draw the content/toolbar separator. 150 // Draw the content/toolbar separator.
152 canvas->FillRect( 151 canvas->FillRect(gfx::Rect(
153 ResourceBundle::toolbar_separator_color, 152 x + views::NonClientFrameView::kClientEdgeThickness,
154 gfx::Rect( 153 toolbar_bounds.bottom() - views::NonClientFrameView::kClientEdgeThickness,
155 x + views::NonClientFrameView::kClientEdgeThickness, 154 w - (2 * views::NonClientFrameView::kClientEdgeThickness),
156 toolbar_bounds.bottom() - views::NonClientFrameView::kClientEdgeThickn ess, 155 views::NonClientFrameView::kClientEdgeThickness),
157 w - (2 * views::NonClientFrameView::kClientEdgeThickness), 156 ResourceBundle::toolbar_separator_color);
158 views::NonClientFrameView::kClientEdgeThickness));
159 } 157 }
160 158
161 //////////////////////////////////////////////////////////////////////////////// 159 ////////////////////////////////////////////////////////////////////////////////
162 // StatusAreaBoundsWatcher 160 // StatusAreaBoundsWatcher
163 161
164 class StatusAreaBoundsWatcher : public aura::WindowObserver { 162 class StatusAreaBoundsWatcher : public aura::WindowObserver {
165 public: 163 public:
166 explicit StatusAreaBoundsWatcher(BrowserFrame* frame) 164 explicit StatusAreaBoundsWatcher(BrowserFrame* frame)
167 : frame_(frame), 165 : frame_(frame),
168 status_area_window_(NULL) { 166 status_area_window_(NULL) {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 318
321 //////////////////////////////////////////////////////////////////////////////// 319 ////////////////////////////////////////////////////////////////////////////////
322 // NativeBrowserFrame, public: 320 // NativeBrowserFrame, public:
323 321
324 // static 322 // static
325 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( 323 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame(
326 BrowserFrame* browser_frame, 324 BrowserFrame* browser_frame,
327 BrowserView* browser_view) { 325 BrowserView* browser_view) {
328 return new BrowserFrameAura(browser_frame, browser_view); 326 return new BrowserFrameAura(browser_frame, browser_view);
329 } 327 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698