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 "chrome/default_plugin/plugin_impl_gtk.h" | 5 #include "chrome/default_plugin/plugin_impl_gtk.h" |
6 | 6 |
7 #include <gdk/gdkx.h> | 7 #include <X11/Xdefs.h> |
| 8 #include <gtk/gtk.h> |
8 | 9 |
9 #include "base/file_util.h" | 10 #include "base/file_util.h" |
10 #include "base/path_service.h" | 11 #include "base/path_service.h" |
11 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "chrome/common/chrome_plugin_messages.h" |
12 #include "chrome/default_plugin/plugin_main.h" | 14 #include "chrome/default_plugin/plugin_main.h" |
| 15 #include "content/common/child_thread.h" |
| 16 #include "content/common/content_constants.h" |
13 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
14 #include "grit/webkit_strings.h" | 18 #include "grit/webkit_strings.h" |
15 #include "unicode/locid.h" | 19 #include "unicode/locid.h" |
16 #include "webkit/plugins/npapi/default_plugin_shared.h" | 20 #include "webkit/plugins/npapi/default_plugin_shared.h" |
17 | 21 |
18 // TODO(thakis): Most methods in this class are stubbed out an need to be | 22 // TODO(thakis): Most methods in this class are stubbed out an need to be |
19 // implemented. | 23 // implemented. |
20 | 24 |
21 PluginInstallerImpl::PluginInstallerImpl(int16 mode) | 25 PluginInstallerImpl::PluginInstallerImpl(int16 mode) |
22 : instance_(NULL), | 26 : instance_(NULL), |
(...skipping 15 matching lines...) Expand all Loading... |
38 | 42 |
39 if (mime_type == NULL || strlen(mime_type) == 0) { | 43 if (mime_type == NULL || strlen(mime_type) == 0) { |
40 DLOG(WARNING) << __FUNCTION__ << " Invalid parameters passed in"; | 44 DLOG(WARNING) << __FUNCTION__ << " Invalid parameters passed in"; |
41 NOTREACHED(); | 45 NOTREACHED(); |
42 return false; | 46 return false; |
43 } | 47 } |
44 | 48 |
45 instance_ = instance; | 49 instance_ = instance; |
46 mime_type_ = mime_type; | 50 mime_type_ = mime_type; |
47 | 51 |
48 return true; | 52 return PluginInstallerBase::Initialize(module_handle, instance, mime_type, |
| 53 argc, argn, argv); |
49 } | 54 } |
50 | 55 |
51 bool PluginInstallerImpl::NPP_SetWindow(NPWindow* window_info) { | 56 bool PluginInstallerImpl::NPP_SetWindow(NPWindow* window_info) { |
52 if (container_) | 57 if (container_) |
53 gtk_widget_destroy(container_); | 58 gtk_widget_destroy(container_); |
54 container_ = gtk_plug_new(reinterpret_cast<XID>(window_info->window)); | 59 container_ = gtk_plug_new(reinterpret_cast<XID>(window_info->window)); |
55 | 60 |
56 // Add label. | 61 // Add label. |
57 GtkWidget* box = gtk_vbox_new(FALSE, 0); | 62 GtkWidget* box = gtk_vbox_new(FALSE, 0); |
58 GtkWidget* label = gtk_label_new("Missing Plug-in"); | 63 GtkWidget* label = gtk_label_new("Missing Plug-in"); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 131 } |
127 | 132 |
128 void PluginInstallerImpl::DownloadCancelled() { | 133 void PluginInstallerImpl::DownloadCancelled() { |
129 DisplayAvailablePluginStatus(); | 134 DisplayAvailablePluginStatus(); |
130 } | 135 } |
131 | 136 |
132 void PluginInstallerImpl::ShowInstallDialog() { | 137 void PluginInstallerImpl::ShowInstallDialog() { |
133 } | 138 } |
134 | 139 |
135 void PluginInstallerImpl::NotifyPluginStatus(int status) { | 140 void PluginInstallerImpl::NotifyPluginStatus(int status) { |
136 default_plugin::g_browser->getvalue( | 141 ChildThread::current()->Send( |
137 instance_, | 142 new ChromePluginProcessHostMsg_MissingPluginStatus( |
138 static_cast<NPNVariable>( | 143 status, |
139 webkit::npapi::default_plugin::kMissingPluginStatusStart + status), | 144 renderer_process_id(), |
140 NULL); | 145 render_view_id(), |
| 146 0)); |
141 } | 147 } |
OLD | NEW |