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

Unified Diff: ash/shared/immersive_context.h

Issue 2260613002: Adds ImmersiveContext and ImmersiveHandlerFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile Created 4 years, 4 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
Index: ash/shared/immersive_context.h
diff --git a/ash/shared/immersive_context.h b/ash/shared/immersive_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..0bf5b26f8007dba7ecc13c2413b136bad0a2298b
--- /dev/null
+++ b/ash/shared/immersive_context.h
@@ -0,0 +1,69 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_SHARED_IMMERSIVE_CONTEXT_H_
+#define ASH_SHARED_IMMERSIVE_CONTEXT_H_
+
+#include "ash/ash_export.h"
+
+namespace gfx {
+class Rect;
+}
+namespace views {
+class PointerWatcher;
+class Widget;
+}
+
+namespace ash {
+
+class ImmersiveFullscreenController;
+
+// ImmersiveFullscreenController is used in four distinct environments: ash,
+// mash, chrome in ash and chrome in mash. All of these have slightly different
+// restrictions. ImmersiveContext enables ImmersiveFullscreenController to be
+// used in these different environments. ImmersiveContext abstracts away all the
+// windowing related calls so that ImmersiveFullscreenController does not
+// depend upon aura, mus or ash.
+//
+// ImmersiveContext is a singleton.
James Cook 2016/08/19 00:37:14 nice docs
+class ASH_EXPORT ImmersiveContext {
+ public:
+ static ImmersiveContext* Get() { return instance_; }
+
+ // Mirrors that of WmShell::InstallResizeHandleWindowTargeter(), see it
+ // for details
+ virtual void InstallResizeHandleWindowTargeter(
+ ImmersiveFullscreenController* controller) = 0;
+
+ // Used to setup state necessary for entering or existing immersive mode. It
+ // is expected this interacts with the shelf, and installs any other necessary
+ // state.
+ virtual void OnEnteringOrExitingImmersive(
+ ImmersiveFullscreenController* controller,
+ bool entering) = 0;
+
+ // Returns the bounds of the display the widget is on, in screen coordiantes.
James Cook 2016/08/19 00:37:14 nit: coordinates
sky 2016/08/19 03:30:47 My vision is SO GOING DOWNHILL!
+ virtual gfx::Rect GetDisplayBoundsInScreen(views::Widget* widget) = 0;
+
+ virtual void AddPointerWatcher(views::PointerWatcher* watcher,
James Cook 2016/08/19 00:37:14 nit: "// See WmShell::AddPointerWatcher for detail
sky 2016/08/19 03:30:47 Done.
+ bool wants_moves) = 0;
+ virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0;
+
+ // Returns true if any window has capture.
+ virtual bool DoesAnyWindowHaveCapture() = 0;
+
+ // See WmShell::IsMouseEventsEnabled() for details.
+ virtual bool IsMouseEventsEnabled() = 0;
+
+ protected:
+ ImmersiveContext();
+ virtual ~ImmersiveContext();
+
+ private:
+ static ImmersiveContext* instance_;
+};
+
+} // namespace ash
+
+#endif // ASH_SHARED_IMMERSIVE_CONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698