shell_native_app_window.cc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. #include "extensions/shell/browser/shell_native_app_window.h"
  5. #include "extensions/shell/browser/desktop_controller.h"
  6. #include "third_party/skia/include/core/SkRegion.h"
  7. #include "ui/gfx/geometry/insets.h"
  8. #include "ui/gfx/geometry/point.h"
  9. #include "ui/gfx/geometry/rect.h"
  10. #include "ui/gfx/geometry/size.h"
  11. namespace extensions {
  12. ShellNativeAppWindow::ShellNativeAppWindow(
  13. AppWindow* app_window,
  14. const AppWindow::CreateParams& params)
  15. : app_window_(app_window) {
  16. }
  17. ShellNativeAppWindow::~ShellNativeAppWindow() {
  18. }
  19. bool ShellNativeAppWindow::IsMaximized() const {
  20. return false;
  21. }
  22. bool ShellNativeAppWindow::IsMinimized() const {
  23. return false;
  24. }
  25. bool ShellNativeAppWindow::IsFullscreen() const {
  26. // The window in app_shell is considered a "restored" window that happens to
  27. // fill the display. This avoids special handling of fullscreen or maximized
  28. // windows that app_shell doesn't need.
  29. return false;
  30. }
  31. gfx::Rect ShellNativeAppWindow::GetRestoredBounds() const {
  32. // app_shell windows cannot be maximized, so the current bounds are the
  33. // restored bounds.
  34. return GetBounds();
  35. }
  36. ui::WindowShowState ShellNativeAppWindow::GetRestoredState() const {
  37. return ui::SHOW_STATE_NORMAL;
  38. }
  39. void ShellNativeAppWindow::ShowInactive() {
  40. // app_shell does not differentiate between active and inactive windows.
  41. Show();
  42. }
  43. void ShellNativeAppWindow::Close() {
  44. app_window_->OnNativeClose();
  45. }
  46. void ShellNativeAppWindow::Maximize() {
  47. NOTIMPLEMENTED();
  48. }
  49. void ShellNativeAppWindow::Minimize() {
  50. NOTIMPLEMENTED();
  51. }
  52. void ShellNativeAppWindow::Restore() {
  53. NOTIMPLEMENTED();
  54. }
  55. void ShellNativeAppWindow::FlashFrame(bool flash) {
  56. NOTIMPLEMENTED();
  57. }
  58. ui::ZOrderLevel ShellNativeAppWindow::GetZOrderLevel() const {
  59. return ui::ZOrderLevel::kNormal;
  60. }
  61. void ShellNativeAppWindow::SetZOrderLevel(ui::ZOrderLevel level) {
  62. NOTIMPLEMENTED();
  63. }
  64. gfx::NativeView ShellNativeAppWindow::GetHostView() const {
  65. NOTIMPLEMENTED();
  66. return NULL;
  67. }
  68. gfx::Point ShellNativeAppWindow::GetDialogPosition(const gfx::Size& size) {
  69. NOTIMPLEMENTED();
  70. return gfx::Point();
  71. }
  72. void ShellNativeAppWindow::AddObserver(
  73. web_modal::ModalDialogHostObserver* observer) {
  74. NOTIMPLEMENTED();
  75. }
  76. void ShellNativeAppWindow::RemoveObserver(
  77. web_modal::ModalDialogHostObserver* observer) {
  78. NOTIMPLEMENTED();
  79. }
  80. gfx::Size ShellNativeAppWindow::GetMaximumDialogSize() {
  81. NOTIMPLEMENTED();
  82. return gfx::Size();
  83. }
  84. void ShellNativeAppWindow::SetFullscreen(int fullscreen_types) {
  85. NOTIMPLEMENTED();
  86. }
  87. bool ShellNativeAppWindow::IsFullscreenOrPending() const {
  88. // See comment in IsFullscreen().
  89. return false;
  90. }
  91. void ShellNativeAppWindow::UpdateWindowIcon() {
  92. // No icon to update.
  93. }
  94. void ShellNativeAppWindow::UpdateWindowTitle() {
  95. // No window title to update.
  96. }
  97. void ShellNativeAppWindow::UpdateDraggableRegions(
  98. const std::vector<DraggableRegion>& regions) {
  99. NOTIMPLEMENTED();
  100. }
  101. SkRegion* ShellNativeAppWindow::GetDraggableRegion() {
  102. NOTIMPLEMENTED();
  103. return NULL;
  104. }
  105. void ShellNativeAppWindow::UpdateShape(std::unique_ptr<ShapeRects> rects) {
  106. NOTIMPLEMENTED();
  107. }
  108. bool ShellNativeAppWindow::HandleKeyboardEvent(
  109. const content::NativeWebKeyboardEvent& event) {
  110. // No special handling. The WebContents will handle it.
  111. return false;
  112. }
  113. bool ShellNativeAppWindow::IsFrameless() const {
  114. NOTIMPLEMENTED();
  115. return false;
  116. }
  117. bool ShellNativeAppWindow::HasFrameColor() const {
  118. return false;
  119. }
  120. SkColor ShellNativeAppWindow::ActiveFrameColor() const {
  121. return SkColor();
  122. }
  123. SkColor ShellNativeAppWindow::InactiveFrameColor() const {
  124. return SkColor();
  125. }
  126. gfx::Insets ShellNativeAppWindow::GetFrameInsets() const {
  127. return gfx::Insets();
  128. }
  129. void ShellNativeAppWindow::SetContentSizeConstraints(
  130. const gfx::Size& min_size,
  131. const gfx::Size& max_size) {
  132. NOTIMPLEMENTED();
  133. }
  134. void ShellNativeAppWindow::SetVisibleOnAllWorkspaces(bool always_visible) {
  135. NOTIMPLEMENTED();
  136. }
  137. bool ShellNativeAppWindow::CanHaveAlphaEnabled() const {
  138. // No background to display if the window was transparent.
  139. return false;
  140. }
  141. void ShellNativeAppWindow::SetActivateOnPointer(bool activate_on_pointer) {
  142. NOTIMPLEMENTED();
  143. }
  144. } // namespace extensions