| 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/extensions/extension_action.h" | 5 #include "chrome/browser/extensions/extension_action.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "url/gurl.h" | 35 #include "url/gurl.h" |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 class GetAttentionImageSource : public gfx::ImageSkiaSource { | 39 class GetAttentionImageSource : public gfx::ImageSkiaSource { |
| 40 public: | 40 public: |
| 41 explicit GetAttentionImageSource(const gfx::ImageSkia& icon) | 41 explicit GetAttentionImageSource(const gfx::ImageSkia& icon) |
| 42 : icon_(icon) {} | 42 : icon_(icon) {} |
| 43 | 43 |
| 44 // gfx::ImageSkiaSource overrides: | 44 // gfx::ImageSkiaSource overrides: |
| 45 virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE { | 45 virtual gfx::ImageSkiaRep GetImageForScale(float scale) override { |
| 46 gfx::ImageSkiaRep icon_rep = icon_.GetRepresentation(scale); | 46 gfx::ImageSkiaRep icon_rep = icon_.GetRepresentation(scale); |
| 47 color_utils::HSL shift = {-1, 0, 0.5}; | 47 color_utils::HSL shift = {-1, 0, 0.5}; |
| 48 return gfx::ImageSkiaRep( | 48 return gfx::ImageSkiaRep( |
| 49 SkBitmapOperations::CreateHSLShiftedBitmap(icon_rep.sk_bitmap(), shift), | 49 SkBitmapOperations::CreateHSLShiftedBitmap(icon_rep.sk_bitmap(), shift), |
| 50 icon_rep.scale()); | 50 icon_rep.scale()); |
| 51 } | 51 } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 const gfx::ImageSkia icon_; | 54 const gfx::ImageSkia icon_; |
| 55 }; | 55 }; |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 // If there is a default icon, the icon width will be set depending on our | 319 // If there is a default icon, the icon width will be set depending on our |
| 320 // action type. | 320 // action type. |
| 321 if (default_icon_) | 321 if (default_icon_) |
| 322 return GetIconSizeForType(action_type()); | 322 return GetIconSizeForType(action_type()); |
| 323 | 323 |
| 324 // If no icon has been set and there is no default icon, we need favicon | 324 // If no icon has been set and there is no default icon, we need favicon |
| 325 // width. | 325 // width. |
| 326 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 326 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
| 327 IDR_EXTENSIONS_FAVICON).ToImageSkia()->width(); | 327 IDR_EXTENSIONS_FAVICON).ToImageSkia()->width(); |
| 328 } | 328 } |
| OLD | NEW |