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

Side by Side Diff: ash/system/tray_accessibility.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_views.cc ('k') | ash/system/tray_caps_lock.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_accessibility.h" 5 #include "ash/system/tray_accessibility.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray_delegate.h" 8 #include "ash/system/tray/system_tray_delegate.h"
9 #include "ash/system/tray/tray_constants.h" 9 #include "ash/system/tray/tray_constants.h"
10 #include "ash/system/tray/tray_views.h" 10 #include "ash/system/tray/tray_views.h"
(...skipping 14 matching lines...) Expand all
25 DefaultAccessibilityView() { 25 DefaultAccessibilityView() {
26 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 26 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
27 kTrayPopupPaddingHorizontal, 27 kTrayPopupPaddingHorizontal,
28 0, 28 0,
29 kTrayPopupPaddingBetweenItems)); 29 kTrayPopupPaddingBetweenItems));
30 30
31 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 31 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
32 FixedSizedImageView* image = 32 FixedSizedImageView* image =
33 new FixedSizedImageView(0, kTrayPopupItemHeight); 33 new FixedSizedImageView(0, kTrayPopupItemHeight);
34 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_ACCESSIBILITY). 34 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_ACCESSIBILITY).
35 ToSkBitmap()); 35 ToImageSkia());
36 36
37 AddChildView(image); 37 AddChildView(image);
38 string16 label = bundle.GetLocalizedString( 38 string16 label = bundle.GetLocalizedString(
39 IDS_ASH_STATUS_TRAY_DISABLE_SPOKEN_FEEDBACK); 39 IDS_ASH_STATUS_TRAY_DISABLE_SPOKEN_FEEDBACK);
40 AddChildView(new views::Label(label)); 40 AddChildView(new views::Label(label));
41 SetAccessibleName(label); 41 SetAccessibleName(label);
42 } 42 }
43 43
44 virtual ~DefaultAccessibilityView() {} 44 virtual ~DefaultAccessibilityView() {}
45 45
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 CHECK(detailed_ == NULL); 85 CHECK(detailed_ == NULL);
86 detailed_ = new views::View; 86 detailed_ = new views::View;
87 87
88 detailed_->SetLayoutManager(new 88 detailed_->SetLayoutManager(new
89 views::BoxLayout(views::BoxLayout::kHorizontal, 89 views::BoxLayout(views::BoxLayout::kHorizontal,
90 kTrayPopupPaddingHorizontal, 10, kTrayPopupPaddingBetweenItems)); 90 kTrayPopupPaddingHorizontal, 10, kTrayPopupPaddingBetweenItems));
91 91
92 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 92 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
93 views::ImageView* image = new views::ImageView; 93 views::ImageView* image = new views::ImageView;
94 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_ACCESSIBILITY). 94 image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_ACCESSIBILITY).
95 ToSkBitmap()); 95 ToImageSkia());
96 96
97 detailed_->AddChildView(image); 97 detailed_->AddChildView(image);
98 detailed_->AddChildView(new views::Label( 98 detailed_->AddChildView(new views::Label(
99 bundle.GetLocalizedString(string_id_))); 99 bundle.GetLocalizedString(string_id_)));
100 100
101 return detailed_; 101 return detailed_;
102 } 102 }
103 103
104 void TrayAccessibility::DestroyDefaultView() { 104 void TrayAccessibility::DestroyDefaultView() {
105 default_ = NULL; 105 default_ = NULL;
(...skipping 12 matching lines...) Expand all
118 string_id_ = string_id; 118 string_id_ = string_id;
119 PopupDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false); 119 PopupDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false);
120 } else if (detailed_) { 120 } else if (detailed_) {
121 string_id_ = 0; 121 string_id_ = 0;
122 detailed_->GetWidget()->Close(); 122 detailed_->GetWidget()->Close();
123 } 123 }
124 } 124 }
125 125
126 } // namespace internal 126 } // namespace internal
127 } // namespace ash 127 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tray_views.cc ('k') | ash/system/tray_caps_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698