Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: chrome/common/extensions/permissions/permission_message_util.cc

Issue 105473003: Add explicit base namespace to string16 users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/common/extensions/permissions/permission_message_util.h" 5 #include "chrome/common/extensions/permissions/permission_message_util.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/public/common/url_constants.h" 9 #include "content/public/common/url_constants.h"
10 #include "extensions/common/permissions/permission_message.h" 10 #include "extensions/common/permissions/permission_message.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 } // namespace 36 } // namespace
37 37
38 namespace permission_message_util { 38 namespace permission_message_util {
39 39
40 PermissionMessage CreateFromHostList(const std::set<std::string>& hosts) { 40 PermissionMessage CreateFromHostList(const std::set<std::string>& hosts) {
41 std::vector<std::string> host_list(hosts.begin(), hosts.end()); 41 std::vector<std::string> host_list(hosts.begin(), hosts.end());
42 DCHECK(host_list.size()); 42 DCHECK(host_list.size());
43 PermissionMessage::ID message_id; 43 PermissionMessage::ID message_id;
44 string16 message; 44 base::string16 message;
45 string16 details; 45 base::string16 details;
46 46
47 switch (host_list.size()) { 47 switch (host_list.size()) {
48 case 1: 48 case 1:
49 message_id = PermissionMessage::kHosts1; 49 message_id = PermissionMessage::kHosts1;
50 message = l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT_WARNING_1_HOST, 50 message = l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT_WARNING_1_HOST,
51 UTF8ToUTF16(host_list[0])); 51 UTF8ToUTF16(host_list[0]));
52 break; 52 break;
53 case 2: 53 case 2:
54 message_id = PermissionMessage::kHosts2; 54 message_id = PermissionMessage::kHosts2;
55 message = l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT_WARNING_2_HOSTS, 55 message = l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT_WARNING_2_HOSTS,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 // Build up the final vector by concatenating hosts and RCDs. 142 // Build up the final vector by concatenating hosts and RCDs.
143 std::set<std::string> distinct_hosts; 143 std::set<std::string> distinct_hosts;
144 for (HostVector::iterator it = hosts_best_rcd.begin(); 144 for (HostVector::iterator it = hosts_best_rcd.begin();
145 it != hosts_best_rcd.end(); ++it) 145 it != hosts_best_rcd.end(); ++it)
146 distinct_hosts.insert(it->first + it->second); 146 distinct_hosts.insert(it->first + it->second);
147 return distinct_hosts; 147 return distinct_hosts;
148 } 148 }
149 149
150 } // namespace permission_message_util 150 } // namespace permission_message_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698