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

Side by Side Diff: ash/system/brightness/tray_brightness.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: 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
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/brightness/tray_brightness.h" 5 #include "ash/system/brightness/tray_brightness.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/brightness/brightness_control_delegate.h" 9 #include "ash/system/brightness/brightness_control_delegate.h"
10 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 public: 45 public:
46 explicit BrightnessView(double initial_percent) 46 explicit BrightnessView(double initial_percent)
47 : dragging_(false), 47 : dragging_(false),
48 last_percent_(initial_percent) { 48 last_percent_(initial_percent) {
49 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 49 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
50 kTrayPopupPaddingHorizontal, 0, kTrayPopupPaddingBetweenItems)); 50 kTrayPopupPaddingHorizontal, 0, kTrayPopupPaddingBetweenItems));
51 51
52 views::ImageView* icon = new FixedSizedImageView(0, kTrayPopupItemHeight); 52 views::ImageView* icon = new FixedSizedImageView(0, kTrayPopupItemHeight);
53 gfx::Image image = ui::ResourceBundle::GetSharedInstance().GetImageNamed( 53 gfx::Image image = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
54 IDR_AURA_UBER_TRAY_BRIGHTNESS); 54 IDR_AURA_UBER_TRAY_BRIGHTNESS);
55 icon->SetImage(image.ToSkBitmap()); 55 icon->SetImage(image.ToImageSkia());
56 AddChildView(icon); 56 AddChildView(icon);
57 57
58 slider_ = new views::Slider(this, views::Slider::HORIZONTAL); 58 slider_ = new views::Slider(this, views::Slider::HORIZONTAL);
59 slider_->set_focus_border_color(kFocusBorderColor); 59 slider_->set_focus_border_color(kFocusBorderColor);
60 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); 60 slider_->SetValue(static_cast<float>(initial_percent / 100.0));
61 slider_->SetAccessibleName( 61 slider_->SetAccessibleName(
62 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( 62 ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
63 IDS_ASH_STATUS_TRAY_BRIGHTNESS)); 63 IDS_ASH_STATUS_TRAY_BRIGHTNESS));
64 AddChildView(slider_); 64 AddChildView(slider_);
65 } 65 }
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 return; 200 return;
201 201
202 if (brightness_view_) 202 if (brightness_view_)
203 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); 203 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds);
204 else 204 else
205 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); 205 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false);
206 } 206 }
207 207
208 } // namespace internal 208 } // namespace internal
209 } // namespace ash 209 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698