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/prefs/pref_service.h" | |
9 #include "base/time/time.h" | 8 #include "base/time/time.h" |
10 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" | 10 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" |
12 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 12 #include "components/prefs/pref_service.h" |
13 #include "extensions/common/feature_switch.h" | 13 #include "extensions/common/feature_switch.h" |
14 #include "grit/chromium_strings.h" | 14 #include "grit/chromium_strings.h" |
15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 void AcknowledgeInPrefs(PrefService* prefs) { | 20 void AcknowledgeInPrefs(PrefService* prefs) { |
21 prefs->SetBoolean(prefs::kToolbarIconSurfacingBubbleAcknowledged, true); | 21 prefs->SetBoolean(prefs::kToolbarIconSurfacingBubbleAcknowledged, true); |
22 // Once the bubble is acknowledged, we no longer need to store the last | 22 // Once the bubble is acknowledged, we no longer need to store the last |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 prefs::kToolbarIconSurfacingBubbleLastShowTime, | 97 prefs::kToolbarIconSurfacingBubbleLastShowTime, |
98 base::Time::Now().ToInternalValue()); | 98 base::Time::Now().ToInternalValue()); |
99 } | 99 } |
100 | 100 |
101 void ExtensionToolbarIconSurfacingBubbleDelegate::OnBubbleClosed( | 101 void ExtensionToolbarIconSurfacingBubbleDelegate::OnBubbleClosed( |
102 CloseAction action) { | 102 CloseAction action) { |
103 if (action == CLOSE_EXECUTE) | 103 if (action == CLOSE_EXECUTE) |
104 AcknowledgeInPrefs(profile_->GetPrefs()); | 104 AcknowledgeInPrefs(profile_->GetPrefs()); |
105 ToolbarActionsModel::Get(profile_)->StopHighlighting(); | 105 ToolbarActionsModel::Get(profile_)->StopHighlighting(); |
106 } | 106 } |
OLD | NEW |