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

Side by Side Diff: chrome/browser/plugin_service.cc

Issue 373013: Use GetSwitchValueASCII. (Closed)
Patch Set: Created 11 years, 1 month 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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "chrome/browser/plugin_service.h" 7 #include "chrome/browser/plugin_service.h"
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 PluginService::PluginService() 49 PluginService::PluginService()
50 : main_message_loop_(MessageLoop::current()), 50 : main_message_loop_(MessageLoop::current()),
51 resource_dispatcher_host_(NULL), 51 resource_dispatcher_host_(NULL),
52 ui_locale_(ASCIIToWide(g_browser_process->GetApplicationLocale())) { 52 ui_locale_(ASCIIToWide(g_browser_process->GetApplicationLocale())) {
53 // Have the NPAPI plugin list search for Chrome plugins as well. 53 // Have the NPAPI plugin list search for Chrome plugins as well.
54 ChromePluginLib::RegisterPluginsWithNPAPI(); 54 ChromePluginLib::RegisterPluginsWithNPAPI();
55 // Load the one specified on the command line as well. 55 // Load the one specified on the command line as well.
56 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 56 const CommandLine* command_line = CommandLine::ForCurrentProcess();
57 std::wstring path = command_line->GetSwitchValue(switches::kLoadPlugin); 57 FilePath path = command_line->GetSwitchValuePath(switches::kLoadPlugin);
58 if (!path.empty()) { 58 if (!path.empty()) {
59 NPAPI::PluginList::Singleton()->AddExtraPluginPath( 59 NPAPI::PluginList::Singleton()->AddExtraPluginPath(path);
60 FilePath::FromWStringHack(path));
61 } 60 }
62 #ifndef DISABLE_NACL 61 #ifndef DISABLE_NACL
63 if (command_line->HasSwitch(switches::kInternalNaCl)) 62 if (command_line->HasSwitch(switches::kInternalNaCl))
64 RegisterInternalNaClPlugin(); 63 RegisterInternalNaClPlugin();
65 #endif 64 #endif
66 65
67 #if defined(OS_WIN) 66 #if defined(OS_WIN)
68 hkcu_key_.Create( 67 hkcu_key_.Create(
69 HKEY_CURRENT_USER, kRegistryMozillaPlugins, KEY_NOTIFY); 68 HKEY_CURRENT_USER, kRegistryMozillaPlugins, KEY_NOTIFY);
70 hklm_key_.Create( 69 hklm_key_.Create(
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 PrivatePluginMap::iterator it = private_plugins_.find(plugin_path); 281 PrivatePluginMap::iterator it = private_plugins_.find(plugin_path);
283 if (it == private_plugins_.end()) 282 if (it == private_plugins_.end())
284 return true; // This plugin is not private, so it's allowed everywhere. 283 return true; // This plugin is not private, so it's allowed everywhere.
285 284
286 // We do a dumb compare of scheme and host, rather than using the domain 285 // We do a dumb compare of scheme and host, rather than using the domain
287 // service, since we only care about this for extensions. 286 // service, since we only care about this for extensions.
288 const GURL& required_url = it->second; 287 const GURL& required_url = it->second;
289 return (url.scheme() == required_url.scheme() && 288 return (url.scheme() == required_url.scheme() &&
290 url.host() == required_url.host()); 289 url.host() == required_url.host());
291 } 290 }
OLDNEW
« no previous file with comments | « chrome/browser/plugin_process_host.cc ('k') | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698