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 27 matching lines...) Expand all Loading... |
38 virtual ~DevModeBubbleDelegate(); | 38 virtual ~DevModeBubbleDelegate(); |
39 | 39 |
40 // ExtensionMessageBubbleController::Delegate methods. | 40 // ExtensionMessageBubbleController::Delegate methods. |
41 virtual bool ShouldIncludeExtension(const std::string& extension_id) OVERRIDE; | 41 virtual bool ShouldIncludeExtension(const std::string& extension_id) OVERRIDE; |
42 virtual void AcknowledgeExtension( | 42 virtual void AcknowledgeExtension( |
43 const std::string& extension_id, | 43 const std::string& extension_id, |
44 ExtensionMessageBubbleController::BubbleAction user_action) OVERRIDE; | 44 ExtensionMessageBubbleController::BubbleAction user_action) OVERRIDE; |
45 virtual void PerformAction(const ExtensionIdList& list) OVERRIDE; | 45 virtual void PerformAction(const ExtensionIdList& list) OVERRIDE; |
46 virtual void OnClose() OVERRIDE; | 46 virtual void OnClose() OVERRIDE; |
47 virtual base::string16 GetTitle() const OVERRIDE; | 47 virtual base::string16 GetTitle() const OVERRIDE; |
48 virtual base::string16 GetMessageBody() const OVERRIDE; | 48 virtual base::string16 GetMessageBody( |
| 49 bool anchored_to_browser_action) const OVERRIDE; |
49 virtual base::string16 GetOverflowText( | 50 virtual base::string16 GetOverflowText( |
50 const base::string16& overflow_count) const OVERRIDE; | 51 const base::string16& overflow_count) const OVERRIDE; |
51 virtual base::string16 GetLearnMoreLabel() const OVERRIDE; | 52 virtual base::string16 GetLearnMoreLabel() const OVERRIDE; |
52 virtual GURL GetLearnMoreUrl() const OVERRIDE; | 53 virtual GURL GetLearnMoreUrl() const OVERRIDE; |
53 virtual base::string16 GetActionButtonLabel() const OVERRIDE; | 54 virtual base::string16 GetActionButtonLabel() const OVERRIDE; |
54 virtual base::string16 GetDismissButtonLabel() const OVERRIDE; | 55 virtual base::string16 GetDismissButtonLabel() const OVERRIDE; |
55 virtual bool ShouldShowExtensionList() const OVERRIDE; | 56 virtual bool ShouldShowExtensionList() const OVERRIDE; |
56 virtual void LogExtensionCount(size_t count) OVERRIDE; | 57 virtual void LogExtensionCount(size_t count) OVERRIDE; |
57 virtual void LogAction( | 58 virtual void LogAction( |
58 ExtensionMessageBubbleController::BubbleAction action) OVERRIDE; | 59 ExtensionMessageBubbleController::BubbleAction action) OVERRIDE; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 void DevModeBubbleDelegate::OnClose() { | 96 void DevModeBubbleDelegate::OnClose() { |
96 ExtensionToolbarModel* toolbar_model = ExtensionToolbarModel::Get(profile_); | 97 ExtensionToolbarModel* toolbar_model = ExtensionToolbarModel::Get(profile_); |
97 if (toolbar_model) | 98 if (toolbar_model) |
98 toolbar_model->StopHighlighting(); | 99 toolbar_model->StopHighlighting(); |
99 } | 100 } |
100 | 101 |
101 base::string16 DevModeBubbleDelegate::GetTitle() const { | 102 base::string16 DevModeBubbleDelegate::GetTitle() const { |
102 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_TITLE); | 103 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_TITLE); |
103 } | 104 } |
104 | 105 |
105 base::string16 DevModeBubbleDelegate::GetMessageBody() const { | 106 base::string16 DevModeBubbleDelegate::GetMessageBody( |
| 107 bool anchored_to_browser_action) const { |
106 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_BODY); | 108 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_BODY); |
107 } | 109 } |
108 | 110 |
109 base::string16 DevModeBubbleDelegate::GetOverflowText( | 111 base::string16 DevModeBubbleDelegate::GetOverflowText( |
110 const base::string16& overflow_count) const { | 112 const base::string16& overflow_count) const { |
111 return l10n_util::GetStringFUTF16( | 113 return l10n_util::GetStringFUTF16( |
112 IDS_EXTENSIONS_DISABLED_AND_N_MORE, | 114 IDS_EXTENSIONS_DISABLED_AND_N_MORE, |
113 overflow_count); | 115 overflow_count); |
114 } | 116 } |
115 | 117 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && | 180 return !g_shown_for_profiles.Get().count(profile_->GetOriginalProfile()) && |
179 !GetExtensionList().empty(); | 181 !GetExtensionList().empty(); |
180 } | 182 } |
181 | 183 |
182 void DevModeBubbleController::Show(ExtensionMessageBubble* bubble) { | 184 void DevModeBubbleController::Show(ExtensionMessageBubble* bubble) { |
183 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); | 185 g_shown_for_profiles.Get().insert(profile_->GetOriginalProfile()); |
184 ExtensionMessageBubbleController::Show(bubble); | 186 ExtensionMessageBubbleController::Show(bubble); |
185 } | 187 } |
186 | 188 |
187 } // namespace extensions | 189 } // namespace extensions |
OLD | NEW |