| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "webkit/default_plugin/plugin_impl_win.h" | 5 #include "webkit/default_plugin/plugin_impl_win.h" |
| 6 | 6 |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 if (underline_font_) | 45 if (underline_font_) |
| 46 DeleteObject(underline_font_); | 46 DeleteObject(underline_font_); |
| 47 | 47 |
| 48 if (tooltip_) | 48 if (tooltip_) |
| 49 DestroyWindow(tooltip_); | 49 DestroyWindow(tooltip_); |
| 50 } | 50 } |
| 51 | 51 |
| 52 bool PluginInstallerImpl::Initialize(HINSTANCE module_handle, NPP instance, | 52 bool PluginInstallerImpl::Initialize(HINSTANCE module_handle, NPP instance, |
| 53 NPMIMEType mime_type, int16 argc, | 53 NPMIMEType mime_type, int16 argc, |
| 54 char* argn[], char* argv[]) { | 54 char* argn[], char* argv[]) { |
| 55 DLOG(INFO) << __FUNCTION__ << " MIME Type : " << mime_type; | 55 DLOG(INFO) << __FUNCTION__ << " Mime Type : " << mime_type; |
| 56 DCHECK(instance != NULL); | 56 DCHECK(instance != NULL); |
| 57 DCHECK(module_handle != NULL); | 57 DCHECK(module_handle != NULL); |
| 58 | 58 |
| 59 if (mime_type == NULL || strlen(mime_type) == 0) { | 59 if (mime_type == NULL || strlen(mime_type) == 0) { |
| 60 DLOG(WARNING) << __FUNCTION__ << " Invalid parameters passed in"; | 60 DLOG(WARNING) << __FUNCTION__ << " Invalid parameters passed in"; |
| 61 NOTREACHED(); | 61 NOTREACHED(); |
| 62 return false; | 62 return false; |
| 63 } | 63 } |
| 64 | 64 |
| 65 instance_ = instance; | 65 instance_ = instance; |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 if (replacement_string.empty()) { | 280 if (replacement_string.empty()) { |
| 281 return webkit_glue::GetLocalizedString(messsage_id_without_placeholders); | 281 return webkit_glue::GetLocalizedString(messsage_id_without_placeholders); |
| 282 } else { | 282 } else { |
| 283 std::wstring string_with_placeholders = | 283 std::wstring string_with_placeholders = |
| 284 webkit_glue::GetLocalizedString(message_id_with_placeholders); | 284 webkit_glue::GetLocalizedString(message_id_with_placeholders); |
| 285 return ReplaceStringPlaceholders(string_with_placeholders, | 285 return ReplaceStringPlaceholders(string_with_placeholders, |
| 286 replacement_string, NULL); | 286 replacement_string, NULL); |
| 287 } | 287 } |
| 288 } | 288 } |
| 289 | 289 |
| 290 bool PluginInstallerImpl::NPP_SetWindow(NPWindow* window_info) { | 290 bool PluginInstallerImpl::SetWindow(HWND parent_window) { |
| 291 HWND parent_window = reinterpret_cast<HWND>(window_info->window); | |
| 292 if (!IsWindow(parent_window)) { | 291 if (!IsWindow(parent_window)) { |
| 293 // No window created yet. Ignore this call. | 292 // No window created yet. Ignore this call. |
| 294 if (!IsWindow(hwnd())) | 293 if (!IsWindow(hwnd())) |
| 295 return true; | 294 return true; |
| 296 // Parent window has been destroyed. | 295 // Parent window has been destroyed. |
| 297 Shutdown(); | 296 Shutdown(); |
| 298 return true; | 297 return true; |
| 299 } | 298 } |
| 300 | 299 |
| 301 RECT parent_rect = {0}; | 300 RECT parent_rect = {0}; |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 return true; | 637 return true; |
| 639 } | 638 } |
| 640 | 639 |
| 641 void PluginInstallerImpl::NotifyPluginStatus(int status) { | 640 void PluginInstallerImpl::NotifyPluginStatus(int status) { |
| 642 default_plugin::g_browser->getvalue( | 641 default_plugin::g_browser->getvalue( |
| 643 instance_, | 642 instance_, |
| 644 static_cast<NPNVariable>( | 643 static_cast<NPNVariable>( |
| 645 default_plugin::kMissingPluginStatusStart + status), | 644 default_plugin::kMissingPluginStatusStart + status), |
| 646 NULL); | 645 NULL); |
| 647 } | 646 } |
| OLD | NEW |