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

Side by Side Diff: athena/extensions/athena_app_window_client_base.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: Removed activation 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "athena/extensions/athena_app_window_client_base.h" 5 #include "athena/extensions/athena_app_window_client_base.h"
6 6
7 #include "athena/activity/public/activity_factory.h" 7 #include "athena/activity/public/activity_factory.h"
8 #include "athena/activity/public/activity_manager.h" 8 #include "athena/activity/public/activity_manager.h"
9 #include "athena/extensions/athena_native_app_window_views.h" 9 #include "athena/extensions/athena_native_app_window_views.h"
10 #include "athena/wm/public/window_list_provider.h"
11 #include "athena/wm/public/window_manager.h"
10 #include "extensions/common/extension.h" 12 #include "extensions/common/extension.h"
11 13
12 namespace athena { 14 namespace athena {
13 15
14 AthenaAppWindowClientBase::AthenaAppWindowClientBase() { 16 AthenaAppWindowClientBase::AthenaAppWindowClientBase() {
15 } 17 }
16 18
17 AthenaAppWindowClientBase::~AthenaAppWindowClientBase() { 19 AthenaAppWindowClientBase::~AthenaAppWindowClientBase() {
18 } 20 }
19 21
20 extensions::NativeAppWindow* AthenaAppWindowClientBase::CreateNativeAppWindow( 22 extensions::NativeAppWindow* AthenaAppWindowClientBase::CreateNativeAppWindow(
21 extensions::AppWindow* app_window, 23 extensions::AppWindow* app_window,
22 const extensions::AppWindow::CreateParams& params) { 24 extensions::AppWindow::CreateParams& params) {
23 AthenaNativeAppWindowViews* native_window = new AthenaNativeAppWindowViews; 25 AthenaNativeAppWindowViews* native_window = new AthenaNativeAppWindowViews;
24 native_window->Init(app_window, params); 26 native_window->Init(app_window, params);
25 ActivityFactory::Get()->CreateAppActivity(app_window->extension_id(), 27 ActivityFactory::Get()->CreateAppActivity(app_window->extension_id(),
26 native_window->GetWebView()); 28 native_window->GetWebView());
29 if (params.focused) {
30 // This creation will have created the window at the top. If it has been
31 // placed somewhere else it must have been done intentionally and we should
32 // 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
33 const aura::Window::Windows& window_list =
34 WindowManager::Get()->GetWindowListProvider()->GetWindowList();
35 aura::Window* native_app_window =
36 native_window->widget()->GetNativeWindow();
37 std::vector<aura::Window*>::const_iterator iter =
38 std::find(window_list.begin(), window_list.end(), native_app_window);
39 // The application window might have been created as a panel - if it was, it
40 // 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
41 // the end of the list (top of the stack), the window was intentionally
42 // moved after creation to a different location and we have to respect this
43 // location and suppress focusing - which would bring it back to the front.
44 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
45 params.focused = false;
46 }
27 return native_window; 47 return native_window;
28 } 48 }
29 49
30 } // namespace athena 50 } // namespace athena
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698