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

Unified Diff: athena/content/app_activity.cc

Issue 631333003: Adding application lifetime tests to athena, allowing to override focus request for applciations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Created 6 years, 2 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 | « no previous file | athena/content/app_activity_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/content/app_activity.cc
diff --git a/athena/content/app_activity.cc b/athena/content/app_activity.cc
index 56457533fd4c6ae103a9505745f37e47c383045b..47d5526cdc7594aa092ca9eab443ac7be0048ec4 100644
--- a/athena/content/app_activity.cc
+++ b/athena/content/app_activity.cc
@@ -15,6 +15,7 @@
#include "ui/aura/window.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/widget/widget.h"
+#include "ui/wm/core/window_util.h"
namespace athena {
@@ -108,10 +109,26 @@ void AppActivity::Init() {
// |ResourceManager| - so we can move it around if needed.
WindowListProvider* window_list_provider =
WindowManager::Get()->GetWindowListProvider();
- window_list_provider->StackWindowFrontOf(app_proxy->GetWindow(),
- GetWindow());
- Activity::Delete(app_proxy);
- // With the removal the object, the proxy should be deleted.
+ // TODO(skuhne): After the decision is made how we want to handle visibility
+ // transitions (issue 421680) this code might change.
+ // If the proxy was the active window, its deletion will cause a window
+ // reordering since the next activatable window in line will move up to the
+ // front. Since the application window is still hidden at this time, it is
+ // not yet activatable and the window behind it will move to the front.
+ if (wm::IsActiveWindow(app_proxy->GetWindow())) {
+ // Delete the proxy window first and then move the new window to the top
+ // of the stack, replacing the proxy window.
+ Activity::Delete(app_proxy);
+ window_list_provider->StackWindowFrontOf(
+ GetWindow(),
+ window_list_provider->GetWindowList().back());
+ } else {
+ // The app window goes in front of the proxy window.
+ window_list_provider->StackWindowFrontOf(GetWindow(),
+ app_proxy->GetWindow());
+ Activity::Delete(app_proxy);
oshima 2014/10/09 04:53:33 Can you move Activity::Delegate(app_proxy) before
Mr4D (OOO till 08-26) 2014/10/09 14:46:44 That is what I tried to tell you yesterday - no th
oshima 2014/10/09 16:06:43 I see, in that case, can you update the comment wh
Mr4D (OOO till 08-26) 2014/10/09 17:28:03 Done.
+ }
+ // The proxy should now be deleted.
DCHECK(!app_activity_registry_->unloaded_activity_proxy());
}
}
@@ -134,6 +151,10 @@ bool AppActivity::UsesFrame() const {
}
views::Widget* AppActivity::CreateWidget() {
+ // Before we remove the proxy, we have to register the activity and
+ // initialize its to move it to the proper activity list location.
+ RegisterActivity();
+ Init();
// Make sure the content gets properly shown.
if (current_state_ == ACTIVITY_VISIBLE) {
HideContentProxy();
@@ -143,7 +164,6 @@ views::Widget* AppActivity::CreateWidget() {
// If not previously specified, we change the state now to invisible..
SetCurrentState(ACTIVITY_INVISIBLE);
}
- RegisterActivity();
return web_view_->GetWidget();
}
« no previous file with comments | « no previous file | athena/content/app_activity_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698