OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/extensions/dev_mode_bubble_controller.h" | 5 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/browser/extensions/extension_action_manager.h" | 9 #include "chrome/browser/extensions/extension_action_manager.h" |
10 #include "chrome/browser/extensions/extension_message_bubble.h" | 10 #include "chrome/browser/extensions/extension_message_bubble.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 explicit DevModeBubbleDelegate(Profile* profile); | 34 explicit DevModeBubbleDelegate(Profile* profile); |
35 ~DevModeBubbleDelegate() override; | 35 ~DevModeBubbleDelegate() override; |
36 | 36 |
37 // ExtensionMessageBubbleController::Delegate methods. | 37 // ExtensionMessageBubbleController::Delegate methods. |
38 bool ShouldIncludeExtension(const std::string& extension_id) override; | 38 bool ShouldIncludeExtension(const std::string& extension_id) override; |
39 void AcknowledgeExtension( | 39 void AcknowledgeExtension( |
40 const std::string& extension_id, | 40 const std::string& extension_id, |
41 ExtensionMessageBubbleController::BubbleAction user_action) override; | 41 ExtensionMessageBubbleController::BubbleAction user_action) override; |
42 void PerformAction(const ExtensionIdList& list) override; | 42 void PerformAction(const ExtensionIdList& list) override; |
43 base::string16 GetTitle() const override; | 43 base::string16 GetTitle() const override; |
44 base::string16 GetMessageBody(bool anchored_to_browser_action) const override; | 44 base::string16 GetMessageBody(bool anchored_to_browser_action, |
| 45 bool for_single_extension) const override; |
45 base::string16 GetOverflowText( | 46 base::string16 GetOverflowText( |
46 const base::string16& overflow_count) const override; | 47 const base::string16& overflow_count) const override; |
47 GURL GetLearnMoreUrl() const override; | 48 GURL GetLearnMoreUrl() const override; |
48 base::string16 GetActionButtonLabel() const override; | 49 base::string16 GetActionButtonLabel() const override; |
49 base::string16 GetDismissButtonLabel() const override; | 50 base::string16 GetDismissButtonLabel() const override; |
50 bool ShouldShowExtensionList() const override; | 51 bool ShouldShowExtensionList() const override; |
51 bool ShouldHighlightExtensions() const override; | 52 bool ShouldHighlightExtensions() const override; |
52 void LogExtensionCount(size_t count) override; | 53 void LogExtensionCount(size_t count) override; |
53 void LogAction( | 54 void LogAction( |
54 ExtensionMessageBubbleController::BubbleAction action) override; | 55 ExtensionMessageBubbleController::BubbleAction action) override; |
(...skipping 30 matching lines...) Expand all Loading... |
85 void DevModeBubbleDelegate::PerformAction(const ExtensionIdList& list) { | 86 void DevModeBubbleDelegate::PerformAction(const ExtensionIdList& list) { |
86 for (size_t i = 0; i < list.size(); ++i) | 87 for (size_t i = 0; i < list.size(); ++i) |
87 service_->DisableExtension(list[i], Extension::DISABLE_USER_ACTION); | 88 service_->DisableExtension(list[i], Extension::DISABLE_USER_ACTION); |
88 } | 89 } |
89 | 90 |
90 base::string16 DevModeBubbleDelegate::GetTitle() const { | 91 base::string16 DevModeBubbleDelegate::GetTitle() const { |
91 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_TITLE); | 92 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_TITLE); |
92 } | 93 } |
93 | 94 |
94 base::string16 DevModeBubbleDelegate::GetMessageBody( | 95 base::string16 DevModeBubbleDelegate::GetMessageBody( |
95 bool anchored_to_browser_action) const { | 96 bool anchored_to_browser_action, |
| 97 bool for_single_extension) const { |
96 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_BODY); | 98 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_BODY); |
97 } | 99 } |
98 | 100 |
99 base::string16 DevModeBubbleDelegate::GetOverflowText( | 101 base::string16 DevModeBubbleDelegate::GetOverflowText( |
100 const base::string16& overflow_count) const { | 102 const base::string16& overflow_count) const { |
101 return l10n_util::GetStringFUTF16( | 103 return l10n_util::GetStringFUTF16( |
102 IDS_EXTENSIONS_DISABLED_AND_N_MORE, | 104 IDS_EXTENSIONS_DISABLED_AND_N_MORE, |
103 overflow_count); | 105 overflow_count); |
104 } | 106 } |
105 | 107 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && | 159 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && |
158 !GetExtensionList().empty(); | 160 !GetExtensionList().empty(); |
159 } | 161 } |
160 | 162 |
161 void DevModeBubbleController::Show(ExtensionMessageBubble* bubble) { | 163 void DevModeBubbleController::Show(ExtensionMessageBubble* bubble) { |
162 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); | 164 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); |
163 ExtensionMessageBubbleController::Show(bubble); | 165 ExtensionMessageBubbleController::Show(bubble); |
164 } | 166 } |
165 | 167 |
166 } // namespace extensions | 168 } // namespace extensions |
OLD | NEW |