OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/monitor/secondary_monitor_view.h" |
| 6 |
| 7 #include "third_party/skia/include/core/SkColor.h" |
| 8 #include "ui/aura/window.h" |
| 9 #include "ui/views/view.h" |
| 10 #include "ui/views/background.h" |
| 11 #include "ui/views/widget/widget_delegate.h" |
| 12 #include "ui/views/widget/widget.h" |
| 13 |
| 14 namespace ash { |
| 15 namespace { |
| 16 |
| 17 const SkColor kBackground = SkColorSetRGB(0x33, 0x33, 0x33); |
| 18 |
| 19 // A view to be displayed on secondary monitor. |
| 20 class SecondaryMonitorView : public views::WidgetDelegateView { |
| 21 public: |
| 22 SecondaryMonitorView() { |
| 23 set_background(views::Background::CreateSolidBackground(kBackground)); |
| 24 } |
| 25 ~SecondaryMonitorView() { |
| 26 } |
| 27 }; |
| 28 |
| 29 } // namespace |
| 30 |
| 31 views::Widget* CreateSecondaryMonitorWidget(aura::Window* parent) { |
| 32 views::Widget* desktop_widget = new views::Widget; |
| 33 views::Widget::InitParams params( |
| 34 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 35 SecondaryMonitorView* view = new SecondaryMonitorView(); |
| 36 params.delegate = view; |
| 37 params.parent = parent; |
| 38 desktop_widget->Init(params); |
| 39 desktop_widget->SetContentsView(view); |
| 40 desktop_widget->Show(); |
| 41 desktop_widget->GetNativeView()->SetName("SecondaryMonitor"); |
| 42 return desktop_widget; |
| 43 } |
| 44 |
| 45 } // namespace ash |
OLD | NEW |