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

Side by Side Diff: ash/common/system/chromeos/power/power_status.h

Issue 2774093002: Change PowerStatus::GetBatteryImage to not use ExtractImageRep and scale (Closed)
Patch Set: powericon: name Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_POWER_POWER_STATUS_H_ 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_POWER_POWER_STATUS_H_
6 #define ASH_COMMON_SYSTEM_CHROMEOS_POWER_POWER_STATUS_H_ 6 #define ASH_COMMON_SYSTEM_CHROMEOS_POWER_POWER_STATUS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 // A helper function called by GetBatteryImageInfo(). Populates the 223 // A helper function called by GetBatteryImageInfo(). Populates the
224 // MD-specific fields of |info|. 224 // MD-specific fields of |info|.
225 void CalculateBatteryImageInfoMd(BatteryImageInfo* info) const; 225 void CalculateBatteryImageInfoMd(BatteryImageInfo* info) const;
226 226
227 // A helper function called by GetBatteryImageInfo(). Populates the 227 // A helper function called by GetBatteryImageInfo(). Populates the
228 // non-MD-specific fields of |info|. 228 // non-MD-specific fields of |info|.
229 void CalculateBatteryImageInfoNonMd(BatteryImageInfo* info, 229 void CalculateBatteryImageInfoNonMd(BatteryImageInfo* info,
230 const IconSet& icon_set) const; 230 const IconSet& icon_set) const;
231 231
232 // The size of the image GetBatteryImage will return, in DIP.
233 static gfx::Size GetBatteryImageSizeInDip();
234
232 // Creates a new image that should be shown for the battery's current state. 235 // Creates a new image that should be shown for the battery's current state.
233 gfx::ImageSkia GetBatteryImage(const BatteryImageInfo& info) const; 236 gfx::ImageSkiaRep GetBatteryImage(const BatteryImageInfo& info,
234 237 float scale) const;
235 // A version of GetBatteryImage() that is used when material design is not
236 // enabled.
237 // TODO(tdanderson): Remove this once material design is enabled by default.
238 // See crbug.com/614453.
239 gfx::ImageSkia GetBatteryImageNonMd(const BatteryImageInfo& info) const;
240 238
241 // Returns an string describing the current state for accessibility. 239 // Returns an string describing the current state for accessibility.
242 base::string16 GetAccessibleNameString(bool full_description) const; 240 base::string16 GetAccessibleNameString(bool full_description) const;
243 241
244 // Updates |proto_|. Does not notify observers. 242 // Updates |proto_|. Does not notify observers.
245 void SetProtoForTesting(const power_manager::PowerSupplyProperties& proto); 243 void SetProtoForTesting(const power_manager::PowerSupplyProperties& proto);
246 244
247 protected: 245 protected:
248 PowerStatus(); 246 PowerStatus();
249 ~PowerStatus() override; 247 ~PowerStatus() override;
250 248
251 private: 249 private:
252 // Overriden from PowerManagerClient::Observer. 250 // Overriden from PowerManagerClient::Observer.
253 void PowerChanged(const power_manager::PowerSupplyProperties& proto) override; 251 void PowerChanged(const power_manager::PowerSupplyProperties& proto) override;
254 252
255 base::ObserverList<Observer> observers_; 253 base::ObserverList<Observer> observers_;
256 254
257 // Current state. 255 // Current state.
258 power_manager::PowerSupplyProperties proto_; 256 power_manager::PowerSupplyProperties proto_;
259 257
260 DISALLOW_COPY_AND_ASSIGN(PowerStatus); 258 DISALLOW_COPY_AND_ASSIGN(PowerStatus);
261 }; 259 };
262 260
263 } // namespace ash 261 } // namespace ash
264 262
265 #endif // ASH_COMMON_SYSTEM_CHROMEOS_POWER_POWER_STATUS_H_ 263 #endif // ASH_COMMON_SYSTEM_CHROMEOS_POWER_POWER_STATUS_H_
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/chromeos/power/power_status.cc » ('j') | ash/common/system/chromeos/power/power_status.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698