Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: remoting/client/plugin/chromoting_plugin.h

Issue 2857011: Convert chromoting to pepperv2 API. (Closed)
Patch Set: break dep Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/plugin/chromoting_main.cc ('k') | remoting/client/plugin/chromoting_plugin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/chromoting_plugin.h
diff --git a/remoting/client/plugin/chromoting_plugin.h b/remoting/client/plugin/chromoting_plugin.h
index 16e6f1ddd6769a27b6b88b90ca28f9847d6cccd1..d19b6122e511fdca28af44eef73129725c8b22cc 100644
--- a/remoting/client/plugin/chromoting_plugin.h
+++ b/remoting/client/plugin/chromoting_plugin.h
@@ -10,8 +10,9 @@
#include "base/at_exit.h"
#include "base/scoped_ptr.h"
#include "remoting/client/host_connection.h"
-#include "remoting/client/pepper/pepper_plugin.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
+#include "third_party/ppapi/cpp/device_context_2d.h"
+#include "third_party/ppapi/cpp/instance.h"
namespace base {
class Thread;
@@ -26,7 +27,7 @@ class PepperView;
class ChromotingClient;
-class ChromotingPlugin : public pepper::PepperPlugin {
+class ChromotingPlugin : public pp::Instance {
public:
// The mimetype for which this plugin is registered.
//
@@ -34,46 +35,27 @@ class ChromotingPlugin : public pepper::PepperPlugin {
// point. I think we should handle a special protocol (eg., chromotocol://)
static const char *kMimeType;
- ChromotingPlugin(NPNetscapeFuncs* browser_funcs, NPP instance);
+ ChromotingPlugin(PP_Instance instance);
virtual ~ChromotingPlugin();
- // PepperPlugin implementation.
- virtual NPError New(NPMIMEType pluginType, int16 argc, char* argn[],
- char* argv[]);
- virtual NPError Destroy(NPSavedData** save);
- virtual NPError SetWindow(NPWindow* window);
- virtual int16 HandleEvent(void* event);
- virtual NPError GetValue(NPPVariable variable, void* value);
- virtual NPError SetValue(NPNVariable variable, void* value);
+ virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]);
+ virtual bool HandleEvent(const PP_Event& event);
+ virtual void ViewChanged(const PP_Rect& position, const PP_Rect& clip);
private:
FRIEND_TEST(ChromotingPluginTest, ParseUrl);
FRIEND_TEST(ChromotingPluginTest, TestCaseSetup);
- NPDevice* device() { return device_; }
-
static bool ParseUrl(const std::string& url,
std::string* user_id,
std::string* auth_token,
std::string* host_jid);
// Size of the plugin window.
- int width_, height_;
-
- // Rendering device provided by browser.
- NPDevice* device_;
+ int width_;
+ int height_;
- // Since the ChromotingPlugin's lifetime is conceptually the lifetime of the
- // object, use it to control running of atexit() calls.
- //
- // TODO(ajwong): Should this be moved into PepperPlugin? Or maybe even
- // higher?
- //
- // TODO(ajwong): This causes unittests to fail so commenting out for now. We
- // need to understand process instantiation better. This may also be a
- // non-issue when we are no longer being loaded as a DSO.
- //
- // base::AtExitManager at_exit_manager_;
+ pp::DeviceContext2D device_context_;
scoped_ptr<base::Thread> main_thread_;
scoped_ptr<JingleThread> network_thread_;
« no previous file with comments | « remoting/client/plugin/chromoting_main.cc ('k') | remoting/client/plugin/chromoting_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698