Index: athena/content/app_activity_proxy.cc |
diff --git a/athena/content/app_activity_proxy.cc b/athena/content/app_activity_proxy.cc |
index a5ca0f41a6c7147d07ef6d42a7f795ef05103358..96a296e925767150a06c6e09ba125dad4352e41f 100644 |
--- a/athena/content/app_activity_proxy.cc |
+++ b/athena/content/app_activity_proxy.cc |
@@ -4,6 +4,7 @@ |
#include "athena/content/app_activity_proxy.h" |
+#include "athena/content/app_activity.h" |
#include "athena/content/app_activity_registry.h" |
#include "ui/aura/window.h" |
#include "ui/views/view.h" |
@@ -11,15 +12,12 @@ |
namespace athena { |
-AppActivityProxy::AppActivityProxy(Activity* replaced_activity, |
+AppActivityProxy::AppActivityProxy(AppActivity* replaced_activity, |
AppActivityRegistry* creator) : |
app_activity_registry_(creator), |
title_(replaced_activity->GetActivityViewModel()->GetTitle()), |
- image_(replaced_activity->GetActivityViewModel()->GetOverviewModeImage()), |
color_(replaced_activity->GetActivityViewModel()->GetRepresentativeColor()), |
replaced_activity_(replaced_activity), |
- // TODO(skuhne): We probably need to do something better with the view |
- // (e.g. showing the passed image / layer). |
view_(new views::View()) { |
} |
@@ -62,7 +60,10 @@ void AppActivityProxy::Init() { |
// At this point we can move the Activity to its proper Activity location. |
aura::Window* relative_window = replaced_activity_->GetWindow(); |
relative_window->parent()->StackChildBelow(GetWindow(), relative_window); |
- // We moved. |
+ // Get the content proxy to present the content. |
+ content_proxy_ = replaced_activity_->GetContentProxy(GetWindow()); |
+ // After the Init() function returns, the passed |replaced_activity_| might |
+ // get destroyed. Since we do not need it anymore we reset it. |
replaced_activity_ = NULL; |
} |
@@ -82,12 +83,8 @@ views::View* AppActivityProxy::GetContentsView() { |
return view_; |
} |
-void AppActivityProxy::CreateOverviewModeImage() { |
- // Nothing we can do here. |
-} |
- |
gfx::ImageSkia AppActivityProxy::GetOverviewModeImage() { |
- return image_; |
+ return content_proxy_->GetContentImage(); |
} |
void AppActivityProxy::PrepareContentsForOverview() { |