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

Side by Side Diff: ash/system/status_area_widget.cc

Issue 10834164: Add message to Ash message center for no notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ash/ash_strings.grd ('k') | ash/system/web_notification/web_notification_tray.h » ('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/system/status_area_widget.h" 5 #include "ash/system/status_area_widget.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_delegate.h" 9 #include "ash/shell_delegate.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 system_tray_->Initialize(); // Called after added to widget. 318 system_tray_->Initialize(); // Called after added to widget.
319 319
320 if (shell_delegate) { 320 if (shell_delegate) {
321 system_tray_delegate_.reset( 321 system_tray_delegate_.reset(
322 shell_delegate->CreateSystemTrayDelegate(system_tray)); 322 shell_delegate->CreateSystemTrayDelegate(system_tray));
323 } 323 }
324 if (!system_tray_delegate_.get()) 324 if (!system_tray_delegate_.get())
325 system_tray_delegate_.reset(new DummySystemTrayDelegate()); 325 system_tray_delegate_.reset(new DummySystemTrayDelegate());
326 326
327 system_tray->CreateItems(); // Called after delegate is created. 327 system_tray->CreateItems(); // Called after delegate is created.
328 UpdateAfterLoginStatusChange(system_tray_delegate_->GetUserLoginStatus());
328 } 329 }
329 330
330 void StatusAreaWidget::AddWebNotificationTray( 331 void StatusAreaWidget::AddWebNotificationTray(
331 WebNotificationTray* web_notification_tray) { 332 WebNotificationTray* web_notification_tray) {
332 web_notification_tray_ = web_notification_tray; 333 web_notification_tray_ = web_notification_tray;
333 widget_delegate_->AddTray(web_notification_tray); 334 widget_delegate_->AddTray(web_notification_tray);
334 } 335 }
335 336
336 void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) { 337 void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) {
337 widget_delegate_->set_alignment(alignment); 338 widget_delegate_->set_alignment(alignment);
(...skipping 22 matching lines...) Expand all
360 if (system_tray_) 361 if (system_tray_)
361 system_tray_->SetHideNotifications(hide); 362 system_tray_->SetHideNotifications(hide);
362 } 363 }
363 364
364 bool StatusAreaWidget::ShouldShowNonSystemNotifications() { 365 bool StatusAreaWidget::ShouldShowNonSystemNotifications() {
365 return !(system_tray_ && system_tray_->IsAnyBubbleVisible()); 366 return !(system_tray_ && system_tray_->IsAnyBubbleVisible());
366 } 367 }
367 368
368 void StatusAreaWidget::UpdateAfterLoginStatusChange( 369 void StatusAreaWidget::UpdateAfterLoginStatusChange(
369 user::LoginStatus login_status) { 370 user::LoginStatus login_status) {
371 if (login_status_ == login_status)
372 return;
370 login_status_ = login_status; 373 login_status_ = login_status;
371 if (system_tray_) 374 if (system_tray_)
372 system_tray_->UpdateAfterLoginStatusChange(login_status); 375 system_tray_->UpdateAfterLoginStatusChange(login_status);
373 if (web_notification_tray_) 376 if (web_notification_tray_)
374 web_notification_tray_->UpdateAfterLoginStatusChange(login_status); 377 web_notification_tray_->UpdateAfterLoginStatusChange(login_status);
375 } 378 }
376 379
377 } // namespace internal 380 } // namespace internal
378 } // namespace ash 381 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash_strings.grd ('k') | ash/system/web_notification/web_notification_tray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698