| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/extension_message_bubble_bridge.h" | 5 #include "chrome/browser/ui/extensions/extension_message_bubble_bridge.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "chrome/browser/extensions/extension_message_bubble_controller.h" | 10 #include "chrome/browser/extensions/extension_message_bubble_controller.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/grit/generated_resources.h" | 12 #include "chrome/grit/generated_resources.h" |
| 13 #include "components/grit/components_scaled_resources.h" | 13 #include "components/grit/components_scaled_resources.h" |
| 14 #include "extensions/browser/extension_registry.h" | 14 #include "extensions/browser/extension_registry.h" |
| 15 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
| 16 #include "ui/gfx/vector_icons_public.h" | 16 #include "ui/vector_icons/vector_icons.h" |
| 17 | 17 |
| 18 ExtensionMessageBubbleBridge::ExtensionMessageBubbleBridge( | 18 ExtensionMessageBubbleBridge::ExtensionMessageBubbleBridge( |
| 19 std::unique_ptr<extensions::ExtensionMessageBubbleController> controller) | 19 std::unique_ptr<extensions::ExtensionMessageBubbleController> controller) |
| 20 : controller_(std::move(controller)) {} | 20 : controller_(std::move(controller)) {} |
| 21 | 21 |
| 22 ExtensionMessageBubbleBridge::~ExtensionMessageBubbleBridge() {} | 22 ExtensionMessageBubbleBridge::~ExtensionMessageBubbleBridge() {} |
| 23 | 23 |
| 24 bool ExtensionMessageBubbleBridge::ShouldShow() { | 24 bool ExtensionMessageBubbleBridge::ShouldShow() { |
| 25 return controller_->ShouldShow(); | 25 return controller_->ShouldShow(); |
| 26 } | 26 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 extensions::ExtensionRegistry::Get(controller_->profile()) | 110 extensions::ExtensionRegistry::Get(controller_->profile()) |
| 111 ->GetExtensionById(list[0], include_mask); | 111 ->GetExtensionById(list[0], include_mask); |
| 112 | 112 |
| 113 DCHECK(extension); | 113 DCHECK(extension); |
| 114 | 114 |
| 115 std::unique_ptr<ExtraViewInfo> extra_view_info = | 115 std::unique_ptr<ExtraViewInfo> extra_view_info = |
| 116 base::MakeUnique<ExtraViewInfo>(); | 116 base::MakeUnique<ExtraViewInfo>(); |
| 117 | 117 |
| 118 if (IsPolicyIndicationNeeded(extension)) { | 118 if (IsPolicyIndicationNeeded(extension)) { |
| 119 DCHECK_EQ(1u, list.size()); | 119 DCHECK_EQ(1u, list.size()); |
| 120 extra_view_info->resource_id = gfx::VectorIconId::BUSINESS; | 120 extra_view_info->resource = &ui::kBusinessIcon; |
| 121 extra_view_info->text = | 121 extra_view_info->text = |
| 122 l10n_util::GetStringUTF16(IDS_EXTENSIONS_INSTALLED_BY_ADMIN); | 122 l10n_util::GetStringUTF16(IDS_EXTENSIONS_INSTALLED_BY_ADMIN); |
| 123 extra_view_info->is_text_linked = false; | 123 extra_view_info->is_text_linked = false; |
| 124 } else { | 124 } else { |
| 125 extra_view_info->text = controller_->delegate()->GetLearnMoreLabel(); | 125 extra_view_info->text = controller_->delegate()->GetLearnMoreLabel(); |
| 126 extra_view_info->is_text_linked = true; | 126 extra_view_info->is_text_linked = true; |
| 127 } | 127 } |
| 128 | 128 |
| 129 return extra_view_info; | 129 return extra_view_info; |
| 130 } | 130 } |
| OLD | NEW |