| OLD | NEW |
| 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_frame_view.h" | 5 #include "chrome/browser/ui/panels/panel_frame_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/themes/theme_service.h" | 7 #include "chrome/browser/themes/theme_service.h" |
| 8 #include "chrome/browser/themes/theme_service_factory.h" | 8 #include "chrome/browser/themes/theme_service_factory.h" |
| 9 #include "chrome/browser/ui/panels/panel.h" | 9 #include "chrome/browser/ui/panels/panel.h" |
| 10 #include "chrome/browser/ui/panels/panel_constants.h" | 10 #include "chrome/browser/ui/panels/panel_constants.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 top_right = rb.GetImageSkiaNamed(top_right_id); | 102 top_right = rb.GetImageSkiaNamed(top_right_id); |
| 103 right = rb.GetImageSkiaNamed(right_id); | 103 right = rb.GetImageSkiaNamed(right_id); |
| 104 bottom_right = rb.GetImageSkiaNamed(bottom_right_id); | 104 bottom_right = rb.GetImageSkiaNamed(bottom_right_id); |
| 105 bottom = rb.GetImageSkiaNamed(bottom_id); | 105 bottom = rb.GetImageSkiaNamed(bottom_id); |
| 106 bottom_left = rb.GetImageSkiaNamed(bottom_left_id); | 106 bottom_left = rb.GetImageSkiaNamed(bottom_left_id); |
| 107 left = rb.GetImageSkiaNamed(left_id); | 107 left = rb.GetImageSkiaNamed(left_id); |
| 108 } | 108 } |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 gfx::ImageSkia* CreateImageForColor(SkColor color) { | 111 gfx::ImageSkia* CreateImageForColor(SkColor color) { |
| 112 gfx::Canvas canvas(gfx::Size(1, 1), true); | 112 gfx::Canvas canvas(gfx::Size(1, 1), ui::SCALE_FACTOR_100P, true); |
| 113 canvas.DrawColor(color); | 113 canvas.DrawColor(color); |
| 114 return new gfx::ImageSkia(canvas.ExtractBitmap()); | 114 return new gfx::ImageSkia(canvas.ExtractImageRep()); |
| 115 } | 115 } |
| 116 | 116 |
| 117 const EdgeResources& GetFrameEdges() { | 117 const EdgeResources& GetFrameEdges() { |
| 118 static EdgeResources* edges = NULL; | 118 static EdgeResources* edges = NULL; |
| 119 if (!edges) { | 119 if (!edges) { |
| 120 edges = new EdgeResources( | 120 edges = new EdgeResources( |
| 121 IDR_WINDOW_TOP_LEFT_CORNER, IDR_WINDOW_TOP_CENTER, | 121 IDR_WINDOW_TOP_LEFT_CORNER, IDR_WINDOW_TOP_CENTER, |
| 122 IDR_WINDOW_TOP_RIGHT_CORNER, IDR_WINDOW_RIGHT_SIDE, | 122 IDR_WINDOW_TOP_RIGHT_CORNER, IDR_WINDOW_RIGHT_SIDE, |
| 123 IDR_PANEL_BOTTOM_RIGHT_CORNER, IDR_WINDOW_BOTTOM_CENTER, | 123 IDR_PANEL_BOTTOM_RIGHT_CORNER, IDR_WINDOW_BOTTOM_CENTER, |
| 124 IDR_PANEL_BOTTOM_LEFT_CORNER, IDR_WINDOW_LEFT_SIDE); | 124 IDR_PANEL_BOTTOM_LEFT_CORNER, IDR_WINDOW_LEFT_SIDE); |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 | 625 |
| 626 void PanelFrameView::PaintDivider(gfx::Canvas* canvas) { | 626 void PanelFrameView::PaintDivider(gfx::Canvas* canvas) { |
| 627 // Draw the divider between the titlebar and the client area only if the panel | 627 // Draw the divider between the titlebar and the client area only if the panel |
| 628 // is big enough to show more than the titlebar. | 628 // is big enough to show more than the titlebar. |
| 629 if (height() > TitlebarHeight()) { | 629 if (height() > TitlebarHeight()) { |
| 630 canvas->DrawLine(gfx::Point(0, panel::kTitlebarHeight - 1), | 630 canvas->DrawLine(gfx::Point(0, panel::kTitlebarHeight - 1), |
| 631 gfx::Point(width() - 1, panel::kTitlebarHeight - 1), | 631 gfx::Point(width() - 1, panel::kTitlebarHeight - 1), |
| 632 kDividerColor); | 632 kDividerColor); |
| 633 } | 633 } |
| 634 } | 634 } |
| OLD | NEW |