| 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 29 matching lines...) Expand all Loading... |
| 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( | 49 return gfx::Image(gfx::CreateVectorIcon( |
| 50 vector_id, 16, | 50 vector_id, 18, |
| 51 GetInfoBarType() == WARNING_TYPE ? gfx::kAmber : gfx::kGoogleBlue)); | 51 GetInfoBarType() == WARNING_TYPE ? SkColorSetRGB(0xFF, 0x67, 0) |
| 52 : gfx::kGoogleBlue)); |
| 52 } | 53 } |
| 53 } | 54 } |
| 54 #endif | 55 #endif |
| 55 | 56 |
| 56 int icon_id = GetIconId(); | 57 int icon_id = GetIconId(); |
| 57 return icon_id == kNoIconID ? gfx::Image() : | 58 return icon_id == kNoIconID ? gfx::Image() : |
| 58 ResourceBundle::GetSharedInstance().GetNativeImageNamed(icon_id); | 59 ResourceBundle::GetSharedInstance().GetNativeImageNamed(icon_id); |
| 59 } | 60 } |
| 60 | 61 |
| 61 bool InfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { | 62 bool InfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 127 |
| 127 translate::TranslateInfoBarDelegate* | 128 translate::TranslateInfoBarDelegate* |
| 128 InfoBarDelegate::AsTranslateInfoBarDelegate() { | 129 InfoBarDelegate::AsTranslateInfoBarDelegate() { |
| 129 return nullptr; | 130 return nullptr; |
| 130 } | 131 } |
| 131 | 132 |
| 132 InfoBarDelegate::InfoBarDelegate() : nav_entry_id_(0) { | 133 InfoBarDelegate::InfoBarDelegate() : nav_entry_id_(0) { |
| 133 } | 134 } |
| 134 | 135 |
| 135 } // namespace infobars | 136 } // namespace infobars |
| OLD | NEW |