| Index: extensions/shell/browser/shell_native_app_window.cc
|
| diff --git a/extensions/shell/browser/shell_native_app_window.cc b/extensions/shell/browser/shell_native_app_window.cc
|
| index 0f3d29fb2d59bf5639daaacb235890ca86bc4e48..e19c32a37cc32b810c07a0f287e3c7e5025eb5f5 100644
|
| --- a/extensions/shell/browser/shell_native_app_window.cc
|
| +++ b/extensions/shell/browser/shell_native_app_window.cc
|
| @@ -4,48 +4,23 @@
|
|
|
| #include "extensions/shell/browser/shell_native_app_window.h"
|
|
|
| -#include "content/public/browser/web_contents.h"
|
| #include "extensions/shell/browser/desktop_controller.h"
|
| -#include "ui/aura/window.h"
|
| -#include "ui/aura/window_tree_host.h"
|
| #include "ui/gfx/geometry/insets.h"
|
| #include "ui/gfx/geometry/point.h"
|
| #include "ui/gfx/geometry/rect.h"
|
| #include "ui/gfx/geometry/size.h"
|
| -#include "ui/wm/core/window_util.h"
|
|
|
| namespace extensions {
|
| -namespace {
|
| -
|
| -gfx::Size GetDesktopWindowSize() {
|
| - return DesktopController::instance()->GetHost()->window()->bounds().size();
|
| -}
|
| -
|
| -} // namespace
|
|
|
| ShellNativeAppWindow::ShellNativeAppWindow(
|
| AppWindow* app_window,
|
| const AppWindow::CreateParams& params)
|
| : app_window_(app_window) {
|
| - gfx::Rect bounds = params.GetInitialWindowBounds(GetFrameInsets());
|
| - bool position_specified =
|
| - bounds.x() != AppWindow::BoundsSpecification::kUnspecifiedPosition &&
|
| - bounds.y() != AppWindow::BoundsSpecification::kUnspecifiedPosition;
|
| - if (!position_specified)
|
| - bounds.set_origin(GetBounds().origin());
|
| - SetBounds(bounds);
|
| }
|
|
|
| ShellNativeAppWindow::~ShellNativeAppWindow() {
|
| }
|
|
|
| -bool ShellNativeAppWindow::IsActive() const {
|
| - // Even though app_shell only supports a single app window, there might be
|
| - // some sort of system-level dialog open and active.
|
| - aura::Window* window = GetWindow();
|
| - return window && wm::IsActiveWindow(window);
|
| -}
|
| -
|
| bool ShellNativeAppWindow::IsMaximized() const {
|
| return false;
|
| }
|
| @@ -61,10 +36,6 @@ bool ShellNativeAppWindow::IsFullscreen() const {
|
| return false;
|
| }
|
|
|
| -gfx::NativeWindow ShellNativeAppWindow::GetNativeWindow() const {
|
| - return GetWindow();
|
| -}
|
| -
|
| gfx::Rect ShellNativeAppWindow::GetRestoredBounds() const {
|
| // app_shell windows cannot be maximized, so the current bounds are the
|
| // restored bounds.
|
| @@ -75,18 +46,6 @@ ui::WindowShowState ShellNativeAppWindow::GetRestoredState() const {
|
| return ui::SHOW_STATE_NORMAL;
|
| }
|
|
|
| -gfx::Rect ShellNativeAppWindow::GetBounds() const {
|
| - return GetWindow()->GetBoundsInScreen();
|
| -}
|
| -
|
| -void ShellNativeAppWindow::Show() {
|
| - GetWindow()->Show();
|
| -}
|
| -
|
| -void ShellNativeAppWindow::Hide() {
|
| - GetWindow()->Hide();
|
| -}
|
| -
|
| void ShellNativeAppWindow::ShowInactive() {
|
| NOTIMPLEMENTED();
|
| }
|
| @@ -96,18 +55,6 @@ void ShellNativeAppWindow::Close() {
|
| app_window_->OnNativeClose();
|
| }
|
|
|
| -void ShellNativeAppWindow::Activate() {
|
| - aura::Window* window = GetWindow();
|
| - if (window)
|
| - wm::ActivateWindow(window);
|
| -}
|
| -
|
| -void ShellNativeAppWindow::Deactivate() {
|
| - aura::Window* window = GetWindow();
|
| - if (window)
|
| - wm::DeactivateWindow(window);
|
| -}
|
| -
|
| void ShellNativeAppWindow::Maximize() {
|
| NOTIMPLEMENTED();
|
| }
|
| @@ -120,10 +67,6 @@ void ShellNativeAppWindow::Restore() {
|
| NOTIMPLEMENTED();
|
| }
|
|
|
| -void ShellNativeAppWindow::SetBounds(const gfx::Rect& bounds) {
|
| - GetWindow()->SetBounds(bounds);
|
| -}
|
| -
|
| void ShellNativeAppWindow::FlashFrame(bool flash) {
|
| NOTIMPLEMENTED();
|
| }
|
| @@ -236,12 +179,12 @@ void ShellNativeAppWindow::UpdateShelfMenu() {
|
|
|
| gfx::Size ShellNativeAppWindow::GetContentMinimumSize() const {
|
| // Content fills the desktop and cannot be resized.
|
| - return GetDesktopWindowSize();
|
| + return DesktopController::instance()->GetWindowSize();
|
| }
|
|
|
| gfx::Size ShellNativeAppWindow::GetContentMaximumSize() const {
|
| // Content fills the desktop and cannot be resized.
|
| - return GetDesktopWindowSize();
|
| + return DesktopController::instance()->GetWindowSize();
|
| }
|
|
|
| void ShellNativeAppWindow::SetContentSizeConstraints(
|
| @@ -259,8 +202,4 @@ bool ShellNativeAppWindow::CanHaveAlphaEnabled() const {
|
| return false;
|
| }
|
|
|
| -aura::Window* ShellNativeAppWindow::GetWindow() const {
|
| - return app_window_->web_contents()->GetNativeView();
|
| -}
|
| -
|
| } // namespace extensions
|
|
|