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

Unified Diff: ash/system/power/power_status_view.h

Issue 10540041: Add battery status to settings row in uber tray bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash_strings.grd ('k') | ash/system/power/power_status_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/power/power_status_view.h
diff --git a/ash/system/power/power_status_view.h b/ash/system/power/power_status_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..a673c1a941a0fdc7172de148bd7611801d568141
--- /dev/null
+++ b/ash/system/power/power_status_view.h
@@ -0,0 +1,65 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_
+#define ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_
+#pragma once
+
+#include "ash/system/power/power_supply_status.h"
+#include "ui/views/view.h"
+
+namespace views {
+class ImageView;
+class Label;
+}
+
+namespace ash {
+namespace internal {
+
+class PowerStatusView : public views::View {
+ public:
+ enum ViewType {
+ VIEW_DEFAULT,
+ VIEW_NOTIFICATION
+ };
+
+ explicit PowerStatusView(ViewType view_type);
+ virtual ~PowerStatusView() {}
+
+ void UpdatePowerStatus(const PowerSupplyStatus& status);
+
+ // Overridden from views::View.
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
+
+ private:
+ void LayoutDefaultView();
+ void LayoutNotificationView();
+ void UpdateText();
+ void UpdateIcon();
+ void Update();
+ void UpdateTextForDefaultView();
+ void UpdateTextForNotificationView();
+
+ // Overridden from views::View.
+ virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;
+
+ // labels used only for VIEW_NOTIFICATION.
+ views::Label* status_label_;
+ views::Label* time_label_;
+
+ // labels used only for VIEW_DEFAULT.
+ views::Label* time_status_label_;
+
+ views::ImageView* icon_;
+ ViewType view_type_;
+
+ PowerSupplyStatus supply_status_;
+
+ DISALLOW_COPY_AND_ASSIGN(PowerStatusView);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_
« no previous file with comments | « ash/ash_strings.grd ('k') | ash/system/power/power_status_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698