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_browser_window_gtk.h" | 5 #include "chrome/browser/ui/panels/panel_browser_window_gtk.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 const SkColor kMinimizeBackgroundDefaultColor = SkColorSetRGB(0xf5, 0xf4, 0xf0); | 41 const SkColor kMinimizeBackgroundDefaultColor = SkColorSetRGB(0xf5, 0xf4, 0xf0); |
42 const SkColor kMinimizeBorderDefaultColor = SkColorSetRGB(0xc9, 0xc9, 0xc9); | 42 const SkColor kMinimizeBorderDefaultColor = SkColorSetRGB(0xc9, 0xc9, 0xc9); |
43 | 43 |
44 // Color used to draw the divider line between the titlebar and the client area. | 44 // Color used to draw the divider line between the titlebar and the client area. |
45 const SkColor kDividerColor = SkColorSetRGB(0x2a, 0x2c, 0x2c); | 45 const SkColor kDividerColor = SkColorSetRGB(0x2a, 0x2c, 0x2c); |
46 | 46 |
47 // Set minimium width for window really small. | 47 // Set minimium width for window really small. |
48 const int kMinWindowWidth = 26; | 48 const int kMinWindowWidth = 26; |
49 | 49 |
50 gfx::Image* CreateImageForColor(SkColor color) { | 50 gfx::Image* CreateImageForColor(SkColor color) { |
51 gfx::Canvas canvas(gfx::Size(1, 1), ui::SCALE_FACTOR_100P, true); | 51 gfx::Canvas canvas(gfx::Size(1, 1), true); |
52 canvas.DrawColor(color); | 52 canvas.DrawColor(color); |
53 return new gfx::Image(gfx::ImageSkia(canvas.ExtractImageRep())); | 53 return new gfx::Image(canvas.ExtractBitmap()); |
54 } | 54 } |
55 | 55 |
56 const gfx::Image* GetActiveBackgroundDefaultImage() { | 56 const gfx::Image* GetActiveBackgroundDefaultImage() { |
57 static gfx::Image* image = NULL; | 57 static gfx::Image* image = NULL; |
58 if (!image) | 58 if (!image) |
59 image = CreateImageForColor(kActiveBackgroundDefaultColor); | 59 image = CreateImageForColor(kActiveBackgroundDefaultColor); |
60 return image; | 60 return image; |
61 } | 61 } |
62 | 62 |
63 const gfx::Image* GetInactiveBackgroundDefaultImage() { | 63 const gfx::Image* GetInactiveBackgroundDefaultImage() { |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 break; | 758 break; |
759 case panel::RESTORE_BUTTON: | 759 case panel::RESTORE_BUTTON: |
760 button = titlebar->restore_button(); | 760 button = titlebar->restore_button(); |
761 break; | 761 break; |
762 default: | 762 default: |
763 NOTREACHED(); | 763 NOTREACHED(); |
764 return false; | 764 return false; |
765 } | 765 } |
766 return gtk_widget_get_visible(button->widget()); | 766 return gtk_widget_get_visible(button->widget()); |
767 } | 767 } |
OLD | NEW |