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/extension_message_bubble_controller.h" | 5 #include "chrome/browser/extensions/extension_message_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/extensions/extension_message_bubble.h" | 10 #include "chrome/browser/extensions/extension_message_bubble.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 } | 37 } |
38 | 38 |
39 bool ExtensionMessageBubbleController::ShouldShow() { | 39 bool ExtensionMessageBubbleController::ShouldShow() { |
40 if (has_notified_) | 40 if (has_notified_) |
41 return false; | 41 return false; |
42 | 42 |
43 has_notified_ = true; | 43 has_notified_ = true; |
44 return !GetOrCreateExtensionList()->empty(); | 44 return !GetOrCreateExtensionList()->empty(); |
45 } | 45 } |
46 | 46 |
47 std::vector<string16> | 47 std::vector<base::string16> |
48 ExtensionMessageBubbleController::GetExtensionList() { | 48 ExtensionMessageBubbleController::GetExtensionList() { |
49 ExtensionIdList* list = GetOrCreateExtensionList(); | 49 ExtensionIdList* list = GetOrCreateExtensionList(); |
50 if (list->empty()) | 50 if (list->empty()) |
51 return std::vector<string16>(); | 51 return std::vector<base::string16>(); |
52 | 52 |
53 std::vector<string16> return_value; | 53 std::vector<base::string16> return_value; |
54 for (ExtensionIdList::const_iterator it = list->begin(); | 54 for (ExtensionIdList::const_iterator it = list->begin(); |
55 it != list->end(); ++it) { | 55 it != list->end(); ++it) { |
56 const Extension* extension = service_->GetInstalledExtension(*it); | 56 const Extension* extension = service_->GetInstalledExtension(*it); |
57 if (extension) { | 57 if (extension) { |
58 return_value.push_back(UTF8ToUTF16(extension->name())); | 58 return_value.push_back(UTF8ToUTF16(extension->name())); |
59 } else { | 59 } else { |
60 return_value.push_back( | 60 return_value.push_back( |
61 ASCIIToUTF16(std::string("(unknown name) ") + *it)); | 61 ASCIIToUTF16(std::string("(unknown name) ") + *it)); |
62 // TODO(finnur): Add this as a string to the grd, for next milestone. | 62 // TODO(finnur): Add this as a string to the grd, for next milestone. |
63 } | 63 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 145 } |
146 | 146 |
147 delegate_->LogExtensionCount(extension_list_.size()); | 147 delegate_->LogExtensionCount(extension_list_.size()); |
148 initialized_ = true; | 148 initialized_ = true; |
149 } | 149 } |
150 | 150 |
151 return &extension_list_; | 151 return &extension_list_; |
152 } | 152 } |
153 | 153 |
154 } // namespace extensions | 154 } // namespace extensions |
OLD | NEW |