Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / extensions / shell / browser / shell_native_app_window.cc
blobb5eb4f1fccec8cadf0f776ec47389dc4ac364c0d
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.
5 #include "extensions/shell/browser/shell_native_app_window.h"
7 #include "extensions/shell/browser/desktop_controller.h"
8 #include "third_party/skia/include/core/SkRegion.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"
14 namespace extensions {
16 ShellNativeAppWindow::ShellNativeAppWindow(
17 AppWindow* app_window,
18 const AppWindow::CreateParams& params)
19 : app_window_(app_window) {
22 ShellNativeAppWindow::~ShellNativeAppWindow() {
25 bool ShellNativeAppWindow::IsMaximized() const {
26 return false;
29 bool ShellNativeAppWindow::IsMinimized() const {
30 return false;
33 bool ShellNativeAppWindow::IsFullscreen() const {
34 // The window in app_shell is considered a "restored" window that happens to
35 // fill the display. This avoids special handling of fullscreen or maximized
36 // windows that app_shell doesn't need.
37 return false;
40 gfx::Rect ShellNativeAppWindow::GetRestoredBounds() const {
41 // app_shell windows cannot be maximized, so the current bounds are the
42 // restored bounds.
43 return GetBounds();
46 ui::WindowShowState ShellNativeAppWindow::GetRestoredState() const {
47 return ui::SHOW_STATE_NORMAL;
50 void ShellNativeAppWindow::ShowInactive() {
51 NOTIMPLEMENTED();
54 void ShellNativeAppWindow::Close() {
55 DesktopController::instance()->RemoveAppWindow(app_window_);
56 app_window_->OnNativeClose();
59 void ShellNativeAppWindow::Maximize() {
60 NOTIMPLEMENTED();
63 void ShellNativeAppWindow::Minimize() {
64 NOTIMPLEMENTED();
67 void ShellNativeAppWindow::Restore() {
68 NOTIMPLEMENTED();
71 void ShellNativeAppWindow::FlashFrame(bool flash) {
72 NOTIMPLEMENTED();
75 bool ShellNativeAppWindow::IsAlwaysOnTop() const {
76 return false;
79 void ShellNativeAppWindow::SetAlwaysOnTop(bool always_on_top) {
80 NOTIMPLEMENTED();
83 gfx::NativeView ShellNativeAppWindow::GetHostView() const {
84 NOTIMPLEMENTED();
85 return NULL;
88 gfx::Point ShellNativeAppWindow::GetDialogPosition(const gfx::Size& size) {
89 NOTIMPLEMENTED();
90 return gfx::Point();
93 void ShellNativeAppWindow::AddObserver(
94 web_modal::ModalDialogHostObserver* observer) {
95 NOTIMPLEMENTED();
98 void ShellNativeAppWindow::RemoveObserver(
99 web_modal::ModalDialogHostObserver* observer) {
100 NOTIMPLEMENTED();
103 gfx::Size ShellNativeAppWindow::GetMaximumDialogSize() {
104 NOTIMPLEMENTED();
105 return gfx::Size();
108 void ShellNativeAppWindow::SetFullscreen(int fullscreen_types) {
109 NOTIMPLEMENTED();
112 bool ShellNativeAppWindow::IsFullscreenOrPending() const {
113 // See comment in IsFullscreen().
114 return false;
117 void ShellNativeAppWindow::UpdateWindowIcon() {
118 // No icon to update.
121 void ShellNativeAppWindow::UpdateWindowTitle() {
122 // No window title to update.
125 void ShellNativeAppWindow::UpdateDraggableRegions(
126 const std::vector<DraggableRegion>& regions) {
127 NOTIMPLEMENTED();
130 SkRegion* ShellNativeAppWindow::GetDraggableRegion() {
131 NOTIMPLEMENTED();
132 return NULL;
135 void ShellNativeAppWindow::UpdateShape(scoped_ptr<SkRegion> region) {
136 NOTIMPLEMENTED();
139 void ShellNativeAppWindow::SetInterceptAllKeys(bool want_all_keys) {
140 NOTIMPLEMENTED();
143 void ShellNativeAppWindow::HandleKeyboardEvent(
144 const content::NativeWebKeyboardEvent& event) {
145 // No special handling. The WebContents will handle it.
148 bool ShellNativeAppWindow::IsFrameless() const {
149 NOTIMPLEMENTED();
150 return false;
153 bool ShellNativeAppWindow::HasFrameColor() const {
154 return false;
157 SkColor ShellNativeAppWindow::ActiveFrameColor() const {
158 return SkColor();
161 SkColor ShellNativeAppWindow::InactiveFrameColor() const {
162 return SkColor();
165 gfx::Insets ShellNativeAppWindow::GetFrameInsets() const {
166 return gfx::Insets();
169 void ShellNativeAppWindow::ShowWithApp() {
170 NOTIMPLEMENTED();
173 void ShellNativeAppWindow::HideWithApp() {
174 NOTIMPLEMENTED();
177 void ShellNativeAppWindow::UpdateShelfMenu() {
178 // app_shell has no shelf, dock, or system-tray to update.
181 gfx::Size ShellNativeAppWindow::GetContentMinimumSize() const {
182 // Content fills the desktop and cannot be resized.
183 return DesktopController::instance()->GetWindowSize();
186 gfx::Size ShellNativeAppWindow::GetContentMaximumSize() const {
187 // Content fills the desktop and cannot be resized.
188 return DesktopController::instance()->GetWindowSize();
191 void ShellNativeAppWindow::SetContentSizeConstraints(
192 const gfx::Size& min_size,
193 const gfx::Size& max_size) {
194 NOTIMPLEMENTED();
197 void ShellNativeAppWindow::SetVisibleOnAllWorkspaces(bool always_visible) {
198 NOTIMPLEMENTED();
201 bool ShellNativeAppWindow::CanHaveAlphaEnabled() const {
202 // No background to display if the window was transparent.
203 return false;
206 } // namespace extensions