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

Side by Side Diff: ash/wm/window_animations.cc

Issue 2907853002: [mus+ash] Removes WmWindow from ash/shelf and ash/shell (Closed)
Patch Set: [mus+ash] Removes WmWindow from ash/shelf and ash/shell (removed some more wm_window.h) Created 3 years, 7 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/wm/video_detector.cc ('k') | ash/wm/window_cycle_controller.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 (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/wm/window_animations.h" 5 #include "ash/wm/window_animations.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "ash/shelf/shelf.h" 12 #include "ash/shelf/shelf.h"
13 #include "ash/wm/window_animation_types.h" 13 #include "ash/wm/window_animation_types.h"
14 #include "ash/wm/window_util.h" 14 #include "ash/wm/window_util.h"
15 #include "ash/wm/workspace_controller.h" 15 #include "ash/wm/workspace_controller.h"
16 #include "ash/wm_window.h"
17 #include "base/i18n/rtl.h" 16 #include "base/i18n/rtl.h"
18 #include "base/lazy_instance.h" 17 #include "base/lazy_instance.h"
19 #include "base/logging.h" 18 #include "base/logging.h"
20 #include "base/memory/ptr_util.h" 19 #include "base/memory/ptr_util.h"
21 #include "base/metrics/histogram_macros.h" 20 #include "base/metrics/histogram_macros.h"
22 #include "base/stl_util.h" 21 #include "base/stl_util.h"
23 #include "base/time/time.h" 22 #include "base/time/time.h"
24 #include "ui/aura/client/aura_constants.h" 23 #include "ui/aura/client/aura_constants.h"
25 #include "ui/aura/window.h" 24 #include "ui/aura/window.h"
26 #include "ui/aura/window_observer.h" 25 #include "ui/aura/window_observer.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 grayscale_sequence->AddElement(std::move(grayscale_element)); 424 grayscale_sequence->AddElement(std::move(grayscale_element));
426 425
427 std::vector<ui::LayerAnimationSequence*> animations; 426 std::vector<ui::LayerAnimationSequence*> animations;
428 animations.push_back(brightness_sequence.release()); 427 animations.push_back(brightness_sequence.release());
429 animations.push_back(grayscale_sequence.release()); 428 animations.push_back(grayscale_sequence.release());
430 429
431 return animations; 430 return animations;
432 } 431 }
433 432
434 gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) { 433 gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) {
435 WmWindow* wm_window = WmWindow::Get(window);
436 Shelf* shelf = Shelf::ForWindow(window); 434 Shelf* shelf = Shelf::ForWindow(window);
437 gfx::Rect item_rect = shelf->GetScreenBoundsOfItemIconForWindow(wm_window); 435 gfx::Rect item_rect = shelf->GetScreenBoundsOfItemIconForWindow(window);
438 436
439 // The launcher item is visible and has an icon. 437 // The launcher item is visible and has an icon.
440 if (!item_rect.IsEmpty()) 438 if (!item_rect.IsEmpty())
441 return item_rect; 439 return item_rect;
442 440
443 // If both the icon width and height are 0, then there is no icon in the 441 // If both the icon width and height are 0, then there is no icon in the
444 // launcher for |window|. If the launcher is auto hidden, one of the height or 442 // launcher for |window|. If the launcher is auto hidden, one of the height or
445 // width will be 0 but the position in the launcher and the major dimension 443 // width will be 0 but the position in the launcher and the major dimension
446 // are still reported correctly and the window can be animated to the launcher 444 // are still reported correctly and the window can be animated to the launcher
447 // item's light bar. 445 // item's light bar.
(...skipping 23 matching lines...) Expand all
471 case SHELF_ALIGNMENT_LEFT: 469 case SHELF_ALIGNMENT_LEFT:
472 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); 470 return gfx::Rect(work_area.x(), work_area.y(), 0, 0);
473 case SHELF_ALIGNMENT_RIGHT: 471 case SHELF_ALIGNMENT_RIGHT:
474 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); 472 return gfx::Rect(work_area.right(), work_area.y(), 0, 0);
475 } 473 }
476 NOTREACHED(); 474 NOTREACHED();
477 return gfx::Rect(); 475 return gfx::Rect();
478 } 476 }
479 477
480 } // namespace ash 478 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/video_detector.cc ('k') | ash/wm/window_cycle_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698