OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chromecast/browser/cast_content_window.h" | 5 #include "chromecast/browser/cast_content_window.h" |
6 | 6 |
7 #include "base/threading/thread_restrictions.h" | 7 #include "base/threading/thread_restrictions.h" |
8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
9 #include "ipc/ipc_message.h" | 9 #include "ipc/ipc_message.h" |
10 | 10 |
11 #if defined(USE_AURA) | 11 #if defined(USE_AURA) |
12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
13 #include "ui/aura/layout_manager.h" | 13 #include "ui/aura/layout_manager.h" |
14 #include "ui/aura/test/test_screen.h" | 14 #include "ui/aura/test/test_screen.h" |
15 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
16 #include "ui/aura/window_tree_host.h" | 16 #include "ui/aura/window_tree_host.h" |
17 #endif | 17 #endif |
18 | 18 |
19 namespace chromecast { | 19 namespace chromecast { |
20 | 20 |
21 #if defined(USE_AURA) | 21 #if defined(USE_AURA) |
22 class CastFillLayout : public aura::LayoutManager { | 22 class CastFillLayout : public aura::LayoutManager { |
23 public: | 23 public: |
24 explicit CastFillLayout(aura::Window* root) : root_(root) {} | 24 explicit CastFillLayout(aura::Window* root) : root_(root) {} |
25 virtual ~CastFillLayout() {} | 25 ~CastFillLayout() override {} |
26 | 26 |
27 private: | 27 private: |
28 virtual void OnWindowResized() override {} | 28 void OnWindowResized() override {} |
29 | 29 |
30 virtual void OnWindowAddedToLayout(aura::Window* child) override { | 30 void OnWindowAddedToLayout(aura::Window* child) override { |
31 child->SetBounds(root_->bounds()); | 31 child->SetBounds(root_->bounds()); |
32 } | 32 } |
33 | 33 |
34 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) override {} | 34 void OnWillRemoveWindowFromLayout(aura::Window* child) override {} |
35 | 35 |
36 virtual void OnWindowRemovedFromLayout(aura::Window* child) override {} | 36 void OnWindowRemovedFromLayout(aura::Window* child) override {} |
37 | 37 |
38 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | 38 void OnChildWindowVisibilityChanged(aura::Window* child, |
39 bool visible) override {} | 39 bool visible) override {} |
40 | 40 |
41 virtual void SetChildBounds(aura::Window* child, | 41 void SetChildBounds(aura::Window* child, |
42 const gfx::Rect& requested_bounds) override { | 42 const gfx::Rect& requested_bounds) override { |
43 SetChildBoundsDirect(child, requested_bounds); | 43 SetChildBoundsDirect(child, requested_bounds); |
44 } | 44 } |
45 | 45 |
46 aura::Window* root_; | 46 aura::Window* root_; |
47 | 47 |
48 DISALLOW_COPY_AND_ASSIGN(CastFillLayout); | 48 DISALLOW_COPY_AND_ASSIGN(CastFillLayout); |
49 }; | 49 }; |
50 #endif | 50 #endif |
51 | 51 |
52 CastContentWindow::CastContentWindow() {} | 52 CastContentWindow::CastContentWindow() {} |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 content::WebContents::CreateParams create_params(browser_context, NULL); | 101 content::WebContents::CreateParams create_params(browser_context, NULL); |
102 create_params.routing_id = MSG_ROUTING_NONE; | 102 create_params.routing_id = MSG_ROUTING_NONE; |
103 create_params.initial_size = initial_size; | 103 create_params.initial_size = initial_size; |
104 content::WebContents* web_contents = content::WebContents::Create( | 104 content::WebContents* web_contents = content::WebContents::Create( |
105 create_params); | 105 create_params); |
106 | 106 |
107 return make_scoped_ptr(web_contents); | 107 return make_scoped_ptr(web_contents); |
108 } | 108 } |
109 | 109 |
110 } // namespace chromecast | 110 } // namespace chromecast |
OLD | NEW |