Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2945)

Unified Diff: athena/content/app_activity_proxy.cc

Issue 548633005: Adding overview / layer framework to Activities so that unloaded / sleeping activities can be shown… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased, fixed resulting problems and addressed comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: athena/content/app_activity_proxy.cc
diff --git a/athena/content/app_activity_proxy.cc b/athena/content/app_activity_proxy.cc
index 2625ab7e05a4091bd50cb2e3935988e832e465f0..60822d3df180d2ee7165f2b2ab3b8062b44aa62f 100644
--- a/athena/content/app_activity_proxy.cc
+++ b/athena/content/app_activity_proxy.cc
@@ -4,24 +4,23 @@
#include "athena/content/app_activity_proxy.h"
+#include "athena/content/app_activity.h"
#include "athena/content/app_activity_registry.h"
#include "athena/wm/public/window_list_provider.h"
#include "athena/wm/public/window_manager.h"
#include "ui/aura/window.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
+#include "ui/wm/core/window_util.h"
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()) {
}
@@ -60,11 +59,18 @@ aura::Window* AppActivityProxy::GetWindow() {
void AppActivityProxy::Init() {
DCHECK(replaced_activity_);
+ // Get the content proxy to present the content.
+ content_proxy_ = replaced_activity_->GetContentProxy(GetWindow());
WindowListProvider* window_list_provider =
WindowManager::GetInstance()->GetWindowListProvider();
window_list_provider->StackWindowBehindTo(GetWindow(),
replaced_activity_->GetWindow());
- // We moved.
+ // Creating this object was moving the activation to this window which should
+ // not be the active window. As such we re-activate the top activity window.
+ // TODO(skuhne): This should possibly move to the WindowListProvider.
+ wm::ActivateWindow(window_list_provider->GetWindowList().back());
sadrul 2014/09/12 16:30:14 Why does calling StackWindowBehindTo() change acti
Mr4D (OOO till 08-26) 2014/09/12 20:11:26 It's not that. When the resource manager unloads a
oshima 2014/09/15 16:37:11 Widget::ShowInactive?
+ // 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;
}
@@ -92,12 +98,8 @@ views::Widget* AppActivityProxy::CreateWidget() {
return NULL;
}
-void AppActivityProxy::CreateOverviewModeImage() {
- // Nothing we can do here.
-}
-
gfx::ImageSkia AppActivityProxy::GetOverviewModeImage() {
- return image_;
+ return content_proxy_->GetContentImage();
}
void AppActivityProxy::PrepareContentsForOverview() {

Powered by Google App Engine
This is Rietveld 408576698