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

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: feedback 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
« no previous file with comments | « ash/shared/README.md ('k') | ash/shared/immersive_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6ed6a284afd9118fa663d6a5dbb94379dda819ce
--- /dev/null
+++ b/ash/shared/immersive_context.h
@@ -0,0 +1,70 @@
+// 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.
+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 coordinates.
+ virtual gfx::Rect GetDisplayBoundsInScreen(views::Widget* widget) = 0;
+
+ // See WmShell::AddPointerWatcher for details.
+ virtual void AddPointerWatcher(views::PointerWatcher* watcher,
+ 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_
« no previous file with comments | « ash/shared/README.md ('k') | ash/shared/immersive_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698