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 #import "chrome/browser/web_applications/web_app_mac.h" | 5 #import "chrome/browser/web_applications/web_app_mac.h" |
6 | 6 |
7 #import <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 // Adds |image| to |icon_family|. Returns true on success, false on failure. | 106 // Adds |image| to |icon_family|. Returns true on success, false on failure. |
107 bool AddGfxImageToIconFamily(IconFamilyHandle icon_family, | 107 bool AddGfxImageToIconFamily(IconFamilyHandle icon_family, |
108 const gfx::Image& image) { | 108 const gfx::Image& image) { |
109 // When called via ShowCreateChromeAppShortcutsDialog the ImageFamily will | 109 // When called via ShowCreateChromeAppShortcutsDialog the ImageFamily will |
110 // have all the representations desired here for mac, from the kDesiredSizes | 110 // have all the representations desired here for mac, from the kDesiredSizes |
111 // array in web_app.cc. | 111 // array in web_app.cc. |
112 SkBitmap bitmap = image.AsBitmap(); | 112 SkBitmap bitmap = image.AsBitmap(); |
113 if (bitmap.config() != SkBitmap::kARGB_8888_Config || | 113 if (bitmap.colorType() != kN32_SkColorType || |
114 bitmap.width() != bitmap.height()) { | 114 bitmap.width() != bitmap.height()) { |
115 return false; | 115 return false; |
116 } | 116 } |
117 | 117 |
118 OSType icon_type; | 118 OSType icon_type; |
119 switch (bitmap.width()) { | 119 switch (bitmap.width()) { |
120 case 512: | 120 case 512: |
121 icon_type = kIconServices512PixelDataARGB; | 121 icon_type = kIconServices512PixelDataARGB; |
122 break; | 122 break; |
123 case 256: | 123 case 256: |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 web_app::GetShortcutInfoForApp( | 1103 web_app::GetShortcutInfoForApp( |
1104 app, | 1104 app, |
1105 profile, | 1105 profile, |
1106 base::Bind(&web_app::CreateAppShortcutInfoLoaded, | 1106 base::Bind(&web_app::CreateAppShortcutInfoLoaded, |
1107 profile, | 1107 profile, |
1108 app, | 1108 app, |
1109 close_callback)); | 1109 close_callback)); |
1110 } | 1110 } |
1111 | 1111 |
1112 } // namespace chrome | 1112 } // namespace chrome |
OLD | NEW |