OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "extensions/shell/browser/shell_native_app_window.h" |
| 6 |
| 7 #include "content/public/browser/web_contents.h" |
| 8 #include "ui/aura/window.h" |
| 9 #include "ui/gfx/geometry/insets.h" |
| 10 #include "ui/gfx/geometry/point.h" |
| 11 #include "ui/gfx/geometry/rect.h" |
| 12 #include "ui/gfx/geometry/size.h" |
| 13 |
| 14 namespace extensions { |
| 15 |
| 16 ShellNativeAppWindow::ShellNativeAppWindow( |
| 17 AppWindow* app_window, |
| 18 const AppWindow::CreateParams& params) |
| 19 : app_window_(app_window) { |
| 20 gfx::Rect bounds = params.GetInitialWindowBounds(GetFrameInsets()); |
| 21 bool position_specified = |
| 22 bounds.x() != AppWindow::BoundsSpecification::kUnspecifiedPosition && |
| 23 bounds.y() != AppWindow::BoundsSpecification::kUnspecifiedPosition; |
| 24 if (!position_specified) |
| 25 bounds.set_origin(GetBounds().origin()); |
| 26 SetBounds(bounds); |
| 27 } |
| 28 |
| 29 ShellNativeAppWindow::~ShellNativeAppWindow() { |
| 30 } |
| 31 |
| 32 bool ShellNativeAppWindow::IsActive() const { |
| 33 NOTIMPLEMENTED(); |
| 34 return false; |
| 35 } |
| 36 |
| 37 bool ShellNativeAppWindow::IsMaximized() const { |
| 38 NOTIMPLEMENTED(); |
| 39 return false; |
| 40 } |
| 41 |
| 42 bool ShellNativeAppWindow::IsMinimized() const { |
| 43 NOTIMPLEMENTED(); |
| 44 return false; |
| 45 } |
| 46 |
| 47 bool ShellNativeAppWindow::IsFullscreen() const { |
| 48 NOTIMPLEMENTED(); |
| 49 return false; |
| 50 } |
| 51 |
| 52 gfx::NativeWindow ShellNativeAppWindow::GetNativeWindow() { |
| 53 return GetWindow(); |
| 54 } |
| 55 |
| 56 gfx::Rect ShellNativeAppWindow::GetRestoredBounds() const { |
| 57 NOTIMPLEMENTED(); |
| 58 return GetBounds(); |
| 59 } |
| 60 |
| 61 ui::WindowShowState ShellNativeAppWindow::GetRestoredState() const { |
| 62 NOTIMPLEMENTED(); |
| 63 return ui::SHOW_STATE_NORMAL; |
| 64 } |
| 65 |
| 66 gfx::Rect ShellNativeAppWindow::GetBounds() const { |
| 67 return GetWindow()->GetBoundsInScreen(); |
| 68 } |
| 69 |
| 70 void ShellNativeAppWindow::Show() { |
| 71 GetWindow()->Show(); |
| 72 } |
| 73 |
| 74 void ShellNativeAppWindow::Hide() { |
| 75 GetWindow()->Hide(); |
| 76 } |
| 77 |
| 78 void ShellNativeAppWindow::ShowInactive() { |
| 79 NOTIMPLEMENTED(); |
| 80 } |
| 81 |
| 82 void ShellNativeAppWindow::Close() { |
| 83 NOTIMPLEMENTED(); |
| 84 } |
| 85 |
| 86 void ShellNativeAppWindow::Activate() { |
| 87 NOTIMPLEMENTED(); |
| 88 } |
| 89 |
| 90 void ShellNativeAppWindow::Deactivate() { |
| 91 NOTIMPLEMENTED(); |
| 92 } |
| 93 |
| 94 void ShellNativeAppWindow::Maximize() { |
| 95 NOTIMPLEMENTED(); |
| 96 } |
| 97 |
| 98 void ShellNativeAppWindow::Minimize() { |
| 99 NOTIMPLEMENTED(); |
| 100 } |
| 101 |
| 102 void ShellNativeAppWindow::Restore() { |
| 103 NOTIMPLEMENTED(); |
| 104 } |
| 105 |
| 106 void ShellNativeAppWindow::SetBounds(const gfx::Rect& bounds) { |
| 107 GetWindow()->SetBounds(bounds); |
| 108 } |
| 109 |
| 110 void ShellNativeAppWindow::FlashFrame(bool flash) { |
| 111 NOTIMPLEMENTED(); |
| 112 } |
| 113 |
| 114 bool ShellNativeAppWindow::IsAlwaysOnTop() const { |
| 115 NOTIMPLEMENTED(); |
| 116 return false; |
| 117 } |
| 118 |
| 119 void ShellNativeAppWindow::SetAlwaysOnTop(bool always_on_top) { |
| 120 NOTIMPLEMENTED(); |
| 121 } |
| 122 |
| 123 gfx::NativeView ShellNativeAppWindow::GetHostView() const { |
| 124 NOTIMPLEMENTED(); |
| 125 return NULL; |
| 126 } |
| 127 |
| 128 gfx::Point ShellNativeAppWindow::GetDialogPosition(const gfx::Size& size) { |
| 129 NOTIMPLEMENTED(); |
| 130 return gfx::Point(); |
| 131 } |
| 132 |
| 133 void ShellNativeAppWindow::AddObserver( |
| 134 web_modal::ModalDialogHostObserver* observer) { |
| 135 NOTIMPLEMENTED(); |
| 136 } |
| 137 |
| 138 void ShellNativeAppWindow::RemoveObserver( |
| 139 web_modal::ModalDialogHostObserver* observer) { |
| 140 NOTIMPLEMENTED(); |
| 141 } |
| 142 |
| 143 gfx::Size ShellNativeAppWindow::GetMaximumDialogSize() { |
| 144 NOTIMPLEMENTED(); |
| 145 return gfx::Size(); |
| 146 } |
| 147 |
| 148 void ShellNativeAppWindow::SetFullscreen(int fullscreen_types) { |
| 149 NOTIMPLEMENTED(); |
| 150 } |
| 151 |
| 152 bool ShellNativeAppWindow::IsFullscreenOrPending() const { |
| 153 NOTIMPLEMENTED(); |
| 154 return false; |
| 155 } |
| 156 |
| 157 void ShellNativeAppWindow::UpdateWindowIcon() { |
| 158 NOTIMPLEMENTED(); |
| 159 } |
| 160 |
| 161 void ShellNativeAppWindow::UpdateWindowTitle() { |
| 162 NOTIMPLEMENTED(); |
| 163 } |
| 164 |
| 165 void ShellNativeAppWindow::UpdateBadgeIcon() { |
| 166 NOTIMPLEMENTED(); |
| 167 } |
| 168 |
| 169 void ShellNativeAppWindow::UpdateDraggableRegions( |
| 170 const std::vector<DraggableRegion>& regions) { |
| 171 NOTIMPLEMENTED(); |
| 172 } |
| 173 |
| 174 SkRegion* ShellNativeAppWindow::GetDraggableRegion() { |
| 175 NOTIMPLEMENTED(); |
| 176 return NULL; |
| 177 } |
| 178 |
| 179 void ShellNativeAppWindow::UpdateShape(scoped_ptr<SkRegion> region) { |
| 180 NOTIMPLEMENTED(); |
| 181 } |
| 182 |
| 183 void ShellNativeAppWindow::HandleKeyboardEvent( |
| 184 const content::NativeWebKeyboardEvent& event) { |
| 185 NOTIMPLEMENTED(); |
| 186 } |
| 187 |
| 188 bool ShellNativeAppWindow::IsFrameless() const { |
| 189 NOTIMPLEMENTED(); |
| 190 return false; |
| 191 } |
| 192 |
| 193 bool ShellNativeAppWindow::HasFrameColor() const { |
| 194 NOTIMPLEMENTED(); |
| 195 return false; |
| 196 } |
| 197 |
| 198 SkColor ShellNativeAppWindow::ActiveFrameColor() const { |
| 199 NOTIMPLEMENTED(); |
| 200 return SkColor(); |
| 201 } |
| 202 |
| 203 SkColor ShellNativeAppWindow::InactiveFrameColor() const { |
| 204 NOTIMPLEMENTED(); |
| 205 return SkColor(); |
| 206 } |
| 207 |
| 208 gfx::Insets ShellNativeAppWindow::GetFrameInsets() const { |
| 209 NOTIMPLEMENTED(); |
| 210 return gfx::Insets(); |
| 211 } |
| 212 |
| 213 void ShellNativeAppWindow::ShowWithApp() { |
| 214 NOTIMPLEMENTED(); |
| 215 } |
| 216 |
| 217 void ShellNativeAppWindow::HideWithApp() { |
| 218 NOTIMPLEMENTED(); |
| 219 } |
| 220 |
| 221 void ShellNativeAppWindow::UpdateShelfMenu() { |
| 222 NOTIMPLEMENTED(); |
| 223 } |
| 224 |
| 225 gfx::Size ShellNativeAppWindow::GetContentMinimumSize() const { |
| 226 NOTIMPLEMENTED(); |
| 227 return gfx::Size(); |
| 228 } |
| 229 |
| 230 gfx::Size ShellNativeAppWindow::GetContentMaximumSize() const { |
| 231 NOTIMPLEMENTED(); |
| 232 return gfx::Size(); |
| 233 } |
| 234 |
| 235 void ShellNativeAppWindow::SetContentSizeConstraints( |
| 236 const gfx::Size& min_size, |
| 237 const gfx::Size& max_size) { |
| 238 NOTIMPLEMENTED(); |
| 239 } |
| 240 |
| 241 bool ShellNativeAppWindow::CanHaveAlphaEnabled() const { |
| 242 NOTIMPLEMENTED(); |
| 243 return false; |
| 244 } |
| 245 |
| 246 aura::Window* ShellNativeAppWindow::GetWindow() const { |
| 247 return app_window_->web_contents()->GetNativeView(); |
| 248 } |
| 249 |
| 250 } // namespace extensions |
OLD | NEW |