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

Side by Side Diff: trunk/src/chrome/browser/ui/views/frame/browser_view.cc

Issue 24262008: Revert 224473 "Remove dependency on ui::ScaleFactor from ui/gfx" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 SkPaint paint; 202 SkPaint paint;
203 paint.setAntiAlias(false); 203 paint.setAntiAlias(false);
204 // Sets border to 1-px thick regardless of scale factor. 204 // Sets border to 1-px thick regardless of scale factor.
205 paint.setStrokeWidth(0); 205 paint.setStrokeWidth(0);
206 // Bottom border is at 50% opacity of top border. 206 // Bottom border is at 50% opacity of top border.
207 paint.setColor(SkColorSetA(separator_color, 207 paint.setColor(SkColorSetA(separator_color,
208 SkColorGetA(separator_color) / 2)); 208 SkColorGetA(separator_color) / 2));
209 // Calculate thickness of bottom border as per current scale factor to 209 // Calculate thickness of bottom border as per current scale factor to
210 // determine where to draw the 1-px thick border. 210 // determine where to draw the 1-px thick border.
211 float thickness = views::NonClientFrameView::kClientEdgeThickness / 211 float thickness = views::NonClientFrameView::kClientEdgeThickness /
212 canvas->image_scale(); 212 ui::GetScaleFactorScale(canvas->scale_factor());
213 SkScalar y = SkIntToScalar(view->height()) - SkFloatToScalar(thickness); 213 SkScalar y = SkIntToScalar(view->height()) - SkFloatToScalar(thickness);
214 canvas->sk_canvas()->drawLine(SkIntToScalar(0), y, 214 canvas->sk_canvas()->drawLine(SkIntToScalar(0), y,
215 SkIntToScalar(view->width()), y, paint); 215 SkIntToScalar(view->width()), y, paint);
216 } 216 }
217 217
218 void PaintAttachedBookmarkBar(gfx::Canvas* canvas, 218 void PaintAttachedBookmarkBar(gfx::Canvas* canvas,
219 DetachableToolbarView* view, 219 DetachableToolbarView* view,
220 BrowserView* browser_view, 220 BrowserView* browser_view,
221 chrome::HostDesktopType host_desktop_type, 221 chrome::HostDesktopType host_desktop_type,
222 int toolbar_overlap) { 222 int toolbar_overlap) {
(...skipping 2455 matching lines...) Expand 10 before | Expand all | Expand 10 after
2678 // The +1 in the next line creates a 1-px gap between icon and arrow tip. 2678 // The +1 in the next line creates a 1-px gap between icon and arrow tip.
2679 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - 2679 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() -
2680 LocationBarView::kIconInternalPadding + 1); 2680 LocationBarView::kIconInternalPadding + 1);
2681 ConvertPointToTarget(location_icon_view, this, &icon_bottom); 2681 ConvertPointToTarget(location_icon_view, this, &icon_bottom);
2682 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); 2682 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL));
2683 ConvertPointToTarget(infobar_container_, this, &infobar_top); 2683 ConvertPointToTarget(infobar_container_, this, &infobar_top);
2684 top_arrow_height = infobar_top.y() - icon_bottom.y(); 2684 top_arrow_height = infobar_top.y() - icon_bottom.y();
2685 } 2685 }
2686 return top_arrow_height; 2686 return top_arrow_height;
2687 } 2687 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698