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

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

Issue 2739553005: Moves maintaining root_window_for_new_windows_ to Shell (Closed)
Patch Set: remove ash:: 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/mru_window_tracker.cc ('k') | ash/common/wm/window_positioner.cc » ('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" 12 #include "ash/common/wm_shell.h"
13 #include "ash/common/wm_window.h" 13 #include "ash/common/wm_window.h"
14 #include "ash/public/cpp/shell_window_ids.h" 14 #include "ash/public/cpp/shell_window_ids.h"
15 #include "ash/root_window_controller.h" 15 #include "ash/root_window_controller.h"
16 #include "ash/shell.h"
16 #include "base/command_line.h" 17 #include "base/command_line.h"
17 #include "ui/accessibility/ax_node_data.h" 18 #include "ui/accessibility/ax_node_data.h"
18 #include "ui/compositor/scoped_layer_animation_settings.h" 19 #include "ui/compositor/scoped_layer_animation_settings.h"
19 #include "ui/display/display.h" 20 #include "ui/display/display.h"
20 #include "ui/display/screen.h" 21 #include "ui/display/screen.h"
21 #include "ui/gfx/canvas.h" 22 #include "ui/gfx/canvas.h"
22 #include "ui/views/background.h" 23 #include "ui/views/background.h"
23 #include "ui/views/border.h" 24 #include "ui/views/border.h"
24 #include "ui/views/controls/label.h" 25 #include "ui/views/controls/label.h"
25 #include "ui/views/layout/box_layout.h" 26 #include "ui/views/layout/box_layout.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 526
526 views::Widget* widget = new views::Widget; 527 views::Widget* widget = new views::Widget;
527 views::Widget::InitParams params; 528 views::Widget::InitParams params;
528 params.delegate = cycle_view_; 529 params.delegate = cycle_view_;
529 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; 530 params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
530 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 531 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
531 params.accept_events = true; 532 params.accept_events = true;
532 params.name = "WindowCycleList (Alt+Tab)"; 533 params.name = "WindowCycleList (Alt+Tab)";
533 // TODO(estade): make sure nothing untoward happens when the lock screen 534 // TODO(estade): make sure nothing untoward happens when the lock screen
534 // or a system modal dialog is shown. 535 // or a system modal dialog is shown.
535 WmWindow* root_window = WmShell::Get()->GetRootWindowForNewWindows(); 536 WmWindow* root_window = Shell::GetWmRootWindowForNewWindows();
536 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( 537 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer(
537 widget, kShellWindowId_OverlayContainer, &params); 538 widget, kShellWindowId_OverlayContainer, &params);
538 gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds(); 539 gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds();
539 const int widget_height = cycle_view_->GetPreferredSize().height(); 540 const int widget_height = cycle_view_->GetPreferredSize().height();
540 widget_rect.set_y(widget_rect.y() + 541 widget_rect.set_y(widget_rect.y() +
541 (widget_rect.height() - widget_height) / 2); 542 (widget_rect.height() - widget_height) / 2);
542 widget_rect.set_height(widget_height); 543 widget_rect.set_height(widget_height);
543 params.bounds = widget_rect; 544 params.bounds = widget_rect;
544 widget->Init(params); 545 widget->Init(params);
545 546
546 screen_observer_.Add(display::Screen::GetScreen()); 547 screen_observer_.Add(display::Screen::GetScreen());
547 widget->Show(); 548 widget->Show();
548 cycle_ui_widget_ = widget; 549 cycle_ui_widget_ = widget;
549 } 550 }
550 551
551 } // namespace ash 552 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/mru_window_tracker.cc ('k') | ash/common/wm/window_positioner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698