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

Side by Side Diff: extensions/common/permissions/permission_message_provider.cc

Issue 1106613005: Extensions: Switch to new permission message system, part IV (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 8 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
« no previous file with comments | « chrome/common/extensions/permissions/permission_set_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "extensions/common/permissions/permission_message_provider.h" 5 #include "extensions/common/permissions/permission_message_provider.h"
6 6
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/strings/string_split.h" 8 #include "base/strings/string_split.h"
9 #include "extensions/common/extensions_client.h" 9 #include "extensions/common/extensions_client.h"
10 10
11 namespace extensions { 11 namespace extensions {
12 12
13 namespace { 13 namespace {
14 14
15 ForceForTesting g_force_permission_system_for_testing = 15 ForceForTesting g_force_permission_system_for_testing =
16 ForceForTesting::DONT_FORCE; 16 ForceForTesting::DONT_FORCE;
17 17
18 bool IsNewPermissionMessageSystemEnabled() { 18 bool IsNewPermissionMessageSystemEnabled() {
19 if (g_force_permission_system_for_testing != ForceForTesting::DONT_FORCE) 19 if (g_force_permission_system_for_testing != ForceForTesting::DONT_FORCE)
20 return g_force_permission_system_for_testing == ForceForTesting::FORCE_NEW; 20 return g_force_permission_system_for_testing == ForceForTesting::FORCE_NEW;
21 const std::string group_name = 21 const std::string group_name =
22 base::FieldTrialList::FindFullName("PermissionMessageSystem"); 22 base::FieldTrialList::FindFullName("PermissionMessageSystem");
23 return group_name == "NewSystem"; 23 return group_name != "OldSystem";
24 } 24 }
25 25
26 } // namespace 26 } // namespace
27 27
28 void ForcePermissionMessageSystemForTesting( 28 void ForcePermissionMessageSystemForTesting(
29 ForceForTesting force) { 29 ForceForTesting force) {
30 g_force_permission_system_for_testing = force; 30 g_force_permission_system_for_testing = force;
31 } 31 }
32 32
33 PermissionMessageString::PermissionMessageString( 33 PermissionMessageString::PermissionMessageString(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 std::vector<base::string16> details = 75 std::vector<base::string16> details =
76 GetLegacyWarningMessagesDetails(permissions, extension_type); 76 GetLegacyWarningMessagesDetails(permissions, extension_type);
77 DCHECK_EQ(messages.size(), details.size()); 77 DCHECK_EQ(messages.size(), details.size());
78 for (size_t i = 0; i < messages.size(); i++) 78 for (size_t i = 0; i < messages.size(); i++)
79 strings.push_back(PermissionMessageString(messages[i], details[i])); 79 strings.push_back(PermissionMessageString(messages[i], details[i]));
80 } 80 }
81 return strings; 81 return strings;
82 } 82 }
83 83
84 } // namespace extensions 84 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/permissions/permission_set_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698