Chromium Code Reviews| Index: chrome/browser/ui/toolbar/toolbar_actions_bar.cc | 
| diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc | 
| index bfba919f5df5db2caf2426ceac1ecfb07b9de244..b29b8c86cc3ed109efcfdc36bdfa4e8412b2676a 100644 | 
| --- a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc | 
| +++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc | 
| @@ -17,6 +17,7 @@ | 
| #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" | 
| #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" | 
| #include "chrome/browser/ui/toolbar/toolbar_actions_bar_delegate.h" | 
| +#include "chrome/common/pref_names.h" | 
| #include "components/crx_file/id_util.h" | 
| #include "extensions/browser/extension_system.h" | 
| #include "extensions/browser/runtime_data.h" | 
| @@ -667,7 +668,31 @@ void ToolbarActionsBar::OnDragDrop(int dragged_index, | 
| } | 
| bool ToolbarActionsBar::ShouldShowInfoBubble() { | 
| - return false; | 
| + // If the redesign isn't running, or the user has already acknowledged it, | 
| + // we don't show the bubble. | 
| + PrefService* prefs = browser_->profile()->GetPrefs(); | 
| + if (!extensions::FeatureSwitch::extension_action_redesign()->IsEnabled() || | 
| + (prefs->HasPrefPath(prefs::kToolbarIconSurfacingBubbleAcknowledged) && | 
| + prefs->GetBoolean(prefs::kToolbarIconSurfacingBubbleAcknowledged))) | 
| + return false; | 
| + | 
| + // We don't show more than once per day. | 
| + if (prefs->HasPrefPath(prefs::kToolbarIconSurfacingBubbleLastShowTime)) { | 
| + base::Time last_shown_time = base::Time::FromInternalValue( | 
| + prefs->GetInt64(prefs::kToolbarIconSurfacingBubbleLastShowTime)); | 
| + if (base::Time::Now() - last_shown_time < base::TimeDelta::FromDays(1)) | 
| + return false; | 
| + } | 
| + | 
| + if (!model_->RedesignIsShowingNewIcons()) { | 
| + // We only show the bubble if there are any new icons present - otherwise, | 
| + // the user won't see anything different. | 
| + browser_->profile()->GetPrefs()->SetBoolean( | 
| + prefs::kToolbarIconSurfacingBubbleAcknowledged, true); | 
| + return false; | 
| + } | 
| + | 
| + return true; | 
| } | 
| void ToolbarActionsBar::OnToolbarExtensionAdded( | 
| @@ -833,7 +858,18 @@ Browser* ToolbarActionsBar::GetBrowser() { | 
| return browser_; | 
| } | 
| +void ToolbarActionsBar::OnToolbarActionsBarBubbleShown() { | 
| + // Record the last time the bubble was shown. | 
| + browser_->profile()->GetPrefs()->SetInt64( | 
| + prefs::kToolbarIconSurfacingBubbleLastShowTime, | 
| + base::Time::Now().ToInternalValue()); | 
| +} | 
| + | 
| void ToolbarActionsBar::OnToolbarActionsBarBubbleClosed(CloseAction action) { | 
| + if (action == ToolbarActionsBarBubbleDelegate::ACKNOWLEDGED) { | 
| + browser_->profile()->GetPrefs()->SetBoolean( | 
| + prefs::kToolbarIconSurfacingBubbleAcknowledged, true); | 
| 
 
Finnur
2015/03/13 10:54:53
Once you set this to true, there's no longer a nee
 
Devlin
2015/03/13 16:33:28
Good call; we can definitely clear the pref.
I do
 
 | 
| + } | 
| } | 
| void ToolbarActionsBar::ReorderActions() { |