| 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/views/panels/panel_frame_view.h" | 5 #include "chrome/browser/ui/views/panels/panel_frame_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/panels/panel.h" | 7 #include "chrome/browser/ui/panels/panel.h" |
| 8 #include "chrome/browser/ui/panels/panel_constants.h" | 8 #include "chrome/browser/ui/panels/panel_constants.h" |
| 9 #include "chrome/browser/ui/views/panels/panel_view.h" | 9 #include "chrome/browser/ui/views/panels/panel_view.h" |
| 10 #include "chrome/browser/ui/views/tab_icon_view.h" | 10 #include "chrome/browser/ui/views/tab_icon_view.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 // Color used to draw the title text under default theme. | 62 // Color used to draw the title text under default theme. |
| 63 const SkColor kTitleTextDefaultColor = SkColorSetRGB(0xf9, 0xf9, 0xf9); | 63 const SkColor kTitleTextDefaultColor = SkColorSetRGB(0xf9, 0xf9, 0xf9); |
| 64 | 64 |
| 65 gfx::ImageSkia* CreateImageForColor(SkColor color) { | 65 gfx::ImageSkia* CreateImageForColor(SkColor color) { |
| 66 gfx::Canvas canvas(gfx::Size(1, 1), 1.0f, true); | 66 gfx::Canvas canvas(gfx::Size(1, 1), 1.0f, true); |
| 67 canvas.DrawColor(color); | 67 canvas.DrawColor(color); |
| 68 return new gfx::ImageSkia(canvas.ExtractImageRep()); | 68 return new gfx::ImageSkia(canvas.ExtractImageRep()); |
| 69 } | 69 } |
| 70 | 70 |
| 71 #if defined(OS_WIN) |
| 71 const gfx::ImageSkia& GetTopLeftCornerImage(panel::CornerStyle corner_style) { | 72 const gfx::ImageSkia& GetTopLeftCornerImage(panel::CornerStyle corner_style) { |
| 72 static gfx::ImageSkia* rounded_image = NULL; | 73 static gfx::ImageSkia* rounded_image = NULL; |
| 73 static gfx::ImageSkia* non_rounded_image = NULL; | 74 static gfx::ImageSkia* non_rounded_image = NULL; |
| 74 if (!rounded_image) { | 75 if (!rounded_image) { |
| 75 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 76 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 76 rounded_image = rb.GetImageSkiaNamed(IDR_WINDOW_TOP_LEFT_CORNER); | 77 rounded_image = rb.GetImageSkiaNamed(IDR_WINDOW_TOP_LEFT_CORNER); |
| 77 non_rounded_image = rb.GetImageSkiaNamed(IDR_PANEL_TOP_LEFT_CORNER); | 78 non_rounded_image = rb.GetImageSkiaNamed(IDR_PANEL_TOP_LEFT_CORNER); |
| 78 } | 79 } |
| 79 return (corner_style & panel::TOP_ROUNDED) ? *rounded_image | 80 return (corner_style & panel::TOP_ROUNDED) ? *rounded_image |
| 80 : *non_rounded_image; | 81 : *non_rounded_image; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 147 } |
| 147 | 148 |
| 148 const gfx::ImageSkia& GetRightEdgeImage() { | 149 const gfx::ImageSkia& GetRightEdgeImage() { |
| 149 static gfx::ImageSkia* image = NULL; | 150 static gfx::ImageSkia* image = NULL; |
| 150 if (!image) { | 151 if (!image) { |
| 151 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 152 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 152 image = rb.GetImageSkiaNamed(IDR_WINDOW_RIGHT_SIDE); | 153 image = rb.GetImageSkiaNamed(IDR_WINDOW_RIGHT_SIDE); |
| 153 } | 154 } |
| 154 return *image; | 155 return *image; |
| 155 } | 156 } |
| 157 #endif // defined(OS_WIN) |
| 156 | 158 |
| 157 const gfx::Font& GetTitleFont() { | 159 const gfx::Font& GetTitleFont() { |
| 158 static gfx::Font* font = NULL; | 160 static gfx::Font* font = NULL; |
| 159 if (!font) | 161 if (!font) |
| 160 font = new gfx::Font(kTitleFontName, kTitleFontSize); | 162 font = new gfx::Font(kTitleFontName, kTitleFontSize); |
| 161 return *font; | 163 return *font; |
| 162 } | 164 } |
| 163 | 165 |
| 164 const gfx::ImageSkia* GetActiveBackgroundDefaultImage() { | 166 const gfx::ImageSkia* GetActiveBackgroundDefaultImage() { |
| 165 static gfx::ImageSkia* image = NULL; | 167 static gfx::ImageSkia* image = NULL; |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 | 762 |
| 761 // Draw the left border. | 763 // Draw the left border. |
| 762 canvas->TileImageInt(left_image, | 764 canvas->TileImageInt(left_image, |
| 763 0, | 765 0, |
| 764 top_left_image.height(), | 766 top_left_image.height(), |
| 765 left_image.width(), | 767 left_image.width(), |
| 766 height() - top_left_image.height() - | 768 height() - top_left_image.height() - |
| 767 bottom_left_image.height()); | 769 bottom_left_image.height()); |
| 768 #endif | 770 #endif |
| 769 } | 771 } |
| OLD | NEW |