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 "athena/content/app_activity_proxy.h" | 5 #include "athena/content/app_activity_proxy.h" |
6 | 6 |
7 #include "athena/content/app_activity.h" | 7 #include "athena/content/app_activity.h" |
8 #include "athena/content/app_activity_registry.h" | 8 #include "athena/content/app_activity_registry.h" |
9 #include "athena/wm/public/window_list_provider.h" | 9 #include "athena/wm/public/window_list_provider.h" |
10 #include "athena/wm/public/window_manager.h" | 10 #include "athena/wm/public/window_manager.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return ACTIVITY_MEDIA_STATE_NONE; | 53 return ACTIVITY_MEDIA_STATE_NONE; |
54 } | 54 } |
55 | 55 |
56 aura::Window* AppActivityProxy::GetWindow() { | 56 aura::Window* AppActivityProxy::GetWindow() { |
57 return view_->GetWidget()->GetNativeWindow(); | 57 return view_->GetWidget()->GetNativeWindow(); |
58 } | 58 } |
59 | 59 |
60 void AppActivityProxy::Init() { | 60 void AppActivityProxy::Init() { |
61 DCHECK(replaced_activity_); | 61 DCHECK(replaced_activity_); |
62 // Get the content proxy to present the content. | 62 // Get the content proxy to present the content. |
63 content_proxy_ = replaced_activity_->GetContentProxy(GetWindow()); | 63 content_proxy_ = replaced_activity_->GetContentProxy(); |
64 WindowListProvider* window_list_provider = | 64 WindowListProvider* window_list_provider = |
65 WindowManager::GetInstance()->GetWindowListProvider(); | 65 WindowManager::GetInstance()->GetWindowListProvider(); |
66 window_list_provider->StackWindowBehindTo(GetWindow(), | 66 window_list_provider->StackWindowBehindTo(GetWindow(), |
67 replaced_activity_->GetWindow()); | 67 replaced_activity_->GetWindow()); |
68 // Creating this object was moving the activation to this window which should | 68 // Creating this object was moving the activation to this window which should |
69 // not be the active window. As such we re-activate the top activity window. | 69 // not be the active window. As such we re-activate the top activity window. |
70 // TODO(skuhne): This should possibly move to the WindowListProvider. | 70 // TODO(skuhne): This should possibly move to the WindowListProvider. |
71 wm::ActivateWindow(window_list_provider->GetWindowList().back()); | 71 wm::ActivateWindow(window_list_provider->GetWindowList().back()); |
72 // After the Init() function returns, the passed |replaced_activity_| might | 72 // After the Init() function returns, the passed |replaced_activity_| might |
73 // get destroyed. Since we do not need it anymore we reset it. | 73 // get destroyed. Since we do not need it anymore we reset it. |
(...skipping 17 matching lines...) Expand all Loading... |
91 } | 91 } |
92 | 92 |
93 views::View* AppActivityProxy::GetContentsView() { | 93 views::View* AppActivityProxy::GetContentsView() { |
94 return view_; | 94 return view_; |
95 } | 95 } |
96 | 96 |
97 views::Widget* AppActivityProxy::CreateWidget() { | 97 views::Widget* AppActivityProxy::CreateWidget() { |
98 return NULL; | 98 return NULL; |
99 } | 99 } |
100 | 100 |
101 gfx::ImageSkia AppActivityProxy::GetOverviewModeImage() { | 101 scoped_ptr<gfx::Image> AppActivityProxy::GetOverviewModeImage() { |
102 return content_proxy_->GetContentImage(); | 102 return content_proxy_->GetContentImage(); |
103 } | 103 } |
104 | 104 |
105 void AppActivityProxy::PrepareContentsForOverview() { | 105 void AppActivityProxy::PrepareContentsForOverview() { |
106 } | 106 } |
107 | 107 |
108 void AppActivityProxy::ResetContentsView() { | 108 void AppActivityProxy::ResetContentsView() { |
109 } | 109 } |
110 | 110 |
111 } // namespace athena | 111 } // namespace athena |
OLD | NEW |