Chromium Code Reviews| Index: wm/foreign_window_client_view.h |
| diff --git a/wm/foreign_window_client_view.h b/wm/foreign_window_client_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..df01cb4bbba334b973c7262aec20d87318e5b00a |
| --- /dev/null |
| +++ b/wm/foreign_window_client_view.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright (c) 2012 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 WM_FOREIGN_WINDOW_CLIENT_VIEW_H_ |
| +#define WM_FOREIGN_WINDOW_CLIENT_VIEW_H_ |
| + |
| +#include "ui/views/window/client_view.h" |
| +#include "wm/gpu/foreign_window_texture_factory.h" |
| + |
| +namespace wm { |
| + |
| +class ForeignWindowClientView |
| + : public views::ClientView, |
| + public ForeignWindowTextureFactoryObserver, |
| + public base::SupportsWeakPtr<ForeignWindowClientView> { |
| + public: |
| + ForeignWindowClientView(gfx::PluginWindowHandle window_handle, |
| + gfx::Size preferred_size); |
| + virtual ~ForeignWindowClientView(); |
| + |
| + // Overridden from views::View: |
| + virtual gfx::Size GetPreferredSize() OVERRIDE; |
| + virtual gfx::Size GetMinimumSize() OVERRIDE; |
| + virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
| + |
| + // Overridden from wm::ForeignWindowTextureFactoryObserver: |
| + virtual void OnLostResources() OVERRIDE; |
| + |
| + // Returns the native view. |
| + gfx::NativeView GetNativeView() const; |
| + |
| + // Set window properties. |
| + void SetWindowSize(const gfx::Size& size); |
|
danakj
2013/02/21 01:33:15
there's a lot of windows. can we always prefix wit
reveman
2013/02/22 01:26:44
We're always referring to the foreign window in th
|
| + void SetWindowVisible(bool visible); |
| + |
| + // Called when window contents have changed. |
| + void OnWindowContentsChanged(); |
| + |
| + // Called when window has been destroyed. |
| + void OnWindowDestroyed(); |
| + |
| + private: |
| + void CreateTexture(); |
| + void OnTextureCreated(scoped_refptr<ForeignWindowTexture> texture); |
| + |
| + scoped_ptr<views::View> contents_view_; |
| + scoped_ptr<aura::Window> window_; |
| + gfx::PluginWindowHandle window_handle_; |
| + gfx::Size preferred_size_; |
| + gfx::Size window_size_; |
| + bool window_visible_; |
| + bool window_destroyed_; |
| + scoped_refptr<ForeignWindowTexture> texture_; |
| + int pending_texture_created_count_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ForeignWindowClientView); |
| +}; |
| + |
| +} // namespace wm |
| + |
| +#endif // WM_FOREIGN_WINDOW_CLIENT_VIEW_H_ |