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

Side by Side Diff: ash/system/chromeos/network/tray_sms.cc

Issue 12260046: Show notification when activating with no connection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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
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/chromeos/network/tray_sms.h" 5 #include "ash/system/chromeos/network/tray_sms.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/tray/system_tray.h" 9 #include "ash/system/tray/system_tray.h"
10 #include "ash/system/tray/system_tray_bubble.h" 10 #include "ash/system/tray/system_tray_bubble.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 default_ = new SmsDefaultView(this); 295 default_ = new SmsDefaultView(this);
296 default_->SetVisible(!messages_.empty()); 296 default_->SetVisible(!messages_.empty());
297 return default_; 297 return default_;
298 } 298 }
299 299
300 views::View* TraySms::CreateDetailedView(user::LoginStatus status) { 300 views::View* TraySms::CreateDetailedView(user::LoginStatus status) {
301 CHECK(detailed_ == NULL); 301 CHECK(detailed_ == NULL);
302 HideNotificationView(); 302 HideNotificationView();
303 if (messages_.empty()) 303 if (messages_.empty())
304 return NULL; 304 return NULL;
305 HideNotificationView();
jennyz 2013/02/14 23:26:45 Why do you need to HideNotificationView twice?
stevenjb 2013/02/14 23:32:25 Oops, didn't see that we already did that. Fixed.
305 detailed_ = new SmsDetailedView(this); 306 detailed_ = new SmsDetailedView(this);
306 return detailed_; 307 return detailed_;
307 } 308 }
308 309
309 views::View* TraySms::CreateNotificationView(user::LoginStatus status) { 310 views::View* TraySms::CreateNotificationView(user::LoginStatus status) {
310 CHECK(notification_ == NULL); 311 CHECK(notification_ == NULL);
312 if (detailed_)
313 return NULL;
311 size_t index; 314 size_t index;
312 std::string number, text; 315 std::string number, text;
313 if (GetLatestMessage(&index, &number, &text)) 316 if (GetLatestMessage(&index, &number, &text))
314 notification_ = new SmsNotificationView(this, index, number, text); 317 notification_ = new SmsNotificationView(this, index, number, text);
315 return notification_; 318 return notification_;
316 } 319 }
317 320
318 void TraySms::DestroyDefaultView() { 321 void TraySms::DestroyDefaultView() {
319 default_ = NULL; 322 default_ = NULL;
320 } 323 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 if (GetLatestMessage(&index, &number, &text)) 375 if (GetLatestMessage(&index, &number, &text))
373 notification_->Update(index, number, text); 376 notification_->Update(index, number, text);
374 } else if (notify) { 377 } else if (notify) {
375 ShowNotificationView(); 378 ShowNotificationView();
376 } 379 }
377 } 380 }
378 } 381 }
379 382
380 } // namespace internal 383 } // namespace internal
381 } // namespace ash 384 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/tray/system_tray.cc » ('j') | chrome/browser/ui/ash/chrome_shell_delegate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698