Chromium Code Reviews| Index: athena/extensions/athena_app_window_client_base.cc |
| diff --git a/athena/extensions/athena_app_window_client_base.cc b/athena/extensions/athena_app_window_client_base.cc |
| index a37d1b2a632c1fa8e5f16531a8321cf97f57716e..60e95e03176d0ecf6e24424a7f3207fb4defd552 100644 |
| --- a/athena/extensions/athena_app_window_client_base.cc |
| +++ b/athena/extensions/athena_app_window_client_base.cc |
| @@ -7,6 +7,8 @@ |
| #include "athena/activity/public/activity_factory.h" |
| #include "athena/activity/public/activity_manager.h" |
| #include "athena/extensions/athena_native_app_window_views.h" |
| +#include "athena/wm/public/window_list_provider.h" |
| +#include "athena/wm/public/window_manager.h" |
| #include "extensions/common/extension.h" |
| namespace athena { |
| @@ -19,11 +21,29 @@ AthenaAppWindowClientBase::~AthenaAppWindowClientBase() { |
| extensions::NativeAppWindow* AthenaAppWindowClientBase::CreateNativeAppWindow( |
| extensions::AppWindow* app_window, |
| - const extensions::AppWindow::CreateParams& params) { |
| + extensions::AppWindow::CreateParams& params) { |
| AthenaNativeAppWindowViews* native_window = new AthenaNativeAppWindowViews; |
| native_window->Init(app_window, params); |
| ActivityFactory::Get()->CreateAppActivity(app_window->extension_id(), |
| native_window->GetWebView()); |
| + if (params.focused) { |
| + // This creation will have created the window at the top. If it has been |
| + // placed somewhere else it must have been done intentionally and we should |
| + // not set the focus since it will change the window order again. |
|
oshima
2014/10/09 04:53:32
what happens in split view mode?
Mr4D (OOO till 08-26)
2014/10/09 14:46:44
The focused/activated window always being on top i
oshima
2014/10/09 16:06:43
Consider following:
1) Got to split view, with tw
oshima
2014/10/09 17:19:20
Discussed offline. This never happens during overv
Mr4D (OOO till 08-26)
2014/10/09 17:28:03
It's fine. It's exactly covered by this case. (Wel
|
| + const aura::Window::Windows& window_list = |
| + WindowManager::Get()->GetWindowListProvider()->GetWindowList(); |
| + aura::Window* native_app_window = |
| + native_window->widget()->GetNativeWindow(); |
| + std::vector<aura::Window*>::const_iterator iter = |
| + std::find(window_list.begin(), window_list.end(), native_app_window); |
| + // The application window might have been created as a panel - if it was, it |
| + // will not be in our WindowListProvider list. However - if it was not at |
|
oshima
2014/10/09 04:53:32
PANEL windows are in the list. see WindowListProvi
Mr4D (OOO till 08-26)
2014/10/09 14:46:44
Since it got changed ysterday they were explicitly
|
| + // the end of the list (top of the stack), the window was intentionally |
| + // moved after creation to a different location and we have to respect this |
| + // location and suppress focusing - which would bring it back to the front. |
| + if (iter != window_list.end() && ++iter != window_list.end()) |
|
oshima
2014/10/08 19:02:31
This looks fragile. How about adding explicit RESU
Mr4D (OOO till 08-26)
2014/10/08 23:48:16
As discussed - added comment.
oshima
2014/10/09 04:53:32
I still think this is not right way to do. The cod
Mr4D (OOO till 08-26)
2014/10/09 14:46:43
Both versions do exactly the same - but this one i
|
| + params.focused = false; |
| + } |
| return native_window; |
| } |