| 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 #ifndef CHROME_DEFAULT_PLUGIN_PLUGIN_IMPL_GTK_H_ | 5 #ifndef CHROME_DEFAULT_PLUGIN_PLUGIN_IMPL_GTK_H_ |
| 6 #define CHROME_DEFAULT_PLUGIN_PLUGIN_IMPL_GTK_H_ | 6 #define CHROME_DEFAULT_PLUGIN_PLUGIN_IMPL_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include <gtk/gtk.h> | 11 #include <gtk/gtk.h> |
| 12 | 12 |
| 13 #include "chrome/default_plugin/plugin_installer_base.h" |
| 13 #include "third_party/npapi/bindings/npapi.h" | 14 #include "third_party/npapi/bindings/npapi.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
| 15 | 16 |
| 16 // Possible plugin installer states. | 17 // Possible plugin installer states. |
| 17 enum PluginInstallerState { | 18 enum PluginInstallerState { |
| 18 PluginInstallerStateUndefined, | 19 PluginInstallerStateUndefined, |
| 19 PluginListDownloadInitiated, | 20 PluginListDownloadInitiated, |
| 20 PluginListDownloaded, | 21 PluginListDownloaded, |
| 21 PluginListDownloadedPluginNotFound, | 22 PluginListDownloadedPluginNotFound, |
| 22 PluginListDownloadFailed, | 23 PluginListDownloadFailed, |
| 23 PluginDownloadInitiated, | 24 PluginDownloadInitiated, |
| 24 PluginDownloadCompleted, | 25 PluginDownloadCompleted, |
| 25 PluginDownloadFailed, | 26 PluginDownloadFailed, |
| 26 PluginInstallerLaunchSuccess, | 27 PluginInstallerLaunchSuccess, |
| 27 PluginInstallerLaunchFailure | 28 PluginInstallerLaunchFailure |
| 28 }; | 29 }; |
| 29 | 30 |
| 30 class PluginInstallDialog; | 31 class PluginInstallDialog; |
| 31 class PluginDatabaseHandler; | 32 class PluginDatabaseHandler; |
| 32 | 33 |
| 33 // Provides the plugin installation functionality. This class is | 34 // Provides the plugin installation functionality. This class is |
| 34 // instantiated with the information like the mime type of the | 35 // instantiated with the information like the mime type of the |
| 35 // target plugin, the display mode, etc. | 36 // target plugin, the display mode, etc. |
| 36 class PluginInstallerImpl { | 37 class PluginInstallerImpl : public PluginInstallerBase { |
| 37 public: | 38 public: |
| 38 // mode is the plugin instantiation mode, i.e. whether it is a full | 39 // mode is the plugin instantiation mode, i.e. whether it is a full |
| 39 // page plugin (NP_FULL) or an embedded plugin (NP_EMBED) | 40 // page plugin (NP_FULL) or an embedded plugin (NP_EMBED) |
| 40 explicit PluginInstallerImpl(int16 mode); | 41 explicit PluginInstallerImpl(int16 mode); |
| 41 virtual ~PluginInstallerImpl(); | 42 virtual ~PluginInstallerImpl(); |
| 42 | 43 |
| 43 // Initializes the plugin with the instance information, mime type | 44 // Initializes the plugin with the instance information, mime type |
| 44 // and the list of parameters passed down to the plugin from the webpage. | 45 // and the list of parameters passed down to the plugin from the webpage. |
| 45 // | 46 // |
| 46 // Parameters: | 47 // Parameters: |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // Handles notifications received in response to GetURLNotify calls issued | 121 // Handles notifications received in response to GetURLNotify calls issued |
| 121 // by the plugin. | 122 // by the plugin. |
| 122 // | 123 // |
| 123 // Parameters: | 124 // Parameters: |
| 124 // url | 125 // url |
| 125 // Pointer to the URL. | 126 // Pointer to the URL. |
| 126 // reason | 127 // reason |
| 127 // Describes why the notification was sent. | 128 // Describes why the notification was sent. |
| 128 void URLNotify(const char* url, NPReason reason); | 129 void URLNotify(const char* url, NPReason reason); |
| 129 | 130 |
| 130 // Used by the renderer to indicate plugin install through the infobar. | 131 // Used by the renderer to pass events (for e.g. input events) to the plugin. |
| 131 int16 NPP_HandleEvent(void* event); | 132 int16 NPP_HandleEvent(void* event); |
| 132 | 133 |
| 133 const std::string& mime_type() const { return mime_type_; } | 134 const std::string& mime_type() const { return mime_type_; } |
| 134 | 135 |
| 135 // Replaces a resource string with the placeholder passed in as an argument | 136 // Replaces a resource string with the placeholder passed in as an argument |
| 136 // | 137 // |
| 137 // Parameters: | 138 // Parameters: |
| 138 // message_id_with_placeholders | 139 // message_id_with_placeholders |
| 139 // The resource id of the string with placeholders. This is only used if | 140 // The resource id of the string with placeholders. This is only used if |
| 140 // the placeholder string (the replacement_string) parameter is valid. | 141 // the placeholder string (the replacement_string) parameter is valid. |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 std::string mime_type_; | 275 std::string mime_type_; |
| 275 // The current state of the plugin installer. | 276 // The current state of the plugin installer. |
| 276 PluginInstallerState plugin_installer_state_; | 277 PluginInstallerState plugin_installer_state_; |
| 277 // GtkPlug containing everything in the plugin. | 278 // GtkPlug containing everything in the plugin. |
| 278 GtkWidget* container_; | 279 GtkWidget* container_; |
| 279 | 280 |
| 280 DISALLOW_COPY_AND_ASSIGN(PluginInstallerImpl); | 281 DISALLOW_COPY_AND_ASSIGN(PluginInstallerImpl); |
| 281 }; | 282 }; |
| 282 | 283 |
| 283 #endif // CHROME_DEFAULT_PLUGIN_PLUGIN_IMPL_GTK_H_ | 284 #endif // CHROME_DEFAULT_PLUGIN_PLUGIN_IMPL_GTK_H_ |
| OLD | NEW |