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

Side by Side Diff: ash/common/system/tray/tray_background_view.cc

Issue 2726823003: Remove WmLookup. (Closed)
Patch Set: Clean up include and modify comment. 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/system/tray/system_tray.cc ('k') | ash/common/system/tray/tray_bubble_wrapper.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/common/system/tray/tray_background_view.h" 5 #include "ash/common/system/tray/tray_background_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/ash_constants.h" 9 #include "ash/common/ash_constants.h"
10 #include "ash/common/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
11 #include "ash/common/shelf/shelf_constants.h" 11 #include "ash/common/shelf/shelf_constants.h"
12 #include "ash/common/shelf/wm_shelf.h" 12 #include "ash/common/shelf/wm_shelf.h"
13 #include "ash/common/shelf/wm_shelf_util.h" 13 #include "ash/common/shelf/wm_shelf_util.h"
14 #include "ash/common/system/tray/system_tray.h" 14 #include "ash/common/system/tray/system_tray.h"
15 #include "ash/common/system/tray/tray_constants.h" 15 #include "ash/common/system/tray/tray_constants.h"
16 #include "ash/common/system/tray/tray_event_filter.h" 16 #include "ash/common/system/tray/tray_event_filter.h"
17 #include "ash/common/wm_lookup.h"
18 #include "ash/common/wm_shell.h" 17 #include "ash/common/wm_shell.h"
19 #include "ash/common/wm_window.h" 18 #include "ash/common/wm_window.h"
20 #include "ash/public/cpp/shell_window_ids.h" 19 #include "ash/public/cpp/shell_window_ids.h"
21 #include "ash/resources/grit/ash_resources.h" 20 #include "ash/resources/grit/ash_resources.h"
22 #include "base/memory/ptr_util.h" 21 #include "base/memory/ptr_util.h"
23 #include "ui/accessibility/ax_node_data.h" 22 #include "ui/accessibility/ax_node_data.h"
24 #include "ui/base/nine_image_painter_factory.h" 23 #include "ui/base/nine_image_painter_factory.h"
25 #include "ui/compositor/layer.h" 24 #include "ui/compositor/layer.h"
26 #include "ui/compositor/layer_animation_element.h" 25 #include "ui/compositor/layer_animation_element.h"
27 #include "ui/compositor/scoped_layer_animation_settings.h" 26 #include "ui/compositor/scoped_layer_animation_settings.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 StopObservingImplicitAnimations(); 313 StopObservingImplicitAnimations();
315 } 314 }
316 315
317 void TrayBackgroundView::Initialize() { 316 void TrayBackgroundView::Initialize() {
318 GetWidget()->AddObserver(widget_observer_.get()); 317 GetWidget()->AddObserver(widget_observer_.get());
319 } 318 }
320 319
321 // static 320 // static
322 void TrayBackgroundView::InitializeBubbleAnimations( 321 void TrayBackgroundView::InitializeBubbleAnimations(
323 views::Widget* bubble_widget) { 322 views::Widget* bubble_widget) {
324 WmWindow* window = WmLookup::Get()->GetWindowForWidget(bubble_widget); 323 WmWindow* window = WmWindow::Get(bubble_widget->GetNativeWindow());
325 window->SetVisibilityAnimationType( 324 window->SetVisibilityAnimationType(
326 ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); 325 ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
327 window->SetVisibilityAnimationTransition(::wm::ANIMATE_HIDE); 326 window->SetVisibilityAnimationTransition(::wm::ANIMATE_HIDE);
328 window->SetVisibilityAnimationDuration( 327 window->SetVisibilityAnimationDuration(
329 base::TimeDelta::FromMilliseconds(kAnimationDurationForPopupMs)); 328 base::TimeDelta::FromMilliseconds(kAnimationDurationForPopupMs));
330 } 329 }
331 330
332 void TrayBackgroundView::SetVisible(bool visible) { 331 void TrayBackgroundView::SetVisible(bool visible) {
333 if (visible == layer()->GetTargetVisibility()) 332 if (visible == layer()->GetTargetVisibility())
334 return; 333 return;
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 } 613 }
615 614
616 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const { 615 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const {
617 gfx::Insets insets = GetBackgroundInsets(); 616 gfx::Insets insets = GetBackgroundInsets();
618 gfx::Rect bounds = GetLocalBounds(); 617 gfx::Rect bounds = GetLocalBounds();
619 bounds.Inset(insets); 618 bounds.Inset(insets);
620 return bounds; 619 return bounds;
621 } 620 }
622 621
623 } // namespace ash 622 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/system_tray.cc ('k') | ash/common/system/tray/tray_bubble_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698