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

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

Issue 328943002: Change topSites API permission warning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months 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
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/chrome_permission_message_provide r.h" 5 #include "chrome/common/extensions/permissions/chrome_permission_message_provide r.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "extensions/common/extensions_client.h" 9 #include "extensions/common/extensions_client.h"
10 #include "extensions/common/permissions/permission_message.h" 10 #include "extensions/common/permissions/permission_message.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 continue; 157 continue;
158 } else if (id == PermissionMessage::kMediaGalleriesAllGalleriesCopyTo || 158 } else if (id == PermissionMessage::kMediaGalleriesAllGalleriesCopyTo ||
159 id == PermissionMessage::kMediaGalleriesAllGalleriesDelete) { 159 id == PermissionMessage::kMediaGalleriesAllGalleriesDelete) {
160 // The combined message will be pushed above. 160 // The combined message will be pushed above.
161 continue; 161 continue;
162 } 162 }
163 } 163 }
164 if (permissions->HasAPIPermission(APIPermission::kSessions) && 164 if (permissions->HasAPIPermission(APIPermission::kSessions) &&
165 id == PermissionMessage::kTabs) { 165 id == PermissionMessage::kTabs) {
166 message_strings.push_back(l10n_util::GetStringUTF16( 166 message_strings.push_back(l10n_util::GetStringUTF16(
167 IDS_EXTENSION_PROMPT_WARNING_TABS_AND_SESSIONS)); 167 IDS_EXTENSION_PROMPT_WARNING_HISTORY_READ_AND_SESSIONS));
168 continue; 168 continue;
169 } 169 }
170 if (permissions->HasAPIPermission(APIPermission::kSessions) && 170 if (permissions->HasAPIPermission(APIPermission::kSessions) &&
171 id == PermissionMessage::kBrowsingHistory) { 171 id == PermissionMessage::kBrowsingHistory) {
172 message_strings.push_back(l10n_util::GetStringUTF16( 172 message_strings.push_back(l10n_util::GetStringUTF16(
173 IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY_AND_SESSIONS)); 173 IDS_EXTENSION_PROMPT_WARNING_HISTORY_WRITE_AND_SESSIONS));
174 continue; 174 continue;
175 } 175 }
176 176
177 message_strings.push_back(i->message()); 177 message_strings.push_back(i->message());
178 } 178 }
179 179
180 return message_strings; 180 return message_strings;
181 } 181 }
182 182
183 std::vector<base::string16> 183 std::vector<base::string16>
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 std::set<std::string> old_hosts_set( 367 std::set<std::string> old_hosts_set(
368 permission_message_util::GetDistinctHosts(old_list, false, false)); 368 permission_message_util::GetDistinctHosts(old_list, false, false));
369 std::set<std::string> new_hosts_only = 369 std::set<std::string> new_hosts_only =
370 base::STLSetDifference<std::set<std::string> >(new_hosts_set, 370 base::STLSetDifference<std::set<std::string> >(new_hosts_set,
371 old_hosts_set); 371 old_hosts_set);
372 372
373 return !new_hosts_only.empty(); 373 return !new_hosts_only.empty();
374 } 374 }
375 375
376 } // namespace extensions 376 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698