| 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/infobars/extension_infobar.h" | 5 #include "chrome/browser/ui/views/infobars/extension_infobar.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_context_menu_model.h" | 7 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 8 #include "chrome/browser/extensions/extension_infobar_delegate.h" | 8 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
| 9 #include "chrome/browser/extensions/extension_view_host.h" | 9 #include "chrome/browser/extensions/extension_view_host.h" |
| 10 #include "chrome/browser/platform_util.h" | 10 #include "chrome/browser/platform_util.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 MenuImageSource(const gfx::ImageSkia& icon, const gfx::ImageSkia& drop_image) | 49 MenuImageSource(const gfx::ImageSkia& icon, const gfx::ImageSkia& drop_image) |
| 50 : gfx::CanvasImageSource(ComputeSize(drop_image), false), | 50 : gfx::CanvasImageSource(ComputeSize(drop_image), false), |
| 51 icon_(icon), | 51 icon_(icon), |
| 52 drop_image_(drop_image) { | 52 drop_image_(drop_image) { |
| 53 } | 53 } |
| 54 | 54 |
| 55 virtual ~MenuImageSource() { | 55 virtual ~MenuImageSource() { |
| 56 } | 56 } |
| 57 | 57 |
| 58 // Overridden from gfx::CanvasImageSource | 58 // Overridden from gfx::CanvasImageSource |
| 59 virtual void Draw(gfx::Canvas* canvas) OVERRIDE { | 59 virtual void Draw(gfx::Canvas* canvas) override { |
| 60 int image_size = extension_misc::EXTENSION_ICON_BITTY; | 60 int image_size = extension_misc::EXTENSION_ICON_BITTY; |
| 61 canvas->DrawImageInt(icon_, 0, 0, icon_.width(), icon_.height(), 0, 0, | 61 canvas->DrawImageInt(icon_, 0, 0, icon_.width(), icon_.height(), 0, 0, |
| 62 image_size, image_size, false); | 62 image_size, image_size, false); |
| 63 canvas->DrawImageInt(drop_image_, image_size + kDropArrowLeftMargin, | 63 canvas->DrawImageInt(drop_image_, image_size + kDropArrowLeftMargin, |
| 64 image_size / 2); | 64 image_size / 2); |
| 65 } | 65 } |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 gfx::Size ComputeSize(const gfx::ImageSkia& drop_image) const { | 68 gfx::Size ComputeSize(const gfx::ImageSkia& drop_image) const { |
| 69 int image_size = extension_misc::EXTENSION_ICON_BITTY; | 69 int image_size = extension_misc::EXTENSION_ICON_BITTY; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } | 227 } |
| 228 | 228 |
| 229 ExtensionViewViews* ExtensionInfoBar::GetExtensionView() { | 229 ExtensionViewViews* ExtensionInfoBar::GetExtensionView() { |
| 230 return static_cast<ExtensionViewViews*>( | 230 return static_cast<ExtensionViewViews*>( |
| 231 GetDelegate()->extension_view_host()->view()); | 231 GetDelegate()->extension_view_host()->view()); |
| 232 } | 232 } |
| 233 | 233 |
| 234 int ExtensionInfoBar::NonExtensionViewWidth() const { | 234 int ExtensionInfoBar::NonExtensionViewWidth() const { |
| 235 return infobar_icon_->width() + kIconHorizontalMargin; | 235 return infobar_icon_->width() + kIconHorizontalMargin; |
| 236 } | 236 } |
| OLD | NEW |