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

Side by Side Diff: ash/common/wm/maximize_mode/maximize_mode_controller.cc

Issue 2704173002: Update the layout mode first when exiting tablet mode (Closed)
Patch Set: . Created 3 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 5 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/ash_switches.h" 9 #include "ash/common/ash_switches.h"
10 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" 10 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // TODO(jonross): Move the maximize mode notifications from ShellObserver 139 // TODO(jonross): Move the maximize mode notifications from ShellObserver
140 // to MaximizeModeController::Observer 140 // to MaximizeModeController::Observer
141 shell->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_ENABLED); 141 shell->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_ENABLED);
142 shell->OnMaximizeModeStarted(); 142 shell->OnMaximizeModeStarted();
143 143
144 observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) { 144 observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) {
145 observer->OnTouchViewToggled(true); 145 observer->OnTouchViewToggled(true);
146 }); 146 });
147 147
148 } else { 148 } else {
149 shell->OnMaximizeModeEnding();
149 maximize_mode_window_manager_.reset(); 150 maximize_mode_window_manager_.reset();
150 shell->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_DISABLED); 151 shell->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_DISABLED);
151 shell->OnMaximizeModeEnded(); 152 shell->OnMaximizeModeEnded();
152 153
153 observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) { 154 observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) {
154 observer->OnTouchViewToggled(false); 155 observer->OnTouchViewToggled(false);
155 }); 156 });
156 } 157 }
157 } 158 }
158 159
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 return elapsed_time.InSeconds() <= kLidRecentlyOpenedDurationSeconds; 418 return elapsed_time.InSeconds() <= kLidRecentlyOpenedDurationSeconds;
418 } 419 }
419 420
420 void MaximizeModeController::SetTickClockForTest( 421 void MaximizeModeController::SetTickClockForTest(
421 std::unique_ptr<base::TickClock> tick_clock) { 422 std::unique_ptr<base::TickClock> tick_clock) {
422 DCHECK(tick_clock_); 423 DCHECK(tick_clock_);
423 tick_clock_ = std::move(tick_clock); 424 tick_clock_ = std::move(tick_clock);
424 } 425 }
425 426
426 } // namespace ash 427 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698