| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/infobars/core/infobar_delegate.h" | 5 #include "components/infobars/core/infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "components/infobars/core/infobar.h" | 9 #include "components/infobars/core/infobar.h" |
| 10 #include "components/infobars/core/infobar_manager.h" | 10 #include "components/infobars/core/infobar_manager.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 gfx::VectorIconId InfoBarDelegate::GetVectorIconId() const { | 40 gfx::VectorIconId InfoBarDelegate::GetVectorIconId() const { |
| 41 return gfx::VectorIconId::VECTOR_ICON_NONE; | 41 return gfx::VectorIconId::VECTOR_ICON_NONE; |
| 42 } | 42 } |
| 43 | 43 |
| 44 gfx::Image InfoBarDelegate::GetIcon() const { | 44 gfx::Image InfoBarDelegate::GetIcon() const { |
| 45 #if !defined(OS_MACOSX) && !defined(OS_IOS) && !defined(OS_ANDROID) | 45 #if !defined(OS_MACOSX) && !defined(OS_IOS) && !defined(OS_ANDROID) |
| 46 if (ui::MaterialDesignController::IsModeMaterial()) { | 46 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 47 gfx::VectorIconId vector_id = GetVectorIconId(); | 47 gfx::VectorIconId vector_id = GetVectorIconId(); |
| 48 if (vector_id != gfx::VectorIconId::VECTOR_ICON_NONE) { | 48 if (vector_id != gfx::VectorIconId::VECTOR_ICON_NONE) { |
| 49 return gfx::Image(gfx::CreateVectorIcon(vector_id, 18, | 49 return gfx::Image(gfx::CreateVectorIcon(vector_id, 16, |
| 50 GetInfoBarType() == WARNING_TYPE | 50 GetInfoBarType() == WARNING_TYPE |
| 51 ? SkColorSetRGB(0xFF, 0x67, 0) | 51 ? SkColorSetRGB(0xFF, 0x67, 0) |
| 52 : gfx::kGoogleBlue500)); | 52 : gfx::kGoogleBlue500)); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 #endif | 55 #endif |
| 56 | 56 |
| 57 int icon_id = GetIconId(); | 57 int icon_id = GetIconId(); |
| 58 return icon_id == kNoIconID ? gfx::Image() : | 58 return icon_id == kNoIconID ? gfx::Image() : |
| 59 ResourceBundle::GetSharedInstance().GetNativeImageNamed(icon_id); | 59 ResourceBundle::GetSharedInstance().GetNativeImageNamed(icon_id); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 MediaThrottleInfoBarDelegate* | 135 MediaThrottleInfoBarDelegate* |
| 136 InfoBarDelegate::AsMediaThrottleInfoBarDelegate() { | 136 InfoBarDelegate::AsMediaThrottleInfoBarDelegate() { |
| 137 return nullptr; | 137 return nullptr; |
| 138 } | 138 } |
| 139 #endif | 139 #endif |
| 140 | 140 |
| 141 InfoBarDelegate::InfoBarDelegate() : nav_entry_id_(0) { | 141 InfoBarDelegate::InfoBarDelegate() : nav_entry_id_(0) { |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace infobars | 144 } // namespace infobars |
| OLD | NEW |