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/web_notification/web_notification_tray.h" | 5 #include "ash/system/web_notification/web_notification_tray.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/common/shelf/wm_shelf_util.h" | 8 #include "ash/common/shelf/wm_shelf_util.h" |
9 #include "ash/common/shell_window_ids.h" | 9 #include "ash/common/shell_window_ids.h" |
10 #include "ash/common/wm_lookup.h" | 10 #include "ash/common/wm_lookup.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 bool WebNotificationTray::IsMouseInNotificationBubble() const { | 329 bool WebNotificationTray::IsMouseInNotificationBubble() const { |
330 return false; | 330 return false; |
331 } | 331 } |
332 | 332 |
333 void WebNotificationTray::ShowMessageCenterBubble() { | 333 void WebNotificationTray::ShowMessageCenterBubble() { |
334 if (!IsMessageCenterBubbleVisible()) | 334 if (!IsMessageCenterBubbleVisible()) |
335 message_center_tray_->ShowMessageCenterBubble(); | 335 message_center_tray_->ShowMessageCenterBubble(); |
336 } | 336 } |
337 | 337 |
338 void WebNotificationTray::UpdateAfterLoginStatusChange( | 338 void WebNotificationTray::UpdateAfterLoginStatusChange( |
339 user::LoginStatus login_status) { | 339 LoginStatus login_status) { |
340 message_center()->SetLockedState(login_status == user::LOGGED_IN_LOCKED); | 340 message_center()->SetLockedState(login_status == LoginStatus::LOCKED); |
341 OnMessageCenterTrayChanged(); | 341 OnMessageCenterTrayChanged(); |
342 } | 342 } |
343 | 343 |
344 void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) { | 344 void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) { |
345 if (alignment == shelf_alignment()) | 345 if (alignment == shelf_alignment()) |
346 return; | 346 return; |
347 TrayBackgroundView::SetShelfAlignment(alignment); | 347 TrayBackgroundView::SetShelfAlignment(alignment); |
348 tray_container()->SetBorder(views::Border::NullBorder()); | 348 tray_container()->SetBorder(views::Border::NullBorder()); |
349 // Destroy any existing bubble so that it will be rebuilt correctly. | 349 // Destroy any existing bubble so that it will be rebuilt correctly. |
350 message_center_tray_->HideMessageCenterBubble(); | 350 message_center_tray_->HideMessageCenterBubble(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 bool WebNotificationTray::ShowNotifierSettings() { | 408 bool WebNotificationTray::ShowNotifierSettings() { |
409 if (message_center_bubble()) { | 409 if (message_center_bubble()) { |
410 static_cast<message_center::MessageCenterBubble*>( | 410 static_cast<message_center::MessageCenterBubble*>( |
411 message_center_bubble()->bubble())->SetSettingsVisible(); | 411 message_center_bubble()->bubble())->SetSettingsVisible(); |
412 return true; | 412 return true; |
413 } | 413 } |
414 return ShowMessageCenterInternal(true /* show_settings */); | 414 return ShowMessageCenterInternal(true /* show_settings */); |
415 } | 415 } |
416 | 416 |
417 bool WebNotificationTray::IsContextMenuEnabled() const { | 417 bool WebNotificationTray::IsContextMenuEnabled() const { |
418 user::LoginStatus login_status = status_area_widget()->login_status(); | 418 LoginStatus login_status = status_area_widget()->login_status(); |
419 bool userAddingRunning = ash::Shell::GetInstance() | 419 bool userAddingRunning = ash::Shell::GetInstance() |
420 ->session_state_delegate() | 420 ->session_state_delegate() |
421 ->IsInSecondaryLoginScreen(); | 421 ->IsInSecondaryLoginScreen(); |
422 | 422 |
423 return login_status != user::LOGGED_IN_NONE && !userAddingRunning; | 423 return login_status != LoginStatus::NOT_LOGGED_IN && !userAddingRunning; |
424 } | 424 } |
425 | 425 |
426 message_center::MessageCenterTray* WebNotificationTray::GetMessageCenterTray() { | 426 message_center::MessageCenterTray* WebNotificationTray::GetMessageCenterTray() { |
427 return message_center_tray_.get(); | 427 return message_center_tray_.get(); |
428 } | 428 } |
429 | 429 |
430 bool WebNotificationTray::IsCommandIdChecked(int command_id) const { | 430 bool WebNotificationTray::IsCommandIdChecked(int command_id) const { |
431 if (command_id != kToggleQuietMode) | 431 if (command_id != kToggleQuietMode) |
432 return false; | 432 return false; |
433 return message_center()->IsQuietMode(); | 433 return message_center()->IsQuietMode(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 message_center_tray_->message_center(); | 480 message_center_tray_->message_center(); |
481 button_->SetUnreadCount(message_center->UnreadNotificationCount()); | 481 button_->SetUnreadCount(message_center->UnreadNotificationCount()); |
482 if (IsMessageCenterBubbleVisible()) | 482 if (IsMessageCenterBubbleVisible()) |
483 button_->SetState(views::CustomButton::STATE_PRESSED); | 483 button_->SetState(views::CustomButton::STATE_PRESSED); |
484 else | 484 else |
485 button_->SetState(views::CustomButton::STATE_NORMAL); | 485 button_->SetState(views::CustomButton::STATE_NORMAL); |
486 bool userAddingRunning = ash::Shell::GetInstance() | 486 bool userAddingRunning = ash::Shell::GetInstance() |
487 ->session_state_delegate() | 487 ->session_state_delegate() |
488 ->IsInSecondaryLoginScreen(); | 488 ->IsInSecondaryLoginScreen(); |
489 | 489 |
490 SetVisible((status_area_widget()->login_status() != user::LOGGED_IN_NONE) && | 490 SetVisible( |
491 !userAddingRunning); | 491 (status_area_widget()->login_status() != LoginStatus::NOT_LOGGED_IN) && |
| 492 !userAddingRunning); |
492 Layout(); | 493 Layout(); |
493 SchedulePaint(); | 494 SchedulePaint(); |
494 } | 495 } |
495 | 496 |
496 void WebNotificationTray::ClickedOutsideBubble() { | 497 void WebNotificationTray::ClickedOutsideBubble() { |
497 // Only hide the message center | 498 // Only hide the message center |
498 if (!message_center_bubble()) | 499 if (!message_center_bubble()) |
499 return; | 500 return; |
500 | 501 |
501 message_center_tray_->HideMessageCenterBubble(); | 502 message_center_tray_->HideMessageCenterBubble(); |
(...skipping 11 matching lines...) Expand all Loading... |
513 | 514 |
514 message_center::MessageCenterBubble* | 515 message_center::MessageCenterBubble* |
515 WebNotificationTray::GetMessageCenterBubbleForTest() { | 516 WebNotificationTray::GetMessageCenterBubbleForTest() { |
516 if (!message_center_bubble()) | 517 if (!message_center_bubble()) |
517 return NULL; | 518 return NULL; |
518 return static_cast<message_center::MessageCenterBubble*>( | 519 return static_cast<message_center::MessageCenterBubble*>( |
519 message_center_bubble()->bubble()); | 520 message_center_bubble()->bubble()); |
520 } | 521 } |
521 | 522 |
522 } // namespace ash | 523 } // namespace ash |
OLD | NEW |