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