OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/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" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "chrome/default_plugin/plugin_main.h" |
12 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
13 #include "grit/webkit_strings.h" | 14 #include "grit/webkit_strings.h" |
14 #include "unicode/locid.h" | 15 #include "unicode/locid.h" |
15 #include "webkit/default_plugin/default_plugin_shared.h" | |
16 #include "webkit/default_plugin/plugin_main.h" | |
17 #include "webkit/glue/webkit_glue.h" | 16 #include "webkit/glue/webkit_glue.h" |
| 17 #include "webkit/glue/plugins/default_plugin_shared.h" |
18 | 18 |
19 static const int TOOLTIP_MAX_WIDTH = 500; | 19 static const int TOOLTIP_MAX_WIDTH = 500; |
20 | 20 |
21 PluginInstallerImpl::PluginInstallerImpl(int16 mode) | 21 PluginInstallerImpl::PluginInstallerImpl(int16 mode) |
22 : instance_(NULL), | 22 : instance_(NULL), |
23 mode_(mode), | 23 mode_(mode), |
24 plugin_install_stream_(NULL), | 24 plugin_install_stream_(NULL), |
25 plugin_installer_state_(PluginInstallerStateUndefined), | 25 plugin_installer_state_(PluginInstallerStateUndefined), |
26 install_dialog_(NULL), | 26 install_dialog_(NULL), |
27 enable_click_(false), | 27 enable_click_(false), |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 NotifyPluginStatus(default_plugin::MISSING_PLUGIN_AVAILABLE); | 252 NotifyPluginStatus(default_plugin::MISSING_PLUGIN_AVAILABLE); |
253 } else { | 253 } else { |
254 DLOG(WARNING) << "No plugin available for mime type " << mime_type_; | 254 DLOG(WARNING) << "No plugin available for mime type " << mime_type_; |
255 DisplayStatus(IDS_DEFAULT_PLUGIN_NO_PLUGIN_AVAILABLE_MSG); | 255 DisplayStatus(IDS_DEFAULT_PLUGIN_NO_PLUGIN_AVAILABLE_MSG); |
256 } | 256 } |
257 } | 257 } |
258 } | 258 } |
259 | 259 |
260 int16 PluginInstallerImpl::NPP_HandleEvent(void* event) { | 260 int16 PluginInstallerImpl::NPP_HandleEvent(void* event) { |
261 NPEvent* npp_event = static_cast<NPEvent*>(event); | 261 NPEvent* npp_event = static_cast<NPEvent*>(event); |
262 if (npp_event->event == kInstallMissingPluginMessage) { | 262 if (npp_event->event == default_plugin::kInstallMissingPluginMessage) { |
263 // We could get this message because InfoBar may not be in sync with our | 263 // We could get this message because InfoBar may not be in sync with our |
264 // internal processing. So we need to check the status. | 264 // internal processing. So we need to check the status. |
265 if (plugin_installer_state() == PluginListDownloaded) { | 265 if (plugin_installer_state() == PluginListDownloaded) { |
266 ShowInstallDialog(); | 266 ShowInstallDialog(); |
267 } | 267 } |
268 } | 268 } |
269 return 0; | 269 return 0; |
270 } | 270 } |
271 | 271 |
272 std::wstring PluginInstallerImpl::ReplaceStringForPossibleEmptyReplacement( | 272 std::wstring PluginInstallerImpl::ReplaceStringForPossibleEmptyReplacement( |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 return true; | 637 return true; |
638 } | 638 } |
639 | 639 |
640 void PluginInstallerImpl::NotifyPluginStatus(int status) { | 640 void PluginInstallerImpl::NotifyPluginStatus(int status) { |
641 default_plugin::g_browser->getvalue( | 641 default_plugin::g_browser->getvalue( |
642 instance_, | 642 instance_, |
643 static_cast<NPNVariable>( | 643 static_cast<NPNVariable>( |
644 default_plugin::kMissingPluginStatusStart + status), | 644 default_plugin::kMissingPluginStatusStart + status), |
645 NULL); | 645 NULL); |
646 } | 646 } |
OLD | NEW |