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

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

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/tray_constants.h" 10 #include "ash/system/tray/tray_constants.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 TraySms::~TraySms() { 287 TraySms::~TraySms() {
288 } 288 }
289 289
290 views::View* TraySms::CreateDefaultView(user::LoginStatus status) { 290 views::View* TraySms::CreateDefaultView(user::LoginStatus status) {
291 CHECK(default_ == NULL); 291 CHECK(default_ == NULL);
292 default_ = new SmsDefaultView(this); 292 default_ = new SmsDefaultView(this);
293 default_->SetVisible(!messages_.empty()); 293 default_->SetVisible(!messages_.empty());
294 return default_; 294 return default_;
295 } 295 }
296 296
297 views::View* TraySms::CreateDetailedView(user::LoginStatus status) { 297 views::View* TraySms::CreateDetailedView(user::LoginStatus status,
298 int bubble_width) {
298 CHECK(detailed_ == NULL); 299 CHECK(detailed_ == NULL);
299 HideNotificationView(); 300 HideNotificationView();
300 if (messages_.empty()) 301 if (messages_.empty())
301 return NULL; 302 return NULL;
302 detailed_ = new SmsDetailedView(this); 303 detailed_ = new SmsDetailedView(this);
303 return detailed_; 304 return detailed_;
304 } 305 }
305 306
306 views::View* TraySms::CreateNotificationView(user::LoginStatus status) { 307 views::View* TraySms::CreateNotificationView(user::LoginStatus status) {
307 CHECK(notification_ == NULL); 308 CHECK(notification_ == NULL);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 if (GetLatestMessage(&index, &number, &text)) 370 if (GetLatestMessage(&index, &number, &text))
370 notification_->Update(index, number, text); 371 notification_->Update(index, number, text);
371 } else if (notify) { 372 } else if (notify) {
372 ShowNotificationView(); 373 ShowNotificationView();
373 } 374 }
374 } 375 }
375 } 376 }
376 377
377 } // namespace internal 378 } // namespace internal
378 } // namespace ash 379 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698