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

Side by Side Diff: ash/wm/overview/window_selector.cc

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: cros Created 4 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/wm/overview/window_selector.h" 5 #include "ash/wm/overview/window_selector.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 CreateTextFilter(this, Shell::GetPrimaryRootWindow())); 314 CreateTextFilter(this, Shell::GetPrimaryRootWindow()));
315 } 315 }
316 316
317 DCHECK(!grid_list_.empty()); 317 DCHECK(!grid_list_.empty());
318 UMA_HISTOGRAM_COUNTS_100("Ash.WindowSelector.Items", num_items_); 318 UMA_HISTOGRAM_COUNTS_100("Ash.WindowSelector.Items", num_items_);
319 319
320 Shell* shell = Shell::GetInstance(); 320 Shell* shell = Shell::GetInstance();
321 321
322 shell->activation_client()->AddObserver(this); 322 shell->activation_client()->AddObserver(this);
323 323
324 shell->GetScreen()->AddObserver(this); 324 gfx::Screen::GetScreen()->AddObserver(this);
325 shell->metrics()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW); 325 shell->metrics()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW);
326 // Send an a11y alert. 326 // Send an a11y alert.
327 shell->accessibility_delegate()->TriggerAccessibilityAlert( 327 shell->accessibility_delegate()->TriggerAccessibilityAlert(
328 ui::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); 328 ui::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED);
329 329
330 UpdateShelfVisibility(); 330 UpdateShelfVisibility();
331 } 331 }
332 332
333 // NOTE: The work done in Shutdown() is not done in the destructor because it 333 // NOTE: The work done in Shutdown() is not done in the destructor because it
334 // may cause other, unrelated classes, (ie PanelLayoutManager) to make indirect 334 // may cause other, unrelated classes, (ie PanelLayoutManager) to make indirect
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 grid_list_.clear(); 378 grid_list_.clear();
379 UpdateShelfVisibility(); 379 UpdateShelfVisibility();
380 } 380 }
381 381
382 void WindowSelector::RemoveAllObservers() { 382 void WindowSelector::RemoveAllObservers() {
383 Shell* shell = Shell::GetInstance(); 383 Shell* shell = Shell::GetInstance();
384 for (aura::Window* window : observed_windows_) 384 for (aura::Window* window : observed_windows_)
385 window->RemoveObserver(this); 385 window->RemoveObserver(this);
386 386
387 shell->activation_client()->RemoveObserver(this); 387 shell->activation_client()->RemoveObserver(this);
388 shell->GetScreen()->RemoveObserver(this); 388 gfx::Screen::GetScreen()->RemoveObserver(this);
389 if (restore_focus_window_) 389 if (restore_focus_window_)
390 restore_focus_window_->RemoveObserver(this); 390 restore_focus_window_->RemoveObserver(this);
391 } 391 }
392 392
393 void WindowSelector::CancelSelection() { 393 void WindowSelector::CancelSelection() {
394 delegate_->OnSelectionEnded(); 394 delegate_->OnSelectionEnded();
395 } 395 }
396 396
397 void WindowSelector::OnGridEmpty(WindowGrid* grid) { 397 void WindowSelector::OnGridEmpty(WindowGrid* grid) {
398 ScopedVector<WindowGrid>::iterator iter = 398 ScopedVector<WindowGrid>::iterator iter =
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 for (size_t i = 0; 638 for (size_t i = 0;
639 i <= grid_list_.size() && 639 i <= grid_list_.size() &&
640 grid_list_[selected_grid_index_]->Move(direction, animate); i++) { 640 grid_list_[selected_grid_index_]->Move(direction, animate); i++) {
641 selected_grid_index_ = 641 selected_grid_index_ =
642 (selected_grid_index_ + display_direction + grid_list_.size()) % 642 (selected_grid_index_ + display_direction + grid_list_.size()) %
643 grid_list_.size(); 643 grid_list_.size();
644 } 644 }
645 } 645 }
646 646
647 } // namespace ash 647 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc ('k') | ash/wm/panels/panel_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698