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

Unified Diff: remoting/client/pepper/fake_browser.h

Issue 2690003: Copy the (early prototype of) remoting in Chrome into the public tree.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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/host_connection.cc ('k') | remoting/client/pepper/fake_browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/pepper/fake_browser.h
===================================================================
--- remoting/client/pepper/fake_browser.h (revision 0)
+++ remoting/client/pepper/fake_browser.h (revision 0)
@@ -0,0 +1,61 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_CLIENT_PEPPER_FAKE_BROWSER_H_
+#define REMOTING_CLIENT_PEPPER_FAKE_BROWSER_H_
+
+#include "base/scoped_ptr.h"
+#include "base/singleton.h"
+#include "third_party/npapi/bindings/nphostapi.h"
+#include "third_party/npapi/bindings/npapi_extensions.h"
+
+// Each ARGB pixel is stored in a 4-byte uint32.
+#define ARGB_PIXEL_SIZE 4
+
+class FakeBrowser {
+ public:
+ NPNetscapeFuncs* GetBrowserFuncs() { return browser_funcs_.get(); }
+ NPNExtensions* GetExtensions() { return extensions_.get(); }
+
+ NPDevice* GetDevice2d() { return device2d_.get(); }
+ void ForceStrideInDeviceContext(bool forceStride);
+
+ NPWindow* GetWindow() { return window_.get(); }
+ void GetWindowInfo(int* width, int* height) {
+ *width = width_;
+ *height = height_;
+ }
+
+ uint32* AllocPixelBuffer(int stride);
+ void FreePixelBuffer();
+
+ uint32* GetPixelBuffer() { return pixel_buffer_.get(); }
+ int GetPixelBufferStride() { return stride_; }
+
+ private:
+ // Singleton private bits.
+ friend struct DefaultSingletonTraits<FakeBrowser>;
+ FakeBrowser();
+ virtual ~FakeBrowser();
+
+ // Browser callback functions.
+ scoped_ptr<NPNetscapeFuncs> browser_funcs_;
+
+ // Browser extension callbacks.
+ scoped_ptr<NPNExtensions> extensions_;
+
+ // The rendering device (provided by the browser to the plugin).
+ scoped_ptr<NPDevice> device2d_;
+
+ // Window (provided by the browser to the plugin).
+ scoped_ptr<NPWindow> window_;
+
+ // Pixel buffer to store the device2d_ (and window_) pixels.
+ scoped_array<uint32> pixel_buffer_;
+ int width_, height_, stride_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeBrowser);
+};
+
+#endif // REMOTING_CLIENT_PEPPER_FAKE_BROWSER_H_
Property changes on: remoting/client/pepper/fake_browser.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « remoting/client/host_connection.cc ('k') | remoting/client/pepper/fake_browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698