OLD | NEW |
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/system/tray/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell/panel_window.h" | 8 #include "ash/shell/panel_window.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/system/audio/tray_volume.h" | 10 #include "ash/system/audio/tray_volume.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 hide_notifications_(false) { | 106 hide_notifications_(false) { |
107 } | 107 } |
108 | 108 |
109 SystemTray::~SystemTray() { | 109 SystemTray::~SystemTray() { |
110 bubble_.reset(); | 110 bubble_.reset(); |
111 for (std::vector<SystemTrayItem*>::iterator it = items_.begin(); | 111 for (std::vector<SystemTrayItem*>::iterator it = items_.begin(); |
112 it != items_.end(); | 112 it != items_.end(); |
113 ++it) { | 113 ++it) { |
114 (*it)->DestroyTrayView(); | 114 (*it)->DestroyTrayView(); |
115 } | 115 } |
| 116 GetWidget()->GetNativeView()->layer()->GetAnimator()->RemoveObserver( |
| 117 layer_animation_observer_.get()); |
116 } | 118 } |
117 | 119 |
118 void SystemTray::Initialize() { | 120 void SystemTray::Initialize() { |
119 layer_animation_observer_.reset(new SystemTrayLayerAnimationObserver(this)); | 121 layer_animation_observer_.reset(new SystemTrayLayerAnimationObserver(this)); |
120 GetWidget()->GetNativeView()->layer()->GetAnimator()->AddObserver( | 122 GetWidget()->GetNativeView()->layer()->GetAnimator()->AddObserver( |
121 layer_animation_observer_.get()); | 123 layer_animation_observer_.get()); |
122 } | 124 } |
123 | 125 |
124 void SystemTray::CreateItems() { | 126 void SystemTray::CreateItems() { |
125 internal::TrayVolume* tray_volume = new internal::TrayVolume(); | 127 internal::TrayVolume* tray_volume = new internal::TrayVolume(); |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 | 505 |
504 void SystemTray::OnPaintFocusBorder(gfx::Canvas* canvas) { | 506 void SystemTray::OnPaintFocusBorder(gfx::Canvas* canvas) { |
505 // The tray itself expands to the right and bottom edge of the screen to make | 507 // The tray itself expands to the right and bottom edge of the screen to make |
506 // sure clicking on the edges brings up the popup. However, the focus border | 508 // sure clicking on the edges brings up the popup. However, the focus border |
507 // should be only around the container. | 509 // should be only around the container. |
508 if (GetWidget() && GetWidget()->IsActive()) | 510 if (GetWidget() && GetWidget()->IsActive()) |
509 DrawBorder(canvas, GetContentsBounds()); | 511 DrawBorder(canvas, GetContentsBounds()); |
510 } | 512 } |
511 | 513 |
512 } // namespace ash | 514 } // namespace ash |
OLD | NEW |