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

Side by Side Diff: ash/common/wm/overview/window_selector_item.cc

Issue 2699033002: Replace WmWindowObserver with aura::WindowObserver. (Closed)
Patch Set: Check for null images in ShelfWindowWatcher. 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 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/common/wm/overview/window_selector_item.h" 5 #include "ash/common/wm/overview/window_selector_item.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 root_window_(window->GetRootWindow()), 410 root_window_(window->GetRootWindow()),
411 transform_window_(window), 411 transform_window_(window),
412 in_bounds_update_(false), 412 in_bounds_update_(false),
413 selected_(false), 413 selected_(false),
414 caption_container_view_(nullptr), 414 caption_container_view_(nullptr),
415 label_view_(nullptr), 415 label_view_(nullptr),
416 close_button_(new OverviewCloseButton(this)), 416 close_button_(new OverviewCloseButton(this)),
417 window_selector_(window_selector), 417 window_selector_(window_selector),
418 background_view_(nullptr) { 418 background_view_(nullptr) {
419 CreateWindowLabel(window->GetTitle()); 419 CreateWindowLabel(window->GetTitle());
420 GetWindow()->AddObserver(this); 420 GetWindow()->aura_window()->AddObserver(this);
421 } 421 }
422 422
423 WindowSelectorItem::~WindowSelectorItem() { 423 WindowSelectorItem::~WindowSelectorItem() {
424 GetWindow()->RemoveObserver(this); 424 GetWindow()->aura_window()->RemoveObserver(this);
425 } 425 }
426 426
427 WmWindow* WindowSelectorItem::GetWindow() { 427 WmWindow* WindowSelectorItem::GetWindow() {
428 return transform_window_.window(); 428 return transform_window_.window();
429 } 429 }
430 430
431 void WindowSelectorItem::RestoreWindow() { 431 void WindowSelectorItem::RestoreWindow() {
432 caption_container_view_->listener_button()->ResetListener(); 432 caption_container_view_->listener_button()->ResetListener();
433 close_button_->ResetListener(); 433 close_button_->ResetListener();
434 transform_window_.RestoreWindow(); 434 transform_window_.RestoreWindow();
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 const ui::Event& event) { 541 const ui::Event& event) {
542 if (sender == close_button_) { 542 if (sender == close_button_) {
543 WmShell::Get()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW_CLOSE_BUTTON); 543 WmShell::Get()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW_CLOSE_BUTTON);
544 CloseWindow(); 544 CloseWindow();
545 return; 545 return;
546 } 546 }
547 CHECK(sender == caption_container_view_->listener_button()); 547 CHECK(sender == caption_container_view_->listener_button());
548 window_selector_->SelectWindow(this); 548 window_selector_->SelectWindow(this);
549 } 549 }
550 550
551 void WindowSelectorItem::OnWindowDestroying(WmWindow* window) { 551 void WindowSelectorItem::OnWindowDestroying(aura::Window* window) {
552 window->RemoveObserver(this); 552 window->RemoveObserver(this);
553 transform_window_.OnWindowDestroyed(); 553 transform_window_.OnWindowDestroyed();
554 } 554 }
555 555
556 void WindowSelectorItem::OnWindowTitleChanged(WmWindow* window) { 556 void WindowSelectorItem::OnWindowTitleChanged(aura::Window* window) {
557 // TODO(flackr): Maybe add the new title to a vector of titles so that we can 557 // TODO(flackr): Maybe add the new title to a vector of titles so that we can
558 // filter any of the titles the window had while in the overview session. 558 // filter any of the titles the window had while in the overview session.
559 label_view_->SetText(window->GetTitle()); 559 label_view_->SetText(window->GetTitle());
560 UpdateAccessibilityName(); 560 UpdateAccessibilityName();
561 } 561 }
562 562
563 float WindowSelectorItem::GetItemScale(const gfx::Size& size) { 563 float WindowSelectorItem::GetItemScale(const gfx::Size& size) {
564 gfx::Size inset_size(size.width(), size.height() - 2 * kWindowMargin); 564 gfx::Size inset_size(size.width(), size.height() - 2 * kWindowMargin);
565 return ScopedTransformOverviewWindow::GetItemScale( 565 return ScopedTransformOverviewWindow::GetItemScale(
566 transform_window_.GetTargetBoundsInScreen().size(), inset_size, 566 transform_window_.GetTargetBoundsInScreen().size(), inset_size,
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 761
762 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() { 762 gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() {
763 return background_view_ ? background_view_->animation() : nullptr; 763 return background_view_ ? background_view_->animation() : nullptr;
764 } 764 }
765 765
766 WmWindow* WindowSelectorItem::GetOverviewWindowForMinimizedStateForTest() { 766 WmWindow* WindowSelectorItem::GetOverviewWindowForMinimizedStateForTest() {
767 return transform_window_.GetOverviewWindowForMinimizedState(); 767 return transform_window_.GetOverviewWindowForMinimizedState();
768 } 768 }
769 769
770 } // namespace ash 770 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/overview/window_selector_item.h ('k') | ash/common/wm/panels/panel_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698