| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/blocked_action_bubble_delegate.h" | 5 #include "chrome/browser/ui/extensions/blocked_action_bubble_delegate.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| 11 | 11 |
| 12 BlockedActionBubbleDelegate::BlockedActionBubbleDelegate( | 12 BlockedActionBubbleDelegate::BlockedActionBubbleDelegate( |
| 13 const base::Callback<void(CloseAction)>& callback, | 13 const base::Callback<void(CloseAction)>& callback, |
| 14 const std::string& extension_id) | 14 const std::string& extension_id) |
| 15 : callback_(callback), extension_id_(extension_id) {} | 15 : callback_(callback), extension_id_(extension_id) {} |
| 16 | 16 |
| 17 BlockedActionBubbleDelegate::~BlockedActionBubbleDelegate() {} | 17 BlockedActionBubbleDelegate::~BlockedActionBubbleDelegate() {} |
| 18 | 18 |
| 19 bool BlockedActionBubbleDelegate::ShouldShow() { |
| 20 // TODO(devlin): Technically, this could be wrong if the extension no longer |
| 21 // wants to run, was unloaded, etc. We should update this. |
| 22 return true; |
| 23 } |
| 24 |
| 25 bool BlockedActionBubbleDelegate::ShouldCloseOnDeactivate() { |
| 26 return true; |
| 27 } |
| 28 |
| 19 base::string16 BlockedActionBubbleDelegate::GetHeadingText() { | 29 base::string16 BlockedActionBubbleDelegate::GetHeadingText() { |
| 20 return l10n_util::GetStringUTF16(IDS_EXTENSION_BLOCKED_ACTION_BUBBLE_HEADING); | 30 return l10n_util::GetStringUTF16(IDS_EXTENSION_BLOCKED_ACTION_BUBBLE_HEADING); |
| 21 } | 31 } |
| 22 | 32 |
| 23 base::string16 BlockedActionBubbleDelegate::GetBodyText() { | 33 base::string16 BlockedActionBubbleDelegate::GetBodyText( |
| 34 bool anchored_to_action) { |
| 24 return l10n_util::GetStringUTF16(IDS_EXTENSION_BLOCKED_ACTION_BUBBLE_CONTENT); | 35 return l10n_util::GetStringUTF16(IDS_EXTENSION_BLOCKED_ACTION_BUBBLE_CONTENT); |
| 25 } | 36 } |
| 26 | 37 |
| 27 base::string16 BlockedActionBubbleDelegate::GetItemListText() { | 38 base::string16 BlockedActionBubbleDelegate::GetItemListText() { |
| 28 return base::string16(); // No item list. | 39 return base::string16(); // No item list. |
| 29 } | 40 } |
| 30 | 41 |
| 31 base::string16 BlockedActionBubbleDelegate::GetActionButtonText() { | 42 base::string16 BlockedActionBubbleDelegate::GetActionButtonText() { |
| 32 return l10n_util::GetStringUTF16( | 43 return l10n_util::GetStringUTF16( |
| 33 IDS_EXTENSION_BLOCKED_ACTION_BUBBLE_OK_BUTTON); | 44 IDS_EXTENSION_BLOCKED_ACTION_BUBBLE_OK_BUTTON); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 44 | 55 |
| 45 std::string BlockedActionBubbleDelegate::GetAnchorActionId() { | 56 std::string BlockedActionBubbleDelegate::GetAnchorActionId() { |
| 46 return extension_id_; | 57 return extension_id_; |
| 47 } | 58 } |
| 48 | 59 |
| 49 void BlockedActionBubbleDelegate::OnBubbleShown() {} | 60 void BlockedActionBubbleDelegate::OnBubbleShown() {} |
| 50 | 61 |
| 51 void BlockedActionBubbleDelegate::OnBubbleClosed(CloseAction action) { | 62 void BlockedActionBubbleDelegate::OnBubbleClosed(CloseAction action) { |
| 52 base::ResetAndReturn(&callback_).Run(action); | 63 base::ResetAndReturn(&callback_).Run(action); |
| 53 } | 64 } |
| 65 |
| 66 bool BlockedActionBubbleDelegate::IsExtensionMessageBubble() { |
| 67 return false; |
| 68 } |
| OLD | NEW |