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

Unified Diff: ash/common/wm/maximize_mode/maximize_mode_controller.h

Issue 2770723002: Fix MaximizeModeController startup race (Closed)
Patch Set: Verified on Device Created 3 years, 9 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 | « no previous file | ash/common/wm/maximize_mode/maximize_mode_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/maximize_mode/maximize_mode_controller.h
diff --git a/ash/common/wm/maximize_mode/maximize_mode_controller.h b/ash/common/wm/maximize_mode/maximize_mode_controller.h
index cd0d28c41a51519331f990577e3219f8f62e84f9..383f26ec156624473f16189bbb46be5d937fb8e5 100644
--- a/ash/common/wm/maximize_mode/maximize_mode_controller.h
+++ b/ash/common/wm/maximize_mode/maximize_mode_controller.h
@@ -13,6 +13,7 @@
#include "ash/public/interfaces/touch_view.mojom.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "chromeos/accelerometer/accelerometer_reader.h"
#include "chromeos/accelerometer/accelerometer_types.h"
@@ -120,6 +121,9 @@ class ASH_EXPORT MaximizeModeController :
void HandleHingeRotation(
scoped_refptr<const chromeos::AccelerometerUpdate> update);
+ void OnGetSwitchStates(chromeos::PowerManagerClient::LidState lid_state,
+ chromeos::PowerManagerClient::TabletMode tablet_mode);
+
// Returns true if the lid was recently opened.
bool WasLidOpenedRecently() const;
@@ -189,6 +193,8 @@ class ASH_EXPORT MaximizeModeController :
// The set of touchview observers to be notified about mode changes.
mojo::InterfacePtrSet<mojom::TouchViewObserver> observers_;
+ base::WeakPtrFactory<MaximizeModeController> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(MaximizeModeController);
};
« no previous file with comments | « no previous file | ash/common/wm/maximize_mode/maximize_mode_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698