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

Side by Side Diff: ash/shell.h

Issue 139053003: Chrome OS: avoid suspending on lid close when casting is active. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove dependencies of chrome in chromeos. Created 6 years, 11 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 | Annotate | Revision Log
« ash/DEPS ('K') | « ash/DEPS ('k') | 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/metrics/user_metrics_recorder.h" 12 #include "ash/metrics/user_metrics_recorder.h"
13 #include "ash/shelf/shelf_types.h" 13 #include "ash/shelf/shelf_types.h"
14 #include "ash/system/user/login_status.h" 14 #include "ash/system/user/login_status.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/memory/weak_ptr.h" 20 #include "base/memory/weak_ptr.h"
21 #include "base/observer_list.h" 21 #include "base/observer_list.h"
22 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
22 #include "ui/aura/client/activation_change_observer.h" 23 #include "ui/aura/client/activation_change_observer.h"
23 #include "ui/aura/window.h" 24 #include "ui/aura/window.h"
24 #include "ui/base/ui_base_types.h" 25 #include "ui/base/ui_base_types.h"
25 #include "ui/events/event_target.h" 26 #include "ui/events/event_target.h"
26 #include "ui/gfx/insets.h" 27 #include "ui/gfx/insets.h"
27 #include "ui/gfx/screen.h" 28 #include "ui/gfx/screen.h"
28 #include "ui/gfx/size.h" 29 #include "ui/gfx/size.h"
29 #include "ui/views/corewm/cursor_manager.h" 30 #include "ui/views/corewm/cursor_manager.h"
30 31
31 class CommandLine; 32 class CommandLine;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 156 }
156 157
157 // Shell is a singleton object that presents the Shell API and implements the 158 // Shell is a singleton object that presents the Shell API and implements the
158 // RootWindow's delegate interface. 159 // RootWindow's delegate interface.
159 // 160 //
160 // Upon creation, the Shell sets itself as the RootWindow's delegate, which 161 // Upon creation, the Shell sets itself as the RootWindow's delegate, which
161 // takes ownership of the Shell. 162 // takes ownership of the Shell.
162 class ASH_EXPORT Shell 163 class ASH_EXPORT Shell
163 : public internal::SystemModalContainerEventFilterDelegate, 164 : public internal::SystemModalContainerEventFilterDelegate,
164 public ui::EventTarget, 165 public ui::EventTarget,
165 public aura::client::ActivationChangeObserver { 166 public aura::client::ActivationChangeObserver,
167 public MediaCaptureDevicesDispatcher::Observer {
166 public: 168 public:
167 typedef std::vector<internal::RootWindowController*> RootWindowControllerList; 169 typedef std::vector<internal::RootWindowController*> RootWindowControllerList;
168 170
169 enum Direction { 171 enum Direction {
170 FORWARD, 172 FORWARD,
171 BACKWARD 173 BACKWARD
172 }; 174 };
173 175
174 // A shell must be explicitly created so that it can call |Init()| with the 176 // A shell must be explicitly created so that it can call |Init()| with the
175 // delegate set. |delegate| can be NULL (if not required for initialization). 177 // delegate set. |delegate| can be NULL (if not required for initialization).
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE; 566 virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE;
565 virtual EventTarget* GetParentTarget() OVERRIDE; 567 virtual EventTarget* GetParentTarget() OVERRIDE;
566 virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const OVERRIDE; 568 virtual scoped_ptr<ui::EventTargetIterator> GetChildIterator() const OVERRIDE;
567 virtual ui::EventTargeter* GetEventTargeter() OVERRIDE; 569 virtual ui::EventTargeter* GetEventTargeter() OVERRIDE;
568 virtual void OnEvent(ui::Event* event) OVERRIDE; 570 virtual void OnEvent(ui::Event* event) OVERRIDE;
569 571
570 // Overridden from aura::client::ActivationChangeObserver: 572 // Overridden from aura::client::ActivationChangeObserver:
571 virtual void OnWindowActivated(aura::Window* gained_active, 573 virtual void OnWindowActivated(aura::Window* gained_active,
572 aura::Window* lost_active) OVERRIDE; 574 aura::Window* lost_active) OVERRIDE;
573 575
576 // Overridden from MediaCaptureDevicesDispatcher::Observer:
577 virtual void OnRequestUpdate(int render_process_id,
578 int render_view_id,
579 const content::MediaStreamDevice& device,
580 const content::MediaRequestState state) OVERRIDE;
581
574 static Shell* instance_; 582 static Shell* instance_;
575 583
576 // If set before the Shell is initialized, the mouse cursor will be hidden 584 // If set before the Shell is initialized, the mouse cursor will be hidden
577 // when the screen is initially created. 585 // when the screen is initially created.
578 static bool initially_hide_cursor_; 586 static bool initially_hide_cursor_;
579 587
580 ScreenAsh* screen_; 588 ScreenAsh* screen_;
581 589
582 // When no explicit target display/RootWindow is given, new windows are 590 // When no explicit target display/RootWindow is given, new windows are
583 // created on |scoped_target_root_window_| , unless NULL in 591 // created on |scoped_target_root_window_| , unless NULL in
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 bool simulate_modal_window_open_for_testing_; 710 bool simulate_modal_window_open_for_testing_;
703 711
704 bool is_touch_hud_projection_enabled_; 712 bool is_touch_hud_projection_enabled_;
705 713
706 DISALLOW_COPY_AND_ASSIGN(Shell); 714 DISALLOW_COPY_AND_ASSIGN(Shell);
707 }; 715 };
708 716
709 } // namespace ash 717 } // namespace ash
710 718
711 #endif // ASH_SHELL_H_ 719 #endif // ASH_SHELL_H_
OLDNEW
« ash/DEPS ('K') | « ash/DEPS ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698