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/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 if (tray_item) { | 314 if (tray_item) { |
315 container_->AddChildViewAt(tray_item, 0); | 315 container_->AddChildViewAt(tray_item, 0); |
316 PreferredSizeChanged(); | 316 PreferredSizeChanged(); |
317 } | 317 } |
318 } | 318 } |
319 | 319 |
320 void SystemTray::RemoveTrayItem(SystemTrayItem* item) { | 320 void SystemTray::RemoveTrayItem(SystemTrayItem* item) { |
321 NOTIMPLEMENTED(); | 321 NOTIMPLEMENTED(); |
322 } | 322 } |
323 | 323 |
324 void SystemTray::ShowDefaultView() { | |
325 if (popup_) { | |
326 popup_->RemoveObserver(this); | |
327 popup_->Close(); | |
328 } | |
329 popup_ = NULL; | |
330 bubble_ = NULL; | |
331 | |
332 ShowItems(items_, false, true); | |
333 } | |
334 | |
335 void SystemTray::ShowDetailedView(SystemTrayItem* item, | 324 void SystemTray::ShowDetailedView(SystemTrayItem* item, |
336 int close_delay, | 325 int close_delay, |
337 bool activate) { | 326 bool activate) { |
338 if (popup_) { | 327 if (popup_) { |
339 popup_->RemoveObserver(this); | 328 popup_->RemoveObserver(this); |
340 popup_->Close(); | 329 popup_->Close(); |
341 } | 330 } |
342 popup_ = NULL; | 331 popup_ = NULL; |
343 bubble_ = NULL; | 332 bubble_ = NULL; |
344 | 333 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 SchedulePaint(); | 415 SchedulePaint(); |
427 } | 416 } |
428 | 417 |
429 void SystemTray::OnWidgetClosing(views::Widget* widget) { | 418 void SystemTray::OnWidgetClosing(views::Widget* widget) { |
430 CHECK_EQ(popup_, widget); | 419 CHECK_EQ(popup_, widget); |
431 popup_ = NULL; | 420 popup_ = NULL; |
432 bubble_ = NULL; | 421 bubble_ = NULL; |
433 } | 422 } |
434 | 423 |
435 } // namespace ash | 424 } // namespace ash |
OLD | NEW |