Index: ash/system/fractional_view/tray_scale.cc |
diff --git a/ash/system/fractional_view/tray_scale.cc b/ash/system/fractional_view/tray_scale.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..777bb2c85234262408e6861ffc8d368cf51fa171 |
--- /dev/null |
+++ b/ash/system/fractional_view/tray_scale.cc |
@@ -0,0 +1,64 @@ |
+// Copyright 2014 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. |
+ |
+#include "ash/system/fractional_view/tray_scale.h" |
+ |
+#include "ash/resources/vector_icons/vector_icons.h" |
+#include "ash/root_window_controller.h" |
+#include "ash/shell_port.h" |
+#include "ash/system/fractional_view/scale_detailed_view.h" |
+#include "ash/system/fractional_view/scale_view.h" |
+#include "ash/system/tray/system_tray.h" |
+#include "ash/system/tray/tray_constants.h" |
+#include "ash/wm_window.h" |
+#include "ui/display/display.h" |
+#include "ui/display/manager/managed_display_info.h" |
+#include "ui/display/screen.h" |
+#include "ui/views/view.h" |
+ |
+namespace ash { |
+ |
+TrayScale::TrayScale(SystemTray* system_tray) |
+ : TrayImageItem(system_tray, kSystemTrayVolumeMuteIcon, UMA_NOT_RECORDED) { |
+ display::Screen::GetScreen()->AddObserver(this); |
+} |
+ |
+TrayScale::~TrayScale() { |
+ display::Screen::GetScreen()->RemoveObserver(this); |
+} |
+ |
+views::View* TrayScale::CreateDefaultView(LoginStatus status) { |
+ scale_view_ = new tray::ScaleView(this, true); |
+ return scale_view_; |
+} |
+ |
+views::View* TrayScale::CreateDetailedView(LoginStatus status) { |
+ scale_detail_view_ = new tray::ScaleDetailedView(this); |
+ return scale_detail_view_; |
+} |
+ |
+void TrayScale::DestroyDefaultView() { |
+ scale_view_ = nullptr; |
+} |
+ |
+void TrayScale::DestroyDetailedView() { |
+ scale_detail_view_ = nullptr; |
+} |
+ |
+bool TrayScale::ShouldShowShelf() const { |
+ return true; |
+} |
+ |
+void TrayScale::OnDisplayAdded(const display::Display& new_display) {} |
+ |
+void TrayScale::OnDisplayRemoved(const display::Display& old_display) {} |
+ |
+void TrayScale::OnDisplayMetricsChanged(const display::Display& display, |
+ uint32_t changed_metrics) {} |
+ |
+bool TrayScale::GetInitialVisibility() { |
+ return true; |
+} |
+ |
+} // namespace ash |