| 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 #ifndef UI_GFX_ICON_UTIL_H_ | 5 #ifndef UI_GFX_ICON_UTIL_H_ |
| 6 #define UI_GFX_ICON_UTIL_H_ | 6 #define UI_GFX_ICON_UTIL_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // | 57 // |
| 58 /////////////////////////////////////////////////////////////////////////////// | 58 /////////////////////////////////////////////////////////////////////////////// |
| 59 class GFX_EXPORT IconUtil { | 59 class GFX_EXPORT IconUtil { |
| 60 public: | 60 public: |
| 61 // ATOMIC_WRITE ensures that a partially written icon won't be created even if | 61 // ATOMIC_WRITE ensures that a partially written icon won't be created even if |
| 62 // Chrome crashes part way through, but ATOMIC_WRITE is more expensive than | 62 // Chrome crashes part way through, but ATOMIC_WRITE is more expensive than |
| 63 // NORMAL_WRITE. See CreateIconFileFromImageFamily. ATOMIC_WRITE is the | 63 // NORMAL_WRITE. See CreateIconFileFromImageFamily. ATOMIC_WRITE is the |
| 64 // default for historical reasons. | 64 // default for historical reasons. |
| 65 enum WriteType { ATOMIC_WRITE, NORMAL_WRITE }; | 65 enum WriteType { ATOMIC_WRITE, NORMAL_WRITE }; |
| 66 // The size of the large icon entries in .ico files on Windows Vista+. | 66 // The size of the large icon entries in .ico files on Windows Vista+. |
| 67 static const int kLargeIconSize = 256; | 67 enum { kLargeIconSize = 256 }; |
| 68 // The size of icons in the medium icons view on Windows Vista+. This is the | 68 // The size of icons in the medium icons view on Windows Vista+. This is the |
| 69 // maximum size Windows will display an icon that does not have a 256x256 | 69 // maximum size Windows will display an icon that does not have a 256x256 |
| 70 // image, even at the large or extra large icons views. | 70 // image, even at the large or extra large icons views. |
| 71 static const int kMediumIconSize = 48; | 71 enum { kMediumIconSize = 48 }; |
| 72 | 72 |
| 73 // The dimensions for icon images in Windows icon files. All sizes are square; | 73 // The dimensions for icon images in Windows icon files. All sizes are square; |
| 74 // that is, the value 48 means a 48x48 pixel image. Sizes are listed in | 74 // that is, the value 48 means a 48x48 pixel image. Sizes are listed in |
| 75 // ascending order. | 75 // ascending order. |
| 76 static const int kIconDimensions[]; | 76 static const int kIconDimensions[]; |
| 77 | 77 |
| 78 // The number of elements in kIconDimensions. | 78 // The number of elements in kIconDimensions. |
| 79 static const size_t kNumIconDimensions; | 79 static const size_t kNumIconDimensions; |
| 80 // The number of elements in kIconDimensions <= kMediumIconSize. | 80 // The number of elements in kIconDimensions <= kMediumIconSize. |
| 81 static const size_t kNumIconDimensionsUpToMediumSize; | 81 static const size_t kNumIconDimensionsUpToMediumSize; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 // A helper function of CreateSkBitmapFromHICON. | 269 // A helper function of CreateSkBitmapFromHICON. |
| 270 static SkBitmap CreateSkBitmapFromHICONHelper(HICON icon, | 270 static SkBitmap CreateSkBitmapFromHICONHelper(HICON icon, |
| 271 const gfx::Size& s); | 271 const gfx::Size& s); |
| 272 | 272 |
| 273 // Prevent clients from instantiating objects of that class by declaring the | 273 // Prevent clients from instantiating objects of that class by declaring the |
| 274 // ctor/dtor as private. | 274 // ctor/dtor as private. |
| 275 DISALLOW_IMPLICIT_CONSTRUCTORS(IconUtil); | 275 DISALLOW_IMPLICIT_CONSTRUCTORS(IconUtil); |
| 276 }; | 276 }; |
| 277 | 277 |
| 278 #endif // UI_GFX_ICON_UTIL_H_ | 278 #endif // UI_GFX_ICON_UTIL_H_ |
| OLD | NEW |