| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/default_plugin/plugin_installer_base.h" | 5 #include "chrome/default_plugin/plugin_installer_base.h" |
| 6 | 6 |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "content/public/common/content_constants.h" | 9 #include "content/public/common/content_constants.h" |
| 10 | 10 |
| 11 PluginInstallerBase::PluginInstallerBase() | 11 PluginInstallerBase::PluginInstallerBase() |
| 12 : renderer_process_id_(0), | 12 : renderer_process_id_(0), |
| 13 render_view_id_(0) { | 13 render_view_id_(0) { |
| 14 } | 14 } |
| 15 | 15 |
| 16 PluginInstallerBase::~PluginInstallerBase() { | 16 PluginInstallerBase::~PluginInstallerBase() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 bool PluginInstallerBase::Initialize(void* module_handle, NPP instance, | 19 void PluginInstallerBase::SetRoutingIds(int16 argc, |
| 20 NPMIMEType mime_type, int16 argc, | 20 char* argn[], |
| 21 char* argn[], char* argv[]) { | 21 char* argv[]) { |
| 22 for (int16_t index = 0; index < argc; ++index) { | 22 for (int16_t index = 0; index < argc; ++index) { |
| 23 if (!base::strncasecmp(argn[index], | 23 if (!base::strncasecmp(argn[index], |
| 24 content::kDefaultPluginRenderProcessId, | 24 content::kDefaultPluginRenderProcessId, |
| 25 strlen(argn[index]))) { | 25 strlen(argn[index]))) { |
| 26 base::StringToInt(argv[index], &renderer_process_id_); | 26 base::StringToInt(argv[index], &renderer_process_id_); |
| 27 } else if (!base::strncasecmp(argn[index], | 27 } else if (!base::strncasecmp(argn[index], |
| 28 content::kDefaultPluginRenderViewId, | 28 content::kDefaultPluginRenderViewId, |
| 29 strlen(argn[index]))) { | 29 strlen(argn[index]))) { |
| 30 base::StringToInt(argv[index], &render_view_id_); | 30 base::StringToInt(argv[index], &render_view_id_); |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 return true; | |
| 34 } | 33 } |
| OLD | NEW |