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

Side by Side Diff: ash/common/wm/window_cycle_list.cc

Issue 2775973002: Promotes more accessors from WmShell to Shell (Closed)
Patch Set: feedback 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 unified diff | Download patch
« no previous file with comments | « ash/common/wm/panels/panel_layout_manager.cc ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/window_cycle_list.h" 5 #include "ash/common/wm/window_cycle_list.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 9
10 #include "ash/common/wm/mru_window_tracker.h" 10 #include "ash/common/wm/mru_window_tracker.h"
11 #include "ash/common/wm/window_state.h" 11 #include "ash/common/wm/window_state.h"
12 #include "ash/common/wm_shell.h"
13 #include "ash/common/wm_window.h" 12 #include "ash/common/wm_window.h"
14 #include "ash/public/cpp/shell_window_ids.h" 13 #include "ash/public/cpp/shell_window_ids.h"
15 #include "ash/root_window_controller.h" 14 #include "ash/root_window_controller.h"
16 #include "ash/shell.h" 15 #include "ash/shell.h"
17 #include "base/command_line.h" 16 #include "base/command_line.h"
18 #include "ui/accessibility/ax_node_data.h" 17 #include "ui/accessibility/ax_node_data.h"
19 #include "ui/compositor/scoped_layer_animation_settings.h" 18 #include "ui/compositor/scoped_layer_animation_settings.h"
20 #include "ui/display/display.h" 19 #include "ui/display/display.h"
21 #include "ui/display/screen.h" 20 #include "ui/display/screen.h"
22 #include "ui/gfx/canvas.h" 21 #include "ui/gfx/canvas.h"
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 current_index_--; 481 current_index_--;
483 } 482 }
484 483
485 if (cycle_view_) { 484 if (cycle_view_) {
486 WmWindow* new_target_window = 485 WmWindow* new_target_window =
487 windows_.empty() ? nullptr : windows_[current_index_]; 486 windows_.empty() ? nullptr : windows_[current_index_];
488 cycle_view_->HandleWindowDestruction(WmWindow::Get(window), 487 cycle_view_->HandleWindowDestruction(WmWindow::Get(window),
489 new_target_window); 488 new_target_window);
490 if (windows_.empty()) { 489 if (windows_.empty()) {
491 // This deletes us. 490 // This deletes us.
492 WmShell::Get()->window_cycle_controller()->CancelCycling(); 491 Shell::Get()->window_cycle_controller()->CancelCycling();
493 return; 492 return;
494 } 493 }
495 } 494 }
496 } 495 }
497 496
498 void WindowCycleList::OnDisplayAdded(const display::Display& new_display) {} 497 void WindowCycleList::OnDisplayAdded(const display::Display& new_display) {}
499 498
500 void WindowCycleList::OnDisplayRemoved(const display::Display& old_display) {} 499 void WindowCycleList::OnDisplayRemoved(const display::Display& old_display) {}
501 500
502 void WindowCycleList::OnDisplayMetricsChanged(const display::Display& display, 501 void WindowCycleList::OnDisplayMetricsChanged(const display::Display& display,
503 uint32_t changed_metrics) { 502 uint32_t changed_metrics) {
504 if (cycle_ui_widget_ && 503 if (cycle_ui_widget_ &&
505 display.id() == 504 display.id() ==
506 display::Screen::GetScreen() 505 display::Screen::GetScreen()
507 ->GetDisplayNearestWindow(cycle_ui_widget_->GetNativeView()) 506 ->GetDisplayNearestWindow(cycle_ui_widget_->GetNativeView())
508 .id() && 507 .id() &&
509 (changed_metrics & (DISPLAY_METRIC_BOUNDS | DISPLAY_METRIC_ROTATION))) { 508 (changed_metrics & (DISPLAY_METRIC_BOUNDS | DISPLAY_METRIC_ROTATION))) {
510 WmShell::Get()->window_cycle_controller()->CancelCycling(); 509 Shell::Get()->window_cycle_controller()->CancelCycling();
511 // |this| is deleted. 510 // |this| is deleted.
512 return; 511 return;
513 } 512 }
514 } 513 }
515 514
516 bool WindowCycleList::ShouldShowUi() { 515 bool WindowCycleList::ShouldShowUi() {
517 return windows_.size() > 1; 516 return windows_.size() > 1;
518 } 517 }
519 518
520 void WindowCycleList::InitWindowCycleView() { 519 void WindowCycleList::InitWindowCycleView() {
(...skipping 22 matching lines...) Expand all
543 widget_rect.set_height(widget_height); 542 widget_rect.set_height(widget_height);
544 params.bounds = widget_rect; 543 params.bounds = widget_rect;
545 widget->Init(params); 544 widget->Init(params);
546 545
547 screen_observer_.Add(display::Screen::GetScreen()); 546 screen_observer_.Add(display::Screen::GetScreen());
548 widget->Show(); 547 widget->Show();
549 cycle_ui_widget_ = widget; 548 cycle_ui_widget_ = widget;
550 } 549 }
551 550
552 } // namespace ash 551 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/panels/panel_layout_manager.cc ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698