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

Side by Side Diff: chrome/browser/ui/panels/panel_browser_frame_view.cc

Issue 10701063: Cleanup gfx::Canvas now that 10562027 has landed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/panels/panel_browser_frame_view.h" 5 #include "chrome/browser/ui/panels/panel_browser_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/themes/theme_service.h" 10 #include "chrome/browser/themes/theme_service.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 top_right = rb.GetImageSkiaNamed(top_right_id); 143 top_right = rb.GetImageSkiaNamed(top_right_id);
144 right = rb.GetImageSkiaNamed(right_id); 144 right = rb.GetImageSkiaNamed(right_id);
145 bottom_right = rb.GetImageSkiaNamed(bottom_right_id); 145 bottom_right = rb.GetImageSkiaNamed(bottom_right_id);
146 bottom = rb.GetImageSkiaNamed(bottom_id); 146 bottom = rb.GetImageSkiaNamed(bottom_id);
147 bottom_left = rb.GetImageSkiaNamed(bottom_left_id); 147 bottom_left = rb.GetImageSkiaNamed(bottom_left_id);
148 left = rb.GetImageSkiaNamed(left_id); 148 left = rb.GetImageSkiaNamed(left_id);
149 } 149 }
150 }; 150 };
151 151
152 gfx::ImageSkia* CreateImageForColor(SkColor color) { 152 gfx::ImageSkia* CreateImageForColor(SkColor color) {
153 gfx::Canvas canvas(gfx::Size(1, 1), true); 153 gfx::Canvas canvas(gfx::Size(1, 1), ui::SCALE_FACTOR_100P, true);
154 canvas.DrawColor(color); 154 canvas.DrawColor(color);
155 return new gfx::ImageSkia(canvas.ExtractBitmap()); 155 return new gfx::ImageSkia(canvas.ExtractImageRep());
156 } 156 }
157 157
158 const ButtonResources& GetCloseButtonResources() { 158 const ButtonResources& GetCloseButtonResources() {
159 static ButtonResources* buttons = NULL; 159 static ButtonResources* buttons = NULL;
160 if (!buttons) { 160 if (!buttons) {
161 buttons = new ButtonResources(IDR_PANEL_CLOSE, 161 buttons = new ButtonResources(IDR_PANEL_CLOSE,
162 IDR_PANEL_CLOSE_H, 162 IDR_PANEL_CLOSE_H,
163 IDR_PANEL_CLOSE_C, 163 IDR_PANEL_CLOSE_C,
164 IDS_PANEL_CLOSE_TOOLTIP); 164 IDS_PANEL_CLOSE_TOOLTIP);
165 } 165 }
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 } 798 }
799 799
800 bool PanelBrowserFrameView::CanResize() const { 800 bool PanelBrowserFrameView::CanResize() const {
801 return panel_browser_view_->panel()->CanResizeByMouse() != 801 return panel_browser_view_->panel()->CanResizeByMouse() !=
802 panel::NOT_RESIZABLE; 802 panel::NOT_RESIZABLE;
803 } 803 }
804 804
805 bool PanelBrowserFrameView::IsShowingTitlebarOnly() const { 805 bool PanelBrowserFrameView::IsShowingTitlebarOnly() const {
806 return height() <= panel::kTitlebarHeight; 806 return height() <= panel::kTitlebarHeight;
807 } 807 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_ui.cc ('k') | chrome/browser/ui/panels/panel_browser_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698