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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 const std::string& extension_id, | 82 const std::string& extension_id, |
83 ExtensionMessageBubbleController::BubbleAction user_action) { | 83 ExtensionMessageBubbleController::BubbleAction user_action) { |
84 } | 84 } |
85 | 85 |
86 void DevModeBubbleController::PerformAction( | 86 void DevModeBubbleController::PerformAction( |
87 const ExtensionIdList& list) { | 87 const ExtensionIdList& list) { |
88 for (size_t i = 0; i < list.size(); ++i) | 88 for (size_t i = 0; i < list.size(); ++i) |
89 service_->DisableExtension(list[i], Extension::DISABLE_USER_ACTION); | 89 service_->DisableExtension(list[i], Extension::DISABLE_USER_ACTION); |
90 } | 90 } |
91 | 91 |
92 string16 DevModeBubbleController::GetTitle() const { | 92 base::string16 DevModeBubbleController::GetTitle() const { |
93 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_TITLE); | 93 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_TITLE); |
94 } | 94 } |
95 | 95 |
96 string16 DevModeBubbleController::GetMessageBody() const { | 96 base::string16 DevModeBubbleController::GetMessageBody() const { |
97 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_BODY); | 97 return l10n_util::GetStringUTF16(IDS_EXTENSIONS_DISABLE_DEVELOPER_MODE_BODY); |
98 } | 98 } |
99 | 99 |
100 string16 DevModeBubbleController::GetOverflowText( | 100 base::string16 DevModeBubbleController::GetOverflowText( |
101 const string16& overflow_count) const { | 101 const base::string16& overflow_count) const { |
102 return l10n_util::GetStringFUTF16( | 102 return l10n_util::GetStringFUTF16( |
103 IDS_EXTENSIONS_SUSPICIOUS_DISABLED_AND_N_MORE, | 103 IDS_EXTENSIONS_SUSPICIOUS_DISABLED_AND_N_MORE, |
104 overflow_count); | 104 overflow_count); |
105 } | 105 } |
106 | 106 |
107 string16 DevModeBubbleController::GetLearnMoreLabel() const { | 107 base::string16 DevModeBubbleController::GetLearnMoreLabel() const { |
108 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 108 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
109 } | 109 } |
110 | 110 |
111 GURL DevModeBubbleController::GetLearnMoreUrl() const { | 111 GURL DevModeBubbleController::GetLearnMoreUrl() const { |
112 return GURL(chrome::kChromeUIExtensionsURL); | 112 return GURL(chrome::kChromeUIExtensionsURL); |
113 } | 113 } |
114 | 114 |
115 string16 DevModeBubbleController::GetActionButtonLabel() const { | 115 base::string16 DevModeBubbleController::GetActionButtonLabel() const { |
116 return l10n_util::GetStringUTF16(IDS_DISABLE); | 116 return l10n_util::GetStringUTF16(IDS_DISABLE); |
117 } | 117 } |
118 | 118 |
119 string16 DevModeBubbleController::GetDismissButtonLabel() const { | 119 base::string16 DevModeBubbleController::GetDismissButtonLabel() const { |
120 return l10n_util::GetStringUTF16(IDS_CANCEL); | 120 return l10n_util::GetStringUTF16(IDS_CANCEL); |
121 } | 121 } |
122 | 122 |
123 bool DevModeBubbleController::ShouldShowExtensionList() const { | 123 bool DevModeBubbleController::ShouldShowExtensionList() const { |
124 return false; | 124 return false; |
125 } | 125 } |
126 | 126 |
127 std::vector<string16> DevModeBubbleController::GetExtensions() { | 127 std::vector<base::string16> DevModeBubbleController::GetExtensions() { |
128 return GetExtensionList(); | 128 return GetExtensionList(); |
129 } | 129 } |
130 | 130 |
131 void DevModeBubbleController::LogExtensionCount(size_t count) { | 131 void DevModeBubbleController::LogExtensionCount(size_t count) { |
132 UMA_HISTOGRAM_COUNTS_100( | 132 UMA_HISTOGRAM_COUNTS_100( |
133 "DevModeExtensionBubble.ExtensionsInDevModeCount", count); | 133 "DevModeExtensionBubble.ExtensionsInDevModeCount", count); |
134 } | 134 } |
135 | 135 |
136 void DevModeBubbleController::LogAction( | 136 void DevModeBubbleController::LogAction( |
137 ExtensionMessageBubbleController::BubbleAction action) { | 137 ExtensionMessageBubbleController::BubbleAction action) { |
138 UMA_HISTOGRAM_ENUMERATION( | 138 UMA_HISTOGRAM_ENUMERATION( |
139 "DevModeExtensionBubble.UserSelection", | 139 "DevModeExtensionBubble.UserSelection", |
140 action, ExtensionMessageBubbleController::ACTION_BOUNDARY); | 140 action, ExtensionMessageBubbleController::ACTION_BOUNDARY); |
141 } | 141 } |
142 | 142 |
143 template <> | 143 template <> |
144 void ProfileKeyedAPIFactory< | 144 void ProfileKeyedAPIFactory< |
145 DevModeBubbleController>::DeclareFactoryDependencies() { | 145 DevModeBubbleController>::DeclareFactoryDependencies() { |
146 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); | 146 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); |
147 } | 147 } |
148 | 148 |
149 } // namespace extensions | 149 } // namespace extensions |
OLD | NEW |