| 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_impl_mac.h" | 5 #include "chrome/default_plugin/plugin_impl_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.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" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "chrome/common/chrome_plugin_messages.h" |
| 12 #include "chrome/default_plugin/plugin_main.h" | 13 #include "chrome/default_plugin/plugin_main.h" |
| 14 #include "content/common/child_thread.h" |
| 13 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 14 #include "grit/default_plugin_resources.h" | 16 #include "grit/default_plugin_resources.h" |
| 15 #include "grit/webkit_strings.h" | 17 #include "grit/webkit_strings.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/base/l10n/l10n_util_mac.h" | 19 #include "ui/base/l10n/l10n_util_mac.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
| 19 #include "ui/gfx/image/image.h" | 21 #include "ui/gfx/image/image.h" |
| 20 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 22 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| 21 #include "unicode/locid.h" | 23 #include "unicode/locid.h" |
| 22 #include "webkit/glue/webkit_glue.h" | 24 #include "webkit/glue/webkit_glue.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 48 | 50 |
| 49 instance_ = instance; | 51 instance_ = instance; |
| 50 mime_type_ = mime_type; | 52 mime_type_ = mime_type; |
| 51 | 53 |
| 52 command_ = [l10n_util::FixUpWindowsStyleLabel(l10n_util::GetStringUTF16( | 54 command_ = [l10n_util::FixUpWindowsStyleLabel(l10n_util::GetStringUTF16( |
| 53 IDS_DEFAULT_PLUGIN_NO_PLUGIN_AVAILABLE_MSG)) retain]; | 55 IDS_DEFAULT_PLUGIN_NO_PLUGIN_AVAILABLE_MSG)) retain]; |
| 54 | 56 |
| 55 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 57 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 56 image_ = rb.GetNativeImageNamed(IDR_PLUGIN_ICON); | 58 image_ = rb.GetNativeImageNamed(IDR_PLUGIN_ICON); |
| 57 | 59 |
| 58 return true; | 60 return PluginInstallerBase::Initialize(module_handle, instance, mime_type, |
| 61 argc, argn, argv); |
| 59 } | 62 } |
| 60 | 63 |
| 61 bool PluginInstallerImpl::NPP_SetWindow(NPWindow* window_info) { | 64 bool PluginInstallerImpl::NPP_SetWindow(NPWindow* window_info) { |
| 62 width_ = window_info->width; | 65 width_ = window_info->width; |
| 63 height_ = window_info->height; | 66 height_ = window_info->height; |
| 64 return true; | 67 return true; |
| 65 } | 68 } |
| 66 | 69 |
| 67 void PluginInstallerImpl::Shutdown() { | 70 void PluginInstallerImpl::Shutdown() { |
| 68 } | 71 } |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 [command_ drawAtPoint:label_point withAttributes:attributes]; | 188 [command_ drawAtPoint:label_point withAttributes:attributes]; |
| 186 | 189 |
| 187 return 1; | 190 return 1; |
| 188 } | 191 } |
| 189 | 192 |
| 190 | 193 |
| 191 void PluginInstallerImpl::ShowInstallDialog() { | 194 void PluginInstallerImpl::ShowInstallDialog() { |
| 192 } | 195 } |
| 193 | 196 |
| 194 void PluginInstallerImpl::NotifyPluginStatus(int status) { | 197 void PluginInstallerImpl::NotifyPluginStatus(int status) { |
| 195 default_plugin::g_browser->getvalue( | 198 ChildThread::current()->Send( |
| 196 instance_, | 199 new ChromePluginProcessHostMsg_MissingPluginStatus( |
| 197 static_cast<NPNVariable>( | 200 status, |
| 198 webkit::npapi::default_plugin::kMissingPluginStatusStart + status), | 201 renderer_process_id(), |
| 199 NULL); | 202 render_view_id(), |
| 203 0)); |
| 200 } | 204 } |
| OLD | NEW |