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

Unified Diff: athena/content/app_activity_proxy.cc

Issue 536013002: Decoupling visibility states from webcontent, adding visibility management in ResourceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed 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
« no previous file with comments | « athena/content/app_activity_proxy.h ('k') | athena/content/app_activity_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/content/app_activity_proxy.cc
diff --git a/athena/content/app_activity_proxy.cc b/athena/content/app_activity_proxy.cc
index c0dbf080fe50c645f8df5a7b6a0dd25167faaee4..dc348ebdf5bb912e8a5c2d1e63617744df436f91 100644
--- a/athena/content/app_activity_proxy.cc
+++ b/athena/content/app_activity_proxy.cc
@@ -5,20 +5,23 @@
#include "athena/content/app_activity_proxy.h"
#include "athena/content/app_activity_registry.h"
+#include "ui/aura/window.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
namespace athena {
-AppActivityProxy::AppActivityProxy(ActivityViewModel* view_model,
+AppActivityProxy::AppActivityProxy(Activity* replaced_activity,
AppActivityRegistry* creator) :
app_activity_registry_(creator),
- title_(view_model->GetTitle()),
- image_(view_model->GetOverviewModeImage()),
- color_(view_model->GetRepresentativeColor()),
+ 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 image).
- view_(new views::View()) {}
+ // (e.g. showing the passed image / layer).
+ view_(new views::View()) {
+}
AppActivityProxy::~AppActivityProxy() {
app_activity_registry_->ProxyDestroyed(this);
@@ -29,9 +32,8 @@ ActivityViewModel* AppActivityProxy::GetActivityViewModel() {
}
void AppActivityProxy::SetCurrentState(ActivityState state) {
- // We ignore all calls which try to re-load the application at a lower than
- // running invisible state.
- if (state != ACTIVITY_VISIBLE && state != ACTIVITY_INVISIBLE)
+ // We only restart the application when we are switching to visible.
+ if (state != ACTIVITY_VISIBLE)
return;
app_activity_registry_->RestartApplication(this);
// Note: This object is now destroyed.
@@ -55,6 +57,13 @@ aura::Window* AppActivityProxy::GetWindow() {
}
void AppActivityProxy::Init() {
+ DCHECK(replaced_activity_);
+ // TODO(skuhne): This should call the WindowListProvider to re-arrange.
+ // 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.
+ replaced_activity_ = NULL;
}
SkColor AppActivityProxy::GetRepresentativeColor() const {
« no previous file with comments | « athena/content/app_activity_proxy.h ('k') | athena/content/app_activity_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698