| 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/shell/panel_window.h" | 5 #include "ash/shell/panel_window.h" |
| 6 | 6 |
| 7 #include "ash/screen_ash.h" | 7 #include "ash/screen_util.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/wm/panels/panel_frame_view.h" | 9 #include "ash/wm/panels/panel_frame_view.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "ui/aura/root_window.h" | 11 #include "ui/aura/root_window.h" |
| 12 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 13 #include "ui/gfx/canvas.h" | 13 #include "ui/gfx/canvas.h" |
| 14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 const int kMinWidth = 100; | 17 const int kMinWidth = 100; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 39 PanelWindow::~PanelWindow() { | 39 PanelWindow::~PanelWindow() { |
| 40 } | 40 } |
| 41 | 41 |
| 42 views::Widget* PanelWindow::CreateWidget() { | 42 views::Widget* PanelWindow::CreateWidget() { |
| 43 views::Widget* widget = new views::Widget; | 43 views::Widget* widget = new views::Widget; |
| 44 | 44 |
| 45 if (params().bounds.width() == 0) | 45 if (params().bounds.width() == 0) |
| 46 params().bounds.set_width(kDefaultWidth); | 46 params().bounds.set_width(kDefaultWidth); |
| 47 if (params().bounds.height() == 0) | 47 if (params().bounds.height() == 0) |
| 48 params().bounds.set_height(kDefaultHeight); | 48 params().bounds.set_height(kDefaultHeight); |
| 49 params().bounds = ScreenAsh::ConvertRectToScreen( | 49 params().bounds = ScreenUtil::ConvertRectToScreen( |
| 50 Shell::GetTargetRootWindow(), | 50 Shell::GetTargetRootWindow(), |
| 51 params().bounds); | 51 params().bounds); |
| 52 | 52 |
| 53 widget->Init(params()); | 53 widget->Init(params()); |
| 54 widget->GetNativeView()->SetName(name_); | 54 widget->GetNativeView()->SetName(name_); |
| 55 widget->Show(); | 55 widget->Show(); |
| 56 | 56 |
| 57 return widget; | 57 return widget; |
| 58 } | 58 } |
| 59 | 59 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 80 bool PanelWindow::CanMaximize() const { | 80 bool PanelWindow::CanMaximize() const { |
| 81 return false; | 81 return false; |
| 82 } | 82 } |
| 83 | 83 |
| 84 views::NonClientFrameView* PanelWindow::CreateNonClientFrameView( | 84 views::NonClientFrameView* PanelWindow::CreateNonClientFrameView( |
| 85 views::Widget* widget) { | 85 views::Widget* widget) { |
| 86 return new PanelFrameView(widget, PanelFrameView::FRAME_NONE); | 86 return new PanelFrameView(widget, PanelFrameView::FRAME_NONE); |
| 87 } | 87 } |
| 88 | 88 |
| 89 } // namespace ash | 89 } // namespace ash |
| OLD | NEW |