OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/window/window_delegate.h" | 5 #include "views/window/window_delegate.h" |
6 #include "views/views_delegate.h" | 6 #include "views/views_delegate.h" |
7 #include "views/window/client_view.h" | 7 #include "views/window/client_view.h" |
8 #include "views/window/window.h" | 8 #include "views/window/window.h" |
9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 | 10 |
11 namespace views { | 11 namespace views { |
12 | 12 |
13 WindowDelegate::WindowDelegate() : window_(NULL) { | 13 WindowDelegate::WindowDelegate() : window_(NULL) { |
14 } | 14 } |
15 | 15 |
16 WindowDelegate::~WindowDelegate() { | 16 WindowDelegate::~WindowDelegate() { |
17 } | 17 } |
18 | 18 |
| 19 DialogDelegate* WindowDelegate::AsDialogDelegate() { |
| 20 return NULL; |
| 21 } |
| 22 |
| 23 bool WindowDelegate::CanResize() const { |
| 24 return false; |
| 25 } |
| 26 |
| 27 bool WindowDelegate::CanMaximize() const { |
| 28 return false; |
| 29 } |
| 30 |
| 31 bool WindowDelegate::IsModal() const { |
| 32 return false; |
| 33 } |
| 34 |
| 35 AccessibilityTypes::Role WindowDelegate::accessible_role() const { |
| 36 return AccessibilityTypes::ROLE_WINDOW; |
| 37 } |
| 38 |
| 39 AccessibilityTypes::State WindowDelegate::accessible_state() const { |
| 40 return 0; |
| 41 } |
| 42 |
| 43 std::wstring WindowDelegate::GetAccessibleWindowTitle() const { |
| 44 return GetWindowTitle(); |
| 45 } |
| 46 |
| 47 std::wstring WindowDelegate::GetWindowTitle() const { |
| 48 return L""; |
| 49 } |
| 50 |
| 51 View* WindowDelegate::GetInitiallyFocusedView() { |
| 52 return NULL; |
| 53 } |
| 54 |
| 55 bool WindowDelegate::ShouldShowWindowTitle() const { |
| 56 return true; |
| 57 } |
| 58 |
| 59 bool WindowDelegate::ShouldShowClientEdge() const { |
| 60 return true; |
| 61 } |
| 62 |
19 SkBitmap WindowDelegate::GetWindowAppIcon() { | 63 SkBitmap WindowDelegate::GetWindowAppIcon() { |
20 // Use the window icon as app icon by default. | 64 // Use the window icon as app icon by default. |
21 return GetWindowIcon(); | 65 return GetWindowIcon(); |
22 } | 66 } |
23 | 67 |
24 // Returns the icon to be displayed in the window. | 68 // Returns the icon to be displayed in the window. |
25 SkBitmap WindowDelegate::GetWindowIcon() { | 69 SkBitmap WindowDelegate::GetWindowIcon() { |
26 return SkBitmap(); | 70 return SkBitmap(); |
27 } | 71 } |
28 | 72 |
| 73 bool WindowDelegate::ShouldShowWindowIcon() const { |
| 74 return false; |
| 75 } |
| 76 |
| 77 bool WindowDelegate::ExecuteWindowsCommand(int command_id) { |
| 78 return false; |
| 79 } |
| 80 |
| 81 std::wstring WindowDelegate::GetWindowName() const { |
| 82 return std::wstring(); |
| 83 } |
| 84 |
29 void WindowDelegate::SaveWindowPlacement(const gfx::Rect& bounds, | 85 void WindowDelegate::SaveWindowPlacement(const gfx::Rect& bounds, |
30 bool maximized) { | 86 bool maximized) { |
31 std::wstring window_name = GetWindowName(); | 87 std::wstring window_name = GetWindowName(); |
32 if (!ViewsDelegate::views_delegate || window_name.empty()) | 88 if (!ViewsDelegate::views_delegate || window_name.empty()) |
33 return; | 89 return; |
34 | 90 |
35 ViewsDelegate::views_delegate->SaveWindowPlacement( | 91 ViewsDelegate::views_delegate->SaveWindowPlacement( |
36 window_, window_name, bounds, maximized); | 92 window_, window_name, bounds, maximized); |
37 } | 93 } |
38 | 94 |
(...skipping 12 matching lines...) Expand all Loading... |
51 return false; | 107 return false; |
52 | 108 |
53 return ViewsDelegate::views_delegate->GetSavedMaximizedState( | 109 return ViewsDelegate::views_delegate->GetSavedMaximizedState( |
54 window_, window_name, maximized); | 110 window_, window_name, maximized); |
55 } | 111 } |
56 | 112 |
57 bool WindowDelegate::ShouldRestoreWindowSize() const { | 113 bool WindowDelegate::ShouldRestoreWindowSize() const { |
58 return true; | 114 return true; |
59 } | 115 } |
60 | 116 |
| 117 View* WindowDelegate::GetContentsView() { |
| 118 return NULL; |
| 119 } |
| 120 |
61 ClientView* WindowDelegate::CreateClientView(Window* window) { | 121 ClientView* WindowDelegate::CreateClientView(Window* window) { |
62 return new ClientView(window, GetContentsView()); | 122 return new ClientView(window, GetContentsView()); |
63 } | 123 } |
64 | 124 |
65 } // namespace views | 125 } // namespace views |
OLD | NEW |