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

Side by Side Diff: ash/shell.h

Issue 11273098: Relanding the EventTarget fixes for Aura (Ash) as the previous attempt was reverted due to interact… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef ASH_SHELL_H_ 5 #ifndef ASH_SHELL_H_
6 #define ASH_SHELL_H_ 6 #define ASH_SHELL_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ash/system/user/login_status.h" 12 #include "ash/system/user/login_status.h"
13 #include "ash/wm/cursor_manager.h" 13 #include "ash/wm/cursor_manager.h"
14 #include "ash/wm/shelf_types.h" 14 #include "ash/wm/shelf_types.h"
15 #include "ash/wm/system_modal_container_event_filter_delegate.h" 15 #include "ash/wm/system_modal_container_event_filter_delegate.h"
16 #include "base/basictypes.h" 16 #include "base/basictypes.h"
17 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
18 #include "base/gtest_prod_util.h" 18 #include "base/gtest_prod_util.h"
19 #include "base/memory/scoped_ptr.h" 19 #include "base/memory/scoped_ptr.h"
20 #include "base/observer_list.h" 20 #include "base/observer_list.h"
21 #include "ui/base/events/event_target.h"
21 #include "ui/gfx/insets.h" 22 #include "ui/gfx/insets.h"
22 #include "ui/gfx/screen.h" 23 #include "ui/gfx/screen.h"
23 #include "ui/gfx/size.h" 24 #include "ui/gfx/size.h"
24 25
25 class CommandLine; 26 class CommandLine;
26 27
27 namespace aura { 28 namespace aura {
28 class EventFilter; 29 class EventFilter;
29 class FocusManager; 30 class FocusManager;
30 class RootWindow; 31 class RootWindow;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 class VisibilityController; 108 class VisibilityController;
108 class WindowModalityController; 109 class WindowModalityController;
109 class WorkspaceController; 110 class WorkspaceController;
110 } 111 }
111 112
112 // Shell is a singleton object that presents the Shell API and implements the 113 // Shell is a singleton object that presents the Shell API and implements the
113 // RootWindow's delegate interface. 114 // RootWindow's delegate interface.
114 // 115 //
115 // Upon creation, the Shell sets itself as the RootWindow's delegate, which 116 // Upon creation, the Shell sets itself as the RootWindow's delegate, which
116 // takes ownership of the Shell. 117 // takes ownership of the Shell.
117 class ASH_EXPORT Shell : internal::SystemModalContainerEventFilterDelegate{ 118 class ASH_EXPORT Shell : internal::SystemModalContainerEventFilterDelegate,
119 public ui::EventTarget {
118 public: 120 public:
119 typedef std::vector<aura::RootWindow*> RootWindowList; 121 typedef std::vector<aura::RootWindow*> RootWindowList;
120 typedef std::vector<internal::RootWindowController*> RootWindowControllerList; 122 typedef std::vector<internal::RootWindowController*> RootWindowControllerList;
121 123
122 enum Direction { 124 enum Direction {
123 FORWARD, 125 FORWARD,
124 BACKWARD 126 BACKWARD
125 }; 127 };
126 128
127 // Accesses private data from a Shell for testing. 129 // Accesses private data from a Shell for testing.
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 void InitRootWindowController(internal::RootWindowController* root); 419 void InitRootWindowController(internal::RootWindowController* root);
418 420
419 // Initializes the layout managers and event filters specific for 421 // Initializes the layout managers and event filters specific for
420 // primary display. 422 // primary display.
421 void InitLayoutManagersForPrimaryDisplay( 423 void InitLayoutManagersForPrimaryDisplay(
422 internal::RootWindowController* root_window_controller); 424 internal::RootWindowController* root_window_controller);
423 425
424 // ash::internal::SystemModalContainerEventFilterDelegate overrides: 426 // ash::internal::SystemModalContainerEventFilterDelegate overrides:
425 virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE; 427 virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE;
426 428
429 // Overridden from ui::EventTarget:
430 virtual bool CanAcceptEvents() OVERRIDE;
431 virtual EventTarget* GetParentTarget() OVERRIDE;
432
427 static Shell* instance_; 433 static Shell* instance_;
428 434
429 // If set before the Shell is initialized, the mouse cursor will be hidden 435 // If set before the Shell is initialized, the mouse cursor will be hidden
430 // when the screen is initially created. 436 // when the screen is initially created.
431 static bool initially_hide_cursor_; 437 static bool initially_hide_cursor_;
432 438
433 ScreenAsh* screen_; 439 ScreenAsh* screen_;
434 440
435 // Active root window. Never becomes NULL during the session. 441 // Active root window. Never becomes NULL during the session.
436 aura::RootWindow* active_root_window_; 442 aura::RootWindow* active_root_window_;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 522
517 // For testing only: simulate that a modal window is open 523 // For testing only: simulate that a modal window is open
518 bool simulate_modal_window_open_for_testing_; 524 bool simulate_modal_window_open_for_testing_;
519 525
520 DISALLOW_COPY_AND_ASSIGN(Shell); 526 DISALLOW_COPY_AND_ASSIGN(Shell);
521 }; 527 };
522 528
523 } // namespace ash 529 } // namespace ash
524 530
525 #endif // ASH_SHELL_H_ 531 #endif // ASH_SHELL_H_
OLDNEW
« no previous file with comments | « no previous file | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698