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

Side by Side Diff: ash/common/wm/workspace/workspace_layout_manager.cc

Issue 2784603002: Makes ScreenPinningController clear map after removing observers (Closed)
Patch Set: feedback and merge Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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 #include "ash/common/wm/workspace/workspace_layout_manager.h" 5 #include "ash/common/wm/workspace/workspace_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/keyboard/keyboard_observer_register.h" 9 #include "ash/common/keyboard/keyboard_observer_register.h"
10 #include "ash/common/session/session_controller.h" 10 #include "ash/common/session/session_controller.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // always-on-top state change, because it is kept disabled regardless of 313 // always-on-top state change, because it is kept disabled regardless of
314 // the fullscreen state change. 314 // the fullscreen state change.
315 return; 315 return;
316 } 316 }
317 317
318 UpdateAlwaysOnTop(is_fullscreen_ ? wm::GetWindowForFullscreenMode(window_) 318 UpdateAlwaysOnTop(is_fullscreen_ ? wm::GetWindowForFullscreenMode(window_)
319 : nullptr); 319 : nullptr);
320 } 320 }
321 321
322 void WorkspaceLayoutManager::OnPinnedStateChanged(WmWindow* pinned_window) { 322 void WorkspaceLayoutManager::OnPinnedStateChanged(WmWindow* pinned_window) {
323 if (!WmShell::Get()->IsPinned() && is_fullscreen_) { 323 const bool is_pinned = WmShell::Get()->IsPinned();
324 if (!is_pinned && is_fullscreen_) {
324 // On exiting from pinned mode, if the workspace is still in fullscreen 325 // On exiting from pinned mode, if the workspace is still in fullscreen
325 // mode, then this event does not trigger the restoring yet. On exiting 326 // mode, then this event does not trigger the restoring yet. On exiting
326 // from fullscreen, the temporarily disabled always-on-top property will be 327 // from fullscreen, the temporarily disabled always-on-top property will be
327 // restored. 328 // restored.
328 return; 329 return;
329 } 330 }
330 331
331 UpdateAlwaysOnTop(WmShell::Get()->IsPinned() ? pinned_window : nullptr); 332 UpdateAlwaysOnTop(is_pinned ? pinned_window : nullptr);
332 } 333 }
333 334
334 void WorkspaceLayoutManager::OnVirtualKeyboardStateChanged( 335 void WorkspaceLayoutManager::OnVirtualKeyboardStateChanged(
335 bool activated, 336 bool activated,
336 WmWindow* root_window) { 337 WmWindow* root_window) {
337 UpdateKeyboardObserverFromStateChanged(activated, root_window, root_window_, 338 UpdateKeyboardObserverFromStateChanged(activated, root_window, root_window_,
338 &keyboard_observer_); 339 &keyboard_observer_);
339 } 340 }
340 341
341 ////////////////////////////////////////////////////////////////////////////// 342 //////////////////////////////////////////////////////////////////////////////
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 for (auto* window : windows) { 395 for (auto* window : windows) {
395 wm::WindowState* window_state = window->GetWindowState(); 396 wm::WindowState* window_state = window->GetWindowState();
396 if (window_on_top) 397 if (window_on_top)
397 window_state->DisableAlwaysOnTop(window_on_top); 398 window_state->DisableAlwaysOnTop(window_on_top);
398 else 399 else
399 window_state->RestoreAlwaysOnTop(); 400 window_state->RestoreAlwaysOnTop();
400 } 401 }
401 } 402 }
402 403
403 } // namespace ash 404 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698