| 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_toolbar_icon_surfacing_bubble_d
elegate.h" | 5 #include "chrome/browser/ui/extensions/extension_toolbar_icon_surfacing_bubble_d
elegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" | 10 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 base::string16 | 84 base::string16 |
| 85 ExtensionToolbarIconSurfacingBubbleDelegate::GetDismissButtonText() { | 85 ExtensionToolbarIconSurfacingBubbleDelegate::GetDismissButtonText() { |
| 86 return base::string16(); // No dismiss button. | 86 return base::string16(); // No dismiss button. |
| 87 } | 87 } |
| 88 | 88 |
| 89 base::string16 | 89 base::string16 |
| 90 ExtensionToolbarIconSurfacingBubbleDelegate::GetLearnMoreButtonText() { | 90 ExtensionToolbarIconSurfacingBubbleDelegate::GetLearnMoreButtonText() { |
| 91 return base::string16(); // No learn more link. | 91 return base::string16(); // No learn more link. |
| 92 } | 92 } |
| 93 | 93 |
| 94 std::string ExtensionToolbarIconSurfacingBubbleDelegate::GetAnchorActionId() { |
| 95 return std::string(); // Point to the whole set of actions. |
| 96 } |
| 97 |
| 94 void ExtensionToolbarIconSurfacingBubbleDelegate::OnBubbleShown() { | 98 void ExtensionToolbarIconSurfacingBubbleDelegate::OnBubbleShown() { |
| 95 // Record the last time the bubble was shown. | 99 // Record the last time the bubble was shown. |
| 96 profile_->GetPrefs()->SetInt64( | 100 profile_->GetPrefs()->SetInt64( |
| 97 prefs::kToolbarIconSurfacingBubbleLastShowTime, | 101 prefs::kToolbarIconSurfacingBubbleLastShowTime, |
| 98 base::Time::Now().ToInternalValue()); | 102 base::Time::Now().ToInternalValue()); |
| 99 } | 103 } |
| 100 | 104 |
| 101 void ExtensionToolbarIconSurfacingBubbleDelegate::OnBubbleClosed( | 105 void ExtensionToolbarIconSurfacingBubbleDelegate::OnBubbleClosed( |
| 102 CloseAction action) { | 106 CloseAction action) { |
| 103 if (action == CLOSE_EXECUTE) | 107 if (action == CLOSE_EXECUTE) |
| 104 AcknowledgeInPrefs(profile_->GetPrefs()); | 108 AcknowledgeInPrefs(profile_->GetPrefs()); |
| 105 ToolbarActionsModel::Get(profile_)->StopHighlighting(); | 109 ToolbarActionsModel::Get(profile_)->StopHighlighting(); |
| 106 } | 110 } |
| OLD | NEW |