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/public/cpp/window_properties.h" | 7 #include "ash/public/cpp/window_properties.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" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 | 49 |
50 widget->Init(params()); | 50 widget->Init(params()); |
51 widget->GetNativeView()->SetName(name_); | 51 widget->GetNativeView()->SetName(name_); |
52 widget->GetNativeWindow()->SetProperty<int>(kShelfItemTypeKey, | 52 widget->GetNativeWindow()->SetProperty<int>(kShelfItemTypeKey, |
53 TYPE_APP_PANEL); | 53 TYPE_APP_PANEL); |
54 widget->Show(); | 54 widget->Show(); |
55 | 55 |
56 return widget; | 56 return widget; |
57 } | 57 } |
58 | 58 |
59 gfx::Size PanelWindow::GetPreferredSize() const { | 59 gfx::Size PanelWindow::CalculatePreferredSize() const { |
sky
2017/05/22 17:30:58
set_preferred_size?
| |
60 return gfx::Size(kMinWidth, kMinHeight); | 60 return gfx::Size(kMinWidth, kMinHeight); |
61 } | 61 } |
62 | 62 |
63 void PanelWindow::OnPaint(gfx::Canvas* canvas) { | 63 void PanelWindow::OnPaint(gfx::Canvas* canvas) { |
64 canvas->FillRect(GetLocalBounds(), SK_ColorGREEN); | 64 canvas->FillRect(GetLocalBounds(), SK_ColorGREEN); |
65 } | 65 } |
66 | 66 |
67 base::string16 PanelWindow::GetWindowTitle() const { | 67 base::string16 PanelWindow::GetWindowTitle() const { |
68 return base::ASCIIToUTF16(name_); | 68 return base::ASCIIToUTF16(name_); |
69 } | 69 } |
70 | 70 |
71 bool PanelWindow::CanResize() const { | 71 bool PanelWindow::CanResize() const { |
72 return true; | 72 return true; |
73 } | 73 } |
74 | 74 |
75 bool PanelWindow::CanMaximize() const { | 75 bool PanelWindow::CanMaximize() const { |
76 return false; | 76 return false; |
77 } | 77 } |
78 | 78 |
79 bool PanelWindow::CanMinimize() const { | 79 bool PanelWindow::CanMinimize() const { |
80 return false; | 80 return false; |
81 } | 81 } |
82 | 82 |
83 views::NonClientFrameView* PanelWindow::CreateNonClientFrameView( | 83 views::NonClientFrameView* PanelWindow::CreateNonClientFrameView( |
84 views::Widget* widget) { | 84 views::Widget* widget) { |
85 return new PanelFrameView(widget, PanelFrameView::FRAME_NONE); | 85 return new PanelFrameView(widget, PanelFrameView::FRAME_NONE); |
86 } | 86 } |
87 | 87 |
88 } // namespace ash | 88 } // namespace ash |
OLD | NEW |