| 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 "ui/views/widget/widget_delegate.h" | 5 #include "ui/views/widget/widget_delegate.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
| 8 #include "ui/gfx/image/image_skia.h" | 9 #include "ui/gfx/image/image_skia.h" |
| 9 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
| 10 #include "ui/views/views_delegate.h" | 11 #include "ui/views/views_delegate.h" |
| 11 #include "ui/views/widget/widget.h" | 12 #include "ui/views/widget/widget.h" |
| 12 #include "ui/views/window/client_view.h" | 13 #include "ui/views/window/client_view.h" |
| 13 | 14 |
| 14 namespace views { | 15 namespace views { |
| 15 | 16 |
| 16 //////////////////////////////////////////////////////////////////////////////// | 17 //////////////////////////////////////////////////////////////////////////////// |
| 17 // WidgetDelegate: | 18 // WidgetDelegate: |
| (...skipping 29 matching lines...) Expand all Loading... |
| 47 } | 48 } |
| 48 | 49 |
| 49 bool WidgetDelegate::CanMaximize() const { | 50 bool WidgetDelegate::CanMaximize() const { |
| 50 return false; | 51 return false; |
| 51 } | 52 } |
| 52 | 53 |
| 53 bool WidgetDelegate::CanMinimize() const { | 54 bool WidgetDelegate::CanMinimize() const { |
| 54 return false; | 55 return false; |
| 55 } | 56 } |
| 56 | 57 |
| 58 int32_t WidgetDelegate::GetResizeBehavior() const { |
| 59 int32_t behavior = ui::mojom::kResizeBehaviorNone; |
| 60 if (CanResize()) |
| 61 behavior |= ui::mojom::kResizeBehaviorCanResize; |
| 62 if (CanMaximize()) |
| 63 behavior |= ui::mojom::kResizeBehaviorCanMaximize; |
| 64 if (CanMinimize()) |
| 65 behavior |= ui::mojom::kResizeBehaviorCanMinimize; |
| 66 return behavior; |
| 67 } |
| 68 |
| 57 bool WidgetDelegate::CanActivate() const { | 69 bool WidgetDelegate::CanActivate() const { |
| 58 return can_activate_; | 70 return can_activate_; |
| 59 } | 71 } |
| 60 | 72 |
| 61 ui::ModalType WidgetDelegate::GetModalType() const { | 73 ui::ModalType WidgetDelegate::GetModalType() const { |
| 62 return ui::MODAL_TYPE_NONE; | 74 return ui::MODAL_TYPE_NONE; |
| 63 } | 75 } |
| 64 | 76 |
| 65 ui::AXRole WidgetDelegate::GetAccessibleWindowRole() const { | 77 ui::AXRole WidgetDelegate::GetAccessibleWindowRole() const { |
| 66 return ui::AX_ROLE_WINDOW; | 78 return ui::AX_ROLE_WINDOW; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 218 |
| 207 views::View* WidgetDelegateView::GetContentsView() { | 219 views::View* WidgetDelegateView::GetContentsView() { |
| 208 return this; | 220 return this; |
| 209 } | 221 } |
| 210 | 222 |
| 211 const char* WidgetDelegateView::GetClassName() const { | 223 const char* WidgetDelegateView::GetClassName() const { |
| 212 return kViewClassName; | 224 return kViewClassName; |
| 213 } | 225 } |
| 214 | 226 |
| 215 } // namespace views | 227 } // namespace views |
| OLD | NEW |