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

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

Issue 2041233005: Moves ash::user::LoginStatus to ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 years, 6 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
« no previous file with comments | « ash/system/chromeos/network/tray_sms.h ('k') | ash/system/chromeos/network/tray_vpn.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/chromeos/network/tray_sms.h" 5 #include "ash/system/chromeos/network/tray_sms.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/fixed_sized_scroll_view.h" 8 #include "ash/system/tray/fixed_sized_scroll_view.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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 chromeos::NetworkHandler::Get()->network_sms_handler()->AddObserver(this); 292 chromeos::NetworkHandler::Get()->network_sms_handler()->AddObserver(this);
293 } 293 }
294 294
295 TraySms::~TraySms() { 295 TraySms::~TraySms() {
296 if (chromeos::NetworkHandler::IsInitialized()) { 296 if (chromeos::NetworkHandler::IsInitialized()) {
297 chromeos::NetworkHandler::Get()->network_sms_handler()->RemoveObserver( 297 chromeos::NetworkHandler::Get()->network_sms_handler()->RemoveObserver(
298 this); 298 this);
299 } 299 }
300 } 300 }
301 301
302 views::View* TraySms::CreateDefaultView(user::LoginStatus status) { 302 views::View* TraySms::CreateDefaultView(LoginStatus status) {
303 CHECK(default_ == NULL); 303 CHECK(default_ == NULL);
304 default_ = new SmsDefaultView(this); 304 default_ = new SmsDefaultView(this);
305 default_->SetVisible(!messages_.empty()); 305 default_->SetVisible(!messages_.empty());
306 return default_; 306 return default_;
307 } 307 }
308 308
309 views::View* TraySms::CreateDetailedView(user::LoginStatus status) { 309 views::View* TraySms::CreateDetailedView(LoginStatus status) {
310 CHECK(detailed_ == NULL); 310 CHECK(detailed_ == NULL);
311 HideNotificationView(); 311 HideNotificationView();
312 if (messages_.empty()) 312 if (messages_.empty())
313 return NULL; 313 return NULL;
314 detailed_ = new SmsDetailedView(this); 314 detailed_ = new SmsDetailedView(this);
315 return detailed_; 315 return detailed_;
316 } 316 }
317 317
318 views::View* TraySms::CreateNotificationView(user::LoginStatus status) { 318 views::View* TraySms::CreateNotificationView(LoginStatus status) {
319 CHECK(notification_ == NULL); 319 CHECK(notification_ == NULL);
320 if (detailed_) 320 if (detailed_)
321 return NULL; 321 return NULL;
322 size_t index; 322 size_t index;
323 std::string number, text; 323 std::string number, text;
324 if (GetLatestMessage(&index, &number, &text)) 324 if (GetLatestMessage(&index, &number, &text))
325 notification_ = new SmsNotificationView(this, index, number, text); 325 notification_ = new SmsNotificationView(this, index, number, text);
326 return notification_; 326 return notification_;
327 } 327 }
328 328
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 std::string number, text; 409 std::string number, text;
410 if (GetLatestMessage(&index, &number, &text)) 410 if (GetLatestMessage(&index, &number, &text))
411 notification_->Update(index, number, text); 411 notification_->Update(index, number, text);
412 } else if (notify) { 412 } else if (notify) {
413 ShowNotificationView(); 413 ShowNotificationView();
414 } 414 }
415 } 415 }
416 } 416 }
417 417
418 } // namespace ash 418 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/network/tray_sms.h ('k') | ash/system/chromeos/network/tray_vpn.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698