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

Unified Diff: ash/monitor/secondary_monitor_view.cc

Issue 9701098: MultiMonitor support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix shutdown order Created 8 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 side-by-side diff with in-line comments
Download patch
Index: ash/monitor/secondary_monitor_view.cc
diff --git a/ash/monitor/secondary_monitor_view.cc b/ash/monitor/secondary_monitor_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a57093255247bc50f1107e1cdc31985165f453e3
--- /dev/null
+++ b/ash/monitor/secondary_monitor_view.cc
@@ -0,0 +1,45 @@
+// 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.
+
+#include "ash/monitor/secondary_monitor_view.h"
+
+#include "third_party/skia/include/core/SkColor.h"
+#include "ui/aura/window.h"
+#include "ui/views/view.h"
+#include "ui/views/background.h"
+#include "ui/views/widget/widget_delegate.h"
+#include "ui/views/widget/widget.h"
+
+namespace ash {
+namespace {
+
+const SkColor kBackground = SkColorSetRGB(0x33, 0x33, 0x33);
+
+// A view to be displayed on secondary monitor.
+class SecondaryMonitorView : public views::WidgetDelegateView {
+ public:
+ SecondaryMonitorView() {
+ set_background(views::Background::CreateSolidBackground(kBackground));
+ }
+ ~SecondaryMonitorView() {
+ }
+};
+
+} // namespace
+
+views::Widget* CreateSecondaryMonitorWidget(aura::Window* parent) {
+ views::Widget* desktop_widget = new views::Widget;
+ views::Widget::InitParams params(
+ views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
+ SecondaryMonitorView* view = new SecondaryMonitorView();
+ params.delegate = view;
+ params.parent = parent;
+ desktop_widget->Init(params);
+ desktop_widget->SetContentsView(view);
+ desktop_widget->Show();
+ desktop_widget->GetNativeView()->SetName("SecondaryMonitor");
+ return desktop_widget;
+}
+
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698