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.h" | 5 #include "athena/content/app_activity.h" |
6 | 6 |
7 #include "athena/activity/public/activity_manager.h" | 7 #include "athena/activity/public/activity_manager.h" |
8 #include "athena/content/app_activity_registry.h" | 8 #include "athena/content/app_activity_registry.h" |
9 #include "athena/content/content_proxy.h" | 9 #include "athena/content/content_proxy.h" |
10 #include "athena/content/public/app_registry.h" | 10 #include "athena/content/public/app_registry.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // TODO(skuhne): The function GetTabMediaStateForContents(WebContents), | 89 // TODO(skuhne): The function GetTabMediaStateForContents(WebContents), |
90 // and the AudioStreamMonitor needs to be moved from Chrome into contents to | 90 // and the AudioStreamMonitor needs to be moved from Chrome into contents to |
91 // make it more modular and so that we can use it from here. | 91 // make it more modular and so that we can use it from here. |
92 return Activity::ACTIVITY_MEDIA_STATE_NONE; | 92 return Activity::ACTIVITY_MEDIA_STATE_NONE; |
93 } | 93 } |
94 | 94 |
95 aura::Window* AppActivity::GetWindow() { | 95 aura::Window* AppActivity::GetWindow() { |
96 return !web_view_ ? NULL : web_view_->GetWidget()->GetNativeWindow(); | 96 return !web_view_ ? NULL : web_view_->GetWidget()->GetNativeWindow(); |
97 } | 97 } |
98 | 98 |
| 99 content::WebContents* AppActivity::GetWebContents() { |
| 100 return !web_view_ ? NULL : web_view_->GetWebContents(); |
| 101 } |
| 102 |
99 void AppActivity::Init() { | 103 void AppActivity::Init() { |
100 DCHECK(app_activity_registry_); | 104 DCHECK(app_activity_registry_); |
101 Activity* app_proxy = app_activity_registry_->unloaded_activity_proxy(); | 105 Activity* app_proxy = app_activity_registry_->unloaded_activity_proxy(); |
102 if (app_proxy) { | 106 if (app_proxy) { |
103 // Note: At this time the |AppActivity| did not get registered to the | 107 // Note: At this time the |AppActivity| did not get registered to the |
104 // |ResourceManager| - so we can move it around if needed. | 108 // |ResourceManager| - so we can move it around if needed. |
105 WindowListProvider* window_list_provider = | 109 WindowListProvider* window_list_provider = |
106 WindowManager::Get()->GetWindowListProvider(); | 110 WindowManager::Get()->GetWindowListProvider(); |
107 window_list_provider->StackWindowFrontOf(app_proxy->GetWindow(), | 111 window_list_provider->StackWindowFrontOf(app_proxy->GetWindow(), |
108 GetWindow()); | 112 GetWindow()); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 void AppActivity::HideContentProxy() { | 213 void AppActivity::HideContentProxy() { |
210 content_proxy_.reset(); | 214 content_proxy_.reset(); |
211 } | 215 } |
212 | 216 |
213 void AppActivity::ShowContentProxy() { | 217 void AppActivity::ShowContentProxy() { |
214 if (!content_proxy_.get() && web_view_) | 218 if (!content_proxy_.get() && web_view_) |
215 content_proxy_.reset(new ContentProxy(web_view_, this)); | 219 content_proxy_.reset(new ContentProxy(web_view_, this)); |
216 } | 220 } |
217 | 221 |
218 } // namespace athena | 222 } // namespace athena |
OLD | NEW |