OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ui/webui/plugins/plugins_handler.h" | 5 #include "chrome/browser/ui/webui/plugins/plugins_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // Callback function to process result of EnablePlugin method. | 43 // Callback function to process result of EnablePlugin method. |
44 void AssertPluginEnabled(bool did_enable) { | 44 void AssertPluginEnabled(bool did_enable) { |
45 DCHECK(did_enable); | 45 DCHECK(did_enable); |
46 } | 46 } |
47 | 47 |
48 base::string16 PluginTypeToString(int type) { | 48 base::string16 PluginTypeToString(int type) { |
49 // The type is stored as an |int|, but doing the switch on the right | 49 // The type is stored as an |int|, but doing the switch on the right |
50 // enumeration type gives us better build-time error checking (if someone adds | 50 // enumeration type gives us better build-time error checking (if someone adds |
51 // a new type). | 51 // a new type). |
52 switch (static_cast<WebPluginInfo::PluginType>(type)) { | 52 switch (static_cast<WebPluginInfo::PluginType>(type)) { |
53 case WebPluginInfo::PLUGIN_TYPE_NPAPI: | |
54 return l10n_util::GetStringUTF16(IDS_PLUGINS_NPAPI); | |
55 case WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS: | 53 case WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS: |
56 return l10n_util::GetStringUTF16(IDS_PLUGINS_PPAPI_IN_PROCESS); | 54 return l10n_util::GetStringUTF16(IDS_PLUGINS_PPAPI_IN_PROCESS); |
57 case WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS: | 55 case WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS: |
58 return l10n_util::GetStringUTF16(IDS_PLUGINS_PPAPI_OUT_OF_PROCESS); | 56 return l10n_util::GetStringUTF16(IDS_PLUGINS_PPAPI_OUT_OF_PROCESS); |
59 case WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN: | 57 case WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN: |
60 return l10n_util::GetStringUTF16(IDS_PLUGINS_BROWSER_PLUGIN); | 58 return l10n_util::GetStringUTF16(IDS_PLUGINS_BROWSER_PLUGIN); |
61 } | 59 } |
62 NOTREACHED(); | 60 NOTREACHED(); |
63 return base::string16(); | 61 return base::string16(); |
64 } | 62 } |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } | 342 } |
345 | 343 |
346 if (plugins_enabled_by_policy) | 344 if (plugins_enabled_by_policy) |
347 return "enabledByPolicy"; | 345 return "enabledByPolicy"; |
348 if (plugins_disabled_by_policy) | 346 if (plugins_disabled_by_policy) |
349 return "disabledByPolicy"; | 347 return "disabledByPolicy"; |
350 if (plugins_managed_by_policy) | 348 if (plugins_managed_by_policy) |
351 return "managedByPolicy"; | 349 return "managedByPolicy"; |
352 return group_enabled ? "enabledByUser" : "disabledByUser"; | 350 return group_enabled ? "enabledByUser" : "disabledByUser"; |
353 } | 351 } |
OLD | NEW |