OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WM_FOREIGN_WINDOW_CLIENT_VIEW_H_ | |
6 #define WM_FOREIGN_WINDOW_CLIENT_VIEW_H_ | |
7 | |
8 #include "ui/views/window/client_view.h" | |
9 #include "wm/gpu/foreign_window_texture_factory.h" | |
10 | |
11 namespace wm { | |
12 | |
13 class ForeignWindowClientView | |
14 : public views::ClientView, | |
15 public ForeignWindowTextureFactoryObserver, | |
16 public base::SupportsWeakPtr<ForeignWindowClientView> { | |
17 public: | |
18 ForeignWindowClientView(gfx::PluginWindowHandle window_handle, | |
19 gfx::Size preferred_size); | |
20 virtual ~ForeignWindowClientView(); | |
21 | |
22 // Overridden from views::View: | |
23 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
24 virtual gfx::Size GetMinimumSize() OVERRIDE; | |
25 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | |
26 | |
27 // Overridden from wm::ForeignWindowTextureFactoryObserver: | |
28 virtual void OnLostResources() OVERRIDE; | |
29 | |
30 // Returns the native view. | |
31 gfx::NativeView GetNativeView() const; | |
32 | |
33 // Set window properties. | |
34 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
| |
35 void SetWindowVisible(bool visible); | |
36 | |
37 // Called when window contents have changed. | |
38 void OnWindowContentsChanged(); | |
39 | |
40 // Called when window has been destroyed. | |
41 void OnWindowDestroyed(); | |
42 | |
43 private: | |
44 void CreateTexture(); | |
45 void OnTextureCreated(scoped_refptr<ForeignWindowTexture> texture); | |
46 | |
47 scoped_ptr<views::View> contents_view_; | |
48 scoped_ptr<aura::Window> window_; | |
49 gfx::PluginWindowHandle window_handle_; | |
50 gfx::Size preferred_size_; | |
51 gfx::Size window_size_; | |
52 bool window_visible_; | |
53 bool window_destroyed_; | |
54 scoped_refptr<ForeignWindowTexture> texture_; | |
55 int pending_texture_created_count_; | |
56 | |
57 DISALLOW_COPY_AND_ASSIGN(ForeignWindowClientView); | |
58 }; | |
59 | |
60 } // namespace wm | |
61 | |
62 #endif // WM_FOREIGN_WINDOW_CLIENT_VIEW_H_ | |
OLD | NEW |