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

Side by Side Diff: ash/system/tray/tray_image_item.cc

Issue 10915214: ash: Update system update notification behaviour. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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/system/tray/tray_image_item.h ('k') | ash/system/tray_update.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/tray/tray_image_item.h" 5 #include "ash/system/tray/tray_image_item.h"
6 6
7 #include "ash/system/tray/tray_item_view.h" 7 #include "ash/system/tray/tray_item_view.h"
8 #include "ash/system/tray/tray_views.h" 8 #include "ash/system/tray/tray_views.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/image/image.h" 10 #include "ui/gfx/image/image.h"
11 #include "ui/views/controls/image_view.h" 11 #include "ui/views/controls/image_view.h"
12 #include "ui/views/layout/fill_layout.h" 12 #include "ui/views/layout/fill_layout.h"
13 13
14 namespace ash { 14 namespace ash {
15 namespace internal { 15 namespace internal {
16 16
17 TrayImageItem::TrayImageItem(int resource_id) 17 TrayImageItem::TrayImageItem(int resource_id)
18 : resource_id_(resource_id), 18 : resource_id_(resource_id),
19 tray_view_(NULL) { 19 tray_view_(NULL) {
20 } 20 }
21 21
22 TrayImageItem::~TrayImageItem() {} 22 TrayImageItem::~TrayImageItem() {}
23 23
24 views::View* TrayImageItem::tray_view() { 24 views::View* TrayImageItem::tray_view() {
25 return tray_view_; 25 return tray_view_;
26 } 26 }
27 27
28 void TrayImageItem::SetImageFromResourceId(int resource_id) {
29 resource_id_ = resource_id;
30 if (!tray_view_)
31 return;
32 tray_view_->image_view()->SetImage(ui::ResourceBundle::GetSharedInstance().
33 GetImageNamed(resource_id_).ToImageSkia());
34 }
35
28 views::View* TrayImageItem::CreateTrayView(user::LoginStatus status) { 36 views::View* TrayImageItem::CreateTrayView(user::LoginStatus status) {
29 CHECK(tray_view_ == NULL); 37 CHECK(tray_view_ == NULL);
30 tray_view_ = new TrayItemView; 38 tray_view_ = new TrayItemView;
31 tray_view_->CreateImageView(); 39 tray_view_->CreateImageView();
32 tray_view_->image_view()->SetImage(ui::ResourceBundle::GetSharedInstance(). 40 tray_view_->image_view()->SetImage(ui::ResourceBundle::GetSharedInstance().
33 GetImageNamed(resource_id_).ToImageSkia()); 41 GetImageNamed(resource_id_).ToImageSkia());
34 tray_view_->SetVisible(GetInitialVisibility()); 42 tray_view_->SetVisible(GetInitialVisibility());
35 return tray_view_; 43 return tray_view_;
36 } 44 }
37 45
(...skipping 17 matching lines...) Expand all
55 } 63 }
56 64
57 void TrayImageItem::DestroyDefaultView() { 65 void TrayImageItem::DestroyDefaultView() {
58 } 66 }
59 67
60 void TrayImageItem::DestroyDetailedView() { 68 void TrayImageItem::DestroyDetailedView() {
61 } 69 }
62 70
63 } // namespace internal 71 } // namespace internal
64 } // namespace ash 72 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tray_image_item.h ('k') | ash/system/tray_update.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698