| 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/cocoa/extensions/extension_message_bubble_bridge.h" | 5 #include "chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/extensions/extension_message_bubble_controller.h" | 9 #include "chrome/browser/extensions/extension_message_bubble_controller.h" |
| 10 #include "chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.h" | 10 #include "chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 base::string16 ExtensionMessageBubbleBridge::GetDismissButtonText() { | 39 base::string16 ExtensionMessageBubbleBridge::GetDismissButtonText() { |
| 40 return controller_->delegate()->GetDismissButtonLabel(); | 40 return controller_->delegate()->GetDismissButtonLabel(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 base::string16 ExtensionMessageBubbleBridge::GetLearnMoreButtonText() { | 43 base::string16 ExtensionMessageBubbleBridge::GetLearnMoreButtonText() { |
| 44 return controller_->delegate()->GetLearnMoreLabel(); | 44 return controller_->delegate()->GetLearnMoreLabel(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 std::string ExtensionMessageBubbleBridge::GetAnchorActionId() { |
| 48 return controller_->GetExtensionIdList().size() == 1u ? |
| 49 controller_->GetExtensionIdList()[0] : std::string(); |
| 50 } |
| 51 |
| 47 void ExtensionMessageBubbleBridge::OnBubbleShown() { | 52 void ExtensionMessageBubbleBridge::OnBubbleShown() { |
| 48 } | 53 } |
| 49 | 54 |
| 50 void ExtensionMessageBubbleBridge::OnBubbleClosed(CloseAction action) { | 55 void ExtensionMessageBubbleBridge::OnBubbleClosed(CloseAction action) { |
| 51 switch(action) { | 56 switch(action) { |
| 52 case CLOSE_DISMISS_USER_ACTION: | 57 case CLOSE_DISMISS_USER_ACTION: |
| 53 case CLOSE_DISMISS_DEACTIVATION: { | 58 case CLOSE_DISMISS_DEACTIVATION: { |
| 54 bool close_by_deactivate = action == CLOSE_DISMISS_DEACTIVATION; | 59 bool close_by_deactivate = action == CLOSE_DISMISS_DEACTIVATION; |
| 55 controller_->OnBubbleDismiss(close_by_deactivate); | 60 controller_->OnBubbleDismiss(close_by_deactivate); |
| 56 break; | 61 break; |
| 57 } | 62 } |
| 58 case CLOSE_EXECUTE: | 63 case CLOSE_EXECUTE: |
| 59 controller_->OnBubbleAction(); | 64 controller_->OnBubbleAction(); |
| 60 break; | 65 break; |
| 61 case CLOSE_LEARN_MORE: | 66 case CLOSE_LEARN_MORE: |
| 62 controller_->OnLinkClicked(); | 67 controller_->OnLinkClicked(); |
| 63 break; | 68 break; |
| 64 } | 69 } |
| 65 } | 70 } |
| OLD | NEW |