OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "ash/wm/workspace/system_background_controller.h" | 5 #include "ash/wm/workspace/system_background_controller.h" |
6 | 6 |
7 #include "ash/shell_window_ids.h" | 7 #include "ash/shell_window_ids.h" |
8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 controller_ = NULL; | 47 controller_ = NULL; |
48 GetWidget()->Close(); | 48 GetWidget()->Close(); |
49 } | 49 } |
50 | 50 |
51 views::View* SystemBackgroundController::View::GetContentsView() { | 51 views::View* SystemBackgroundController::View::GetContentsView() { |
52 return this; | 52 return this; |
53 } | 53 } |
54 | 54 |
55 void SystemBackgroundController::View::OnPaint(gfx::Canvas* canvas) { | 55 void SystemBackgroundController::View::OnPaint(gfx::Canvas* canvas) { |
56 // TODO: get image! | 56 // TODO: get image! |
57 canvas->DrawColor(SK_ColorRED); | 57 canvas->DrawColor(SK_ColorBLACK); |
58 } | 58 } |
59 | 59 |
60 SystemBackgroundController::SystemBackgroundController(aura::RootWindow* root) | 60 SystemBackgroundController::SystemBackgroundController(aura::RootWindow* root) |
61 : ALLOW_THIS_IN_INITIALIZER_LIST(view_(new View(this))) { | 61 : ALLOW_THIS_IN_INITIALIZER_LIST(view_(new View(this))) { |
62 views::Widget* widget = new views::Widget; | 62 views::Widget* widget = new views::Widget; |
63 views::Widget::InitParams params( | 63 views::Widget::InitParams params( |
64 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 64 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
65 params.delegate = view_; | 65 params.delegate = view_; |
66 params.parent = root->GetChildById(kShellWindowId_SystemBackgroundContainer); | 66 params.parent = root->GetChildById(kShellWindowId_SystemBackgroundContainer); |
67 widget->Init(params); | 67 widget->Init(params); |
68 widget->SetBounds(params.parent->bounds()); | 68 widget->SetBounds(params.parent->bounds()); |
69 widget->Show(); | 69 widget->Show(); |
70 widget->GetNativeView()->SetName("SystemBackground"); | 70 widget->GetNativeView()->SetName("SystemBackground"); |
71 } | 71 } |
72 | 72 |
73 SystemBackgroundController::~SystemBackgroundController() { | 73 SystemBackgroundController::~SystemBackgroundController() { |
74 if (view_) | 74 if (view_) |
75 view_->Close(); | 75 view_->Close(); |
76 } | 76 } |
77 | 77 |
78 } // namespace internal | 78 } // namespace internal |
79 } // namespace ash | 79 } // namespace ash |
OLD | NEW |