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

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

Issue 10382144: Change SetImage, SetBackground, and SetToggledImage to take in a gfx::ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 7 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_item_more.h ('k') | ash/system/tray/tray_views.cc » ('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_item_more.h" 5 #include "ash/system/tray/tray_item_more.h"
6 6
7 #include "ash/system/tray/system_tray_item.h" 7 #include "ash/system/tray/system_tray_item.h"
8 #include "ash/system/tray/tray_constants.h" 8 #include "ash/system/tray/tray_constants.h"
9 #include "ash/system/tray/tray_views.h" 9 #include "ash/system/tray/tray_views.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 14 matching lines...) Expand all
25 25
26 icon_ = new FixedSizedImageView(0, kTrayPopupItemHeight); 26 icon_ = new FixedSizedImageView(0, kTrayPopupItemHeight);
27 AddChildView(icon_); 27 AddChildView(icon_);
28 28
29 label_ = new views::Label; 29 label_ = new views::Label;
30 AddChildView(label_); 30 AddChildView(label_);
31 31
32 more_ = new views::ImageView; 32 more_ = new views::ImageView;
33 more_->EnableCanvasFlippingForRTLUI(true); 33 more_->EnableCanvasFlippingForRTLUI(true);
34 more_->SetImage(ui::ResourceBundle::GetSharedInstance().GetImageNamed( 34 more_->SetImage(ui::ResourceBundle::GetSharedInstance().GetImageNamed(
35 IDR_AURA_UBER_TRAY_MORE).ToSkBitmap()); 35 IDR_AURA_UBER_TRAY_MORE).ToImageSkia());
36 AddChildView(more_); 36 AddChildView(more_);
37 } 37 }
38 38
39 TrayItemMore::~TrayItemMore() { 39 TrayItemMore::~TrayItemMore() {
40 } 40 }
41 41
42 void TrayItemMore::SetLabel(const string16& label) { 42 void TrayItemMore::SetLabel(const string16& label) {
43 label_->SetText(label); 43 label_->SetText(label);
44 Layout(); 44 Layout();
45 SchedulePaint(); 45 SchedulePaint();
46 } 46 }
47 47
48 void TrayItemMore::SetImage(const SkBitmap* bitmap) { 48 void TrayItemMore::SetImage(const gfx::ImageSkia* image_skia) {
49 icon_->SetImage(bitmap); 49 icon_->SetImage(image_skia);
50 SchedulePaint(); 50 SchedulePaint();
51 } 51 }
52 52
53 void TrayItemMore::SetAccessibleName(const string16& name) { 53 void TrayItemMore::SetAccessibleName(const string16& name) {
54 accessible_name_ = name; 54 accessible_name_ = name;
55 } 55 }
56 56
57 void TrayItemMore::ReplaceIcon(views::View* view) { 57 void TrayItemMore::ReplaceIcon(views::View* view) {
58 delete icon_; 58 delete icon_;
59 icon_ = NULL; 59 icon_ = NULL;
(...skipping 25 matching lines...) Expand all
85 } 85 }
86 } 86 }
87 87
88 void TrayItemMore::GetAccessibleState(ui::AccessibleViewState* state) { 88 void TrayItemMore::GetAccessibleState(ui::AccessibleViewState* state) {
89 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; 89 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON;
90 state->name = accessible_name_; 90 state->name = accessible_name_;
91 } 91 }
92 92
93 } // namespace internal 93 } // namespace internal
94 } // namespace ash 94 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tray_item_more.h ('k') | ash/system/tray/tray_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698