Commit 14f0c3d1 authored by jamescook's avatar jamescook Committed by Commit bot

app_shell: Remove some NOTIMPLEMENTED from ShellNativeAppWindow

For these functions the default no-op behavior is fine, so remove the calls
to NOTIMPLEMENTED to reduce log spam.

BUG=none
TEST=none
TBR=yoz@chromium.org for changing a comment in extensions/

Review URL: https://codereview.chromium.org/587913002

Cr-Commit-Position: refs/heads/master@{#295836}
parent 8235c315
...@@ -68,6 +68,9 @@ class AppDelegate { ...@@ -68,6 +68,9 @@ class AppDelegate {
content::MediaStreamType type, content::MediaStreamType type,
const Extension* extension) = 0; const Extension* extension) = 0;
virtual int PreferredIconSize() = 0; virtual int PreferredIconSize() = 0;
// TODO(jamescook): Eliminate this method. All implementations load the same
// icon, and the icon is available in the extensions module resources.
virtual gfx::ImageSkia GetAppDefaultIcon() = 0; virtual gfx::ImageSkia GetAppDefaultIcon() = 0;
// Web contents modal dialog support. // Web contents modal dialog support.
......
...@@ -92,6 +92,8 @@ bool ShellAppDelegate::IsWebContentsVisible( ...@@ -92,6 +92,8 @@ bool ShellAppDelegate::IsWebContentsVisible(
} }
void ShellAppDelegate::SetTerminatingCallback(const base::Closure& callback) { void ShellAppDelegate::SetTerminatingCallback(const base::Closure& callback) {
// TODO(jamescook): Should app_shell continue to close the app window
// manually or should it use a browser termination callback like Chrome?
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "extensions/shell/browser/shell_app_window_client.h" #include "extensions/shell/browser/shell_app_window_client.h"
#include <vector>
#include "extensions/browser/app_window/app_window.h" #include "extensions/browser/app_window/app_window.h"
#include "extensions/shell/browser/desktop_controller.h" #include "extensions/shell/browser/desktop_controller.h"
#include "extensions/shell/browser/shell_native_app_window.h" #include "extensions/shell/browser/shell_native_app_window.h"
...@@ -39,11 +41,12 @@ NativeAppWindow* ShellAppWindowClient::CreateNativeAppWindow( ...@@ -39,11 +41,12 @@ NativeAppWindow* ShellAppWindowClient::CreateNativeAppWindow(
} }
void ShellAppWindowClient::IncrementKeepAliveCount() { void ShellAppWindowClient::IncrementKeepAliveCount() {
NOTIMPLEMENTED(); // app_shell runs until the system powers off, so it doesn't need to track
// open apps or windows to keep itself alive.
} }
void ShellAppWindowClient::DecrementKeepAliveCount() { void ShellAppWindowClient::DecrementKeepAliveCount() {
NOTIMPLEMENTED(); // See IncrementKeepAliveCount().
} }
void ShellAppWindowClient::OpenDevToolsWindow( void ShellAppWindowClient::OpenDevToolsWindow(
......
...@@ -5,13 +5,23 @@ ...@@ -5,13 +5,23 @@
#include "extensions/shell/browser/shell_native_app_window.h" #include "extensions/shell/browser/shell_native_app_window.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "extensions/shell/browser/desktop_controller.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
#include "ui/wm/core/window_util.h"
namespace extensions { namespace extensions {
namespace {
gfx::Size GetDesktopWindowSize() {
return DesktopController::instance()->GetHost()->window()->bounds().size();
}
} // namespace
ShellNativeAppWindow::ShellNativeAppWindow( ShellNativeAppWindow::ShellNativeAppWindow(
AppWindow* app_window, AppWindow* app_window,
...@@ -30,22 +40,24 @@ ShellNativeAppWindow::~ShellNativeAppWindow() { ...@@ -30,22 +40,24 @@ ShellNativeAppWindow::~ShellNativeAppWindow() {
} }
bool ShellNativeAppWindow::IsActive() const { bool ShellNativeAppWindow::IsActive() const {
NOTIMPLEMENTED(); // Even though app_shell only supports a single app window, there might be
return false; // some sort of system-level dialog open and active.
aura::Window* window = GetWindow();
return window && wm::IsActiveWindow(window);
} }
bool ShellNativeAppWindow::IsMaximized() const { bool ShellNativeAppWindow::IsMaximized() const {
NOTIMPLEMENTED();
return false; return false;
} }
bool ShellNativeAppWindow::IsMinimized() const { bool ShellNativeAppWindow::IsMinimized() const {
NOTIMPLEMENTED();
return false; return false;
} }
bool ShellNativeAppWindow::IsFullscreen() const { bool ShellNativeAppWindow::IsFullscreen() const {
NOTIMPLEMENTED(); // The window in app_shell is considered a "restored" window that happens to
// fill the display. This avoids special handling of fullscreen or maximized
// windows that app_shell doesn't need.
return false; return false;
} }
...@@ -54,12 +66,12 @@ gfx::NativeWindow ShellNativeAppWindow::GetNativeWindow() { ...@@ -54,12 +66,12 @@ gfx::NativeWindow ShellNativeAppWindow::GetNativeWindow() {
} }
gfx::Rect ShellNativeAppWindow::GetRestoredBounds() const { gfx::Rect ShellNativeAppWindow::GetRestoredBounds() const {
NOTIMPLEMENTED(); // app_shell windows cannot be maximized, so the current bounds are the
// restored bounds.
return GetBounds(); return GetBounds();
} }
ui::WindowShowState ShellNativeAppWindow::GetRestoredState() const { ui::WindowShowState ShellNativeAppWindow::GetRestoredState() const {
NOTIMPLEMENTED();
return ui::SHOW_STATE_NORMAL; return ui::SHOW_STATE_NORMAL;
} }
...@@ -84,11 +96,15 @@ void ShellNativeAppWindow::Close() { ...@@ -84,11 +96,15 @@ void ShellNativeAppWindow::Close() {
} }
void ShellNativeAppWindow::Activate() { void ShellNativeAppWindow::Activate() {
NOTIMPLEMENTED(); aura::Window* window = GetWindow();
if (window)
wm::ActivateWindow(window);
} }
void ShellNativeAppWindow::Deactivate() { void ShellNativeAppWindow::Deactivate() {
NOTIMPLEMENTED(); aura::Window* window = GetWindow();
if (window)
wm::DeactivateWindow(window);
} }
void ShellNativeAppWindow::Maximize() { void ShellNativeAppWindow::Maximize() {
...@@ -112,7 +128,6 @@ void ShellNativeAppWindow::FlashFrame(bool flash) { ...@@ -112,7 +128,6 @@ void ShellNativeAppWindow::FlashFrame(bool flash) {
} }
bool ShellNativeAppWindow::IsAlwaysOnTop() const { bool ShellNativeAppWindow::IsAlwaysOnTop() const {
NOTIMPLEMENTED();
return false; return false;
} }
...@@ -150,20 +165,20 @@ void ShellNativeAppWindow::SetFullscreen(int fullscreen_types) { ...@@ -150,20 +165,20 @@ void ShellNativeAppWindow::SetFullscreen(int fullscreen_types) {
} }
bool ShellNativeAppWindow::IsFullscreenOrPending() const { bool ShellNativeAppWindow::IsFullscreenOrPending() const {
NOTIMPLEMENTED(); // See comment in IsFullscreen().
return false; return false;
} }
void ShellNativeAppWindow::UpdateWindowIcon() { void ShellNativeAppWindow::UpdateWindowIcon() {
NOTIMPLEMENTED(); // No icon to update.
} }
void ShellNativeAppWindow::UpdateWindowTitle() { void ShellNativeAppWindow::UpdateWindowTitle() {
NOTIMPLEMENTED(); // No window title to update.
} }
void ShellNativeAppWindow::UpdateBadgeIcon() { void ShellNativeAppWindow::UpdateBadgeIcon() {
NOTIMPLEMENTED(); // No badge to update.
} }
void ShellNativeAppWindow::UpdateDraggableRegions( void ShellNativeAppWindow::UpdateDraggableRegions(
...@@ -182,7 +197,7 @@ void ShellNativeAppWindow::UpdateShape(scoped_ptr<SkRegion> region) { ...@@ -182,7 +197,7 @@ void ShellNativeAppWindow::UpdateShape(scoped_ptr<SkRegion> region) {
void ShellNativeAppWindow::HandleKeyboardEvent( void ShellNativeAppWindow::HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) { const content::NativeWebKeyboardEvent& event) {
NOTIMPLEMENTED(); // No special handling. The WebContents will handle it.
} }
bool ShellNativeAppWindow::IsFrameless() const { bool ShellNativeAppWindow::IsFrameless() const {
...@@ -191,22 +206,18 @@ bool ShellNativeAppWindow::IsFrameless() const { ...@@ -191,22 +206,18 @@ bool ShellNativeAppWindow::IsFrameless() const {
} }
bool ShellNativeAppWindow::HasFrameColor() const { bool ShellNativeAppWindow::HasFrameColor() const {
NOTIMPLEMENTED();
return false; return false;
} }
SkColor ShellNativeAppWindow::ActiveFrameColor() const { SkColor ShellNativeAppWindow::ActiveFrameColor() const {
NOTIMPLEMENTED();
return SkColor(); return SkColor();
} }
SkColor ShellNativeAppWindow::InactiveFrameColor() const { SkColor ShellNativeAppWindow::InactiveFrameColor() const {
NOTIMPLEMENTED();
return SkColor(); return SkColor();
} }
gfx::Insets ShellNativeAppWindow::GetFrameInsets() const { gfx::Insets ShellNativeAppWindow::GetFrameInsets() const {
NOTIMPLEMENTED();
return gfx::Insets(); return gfx::Insets();
} }
...@@ -219,17 +230,17 @@ void ShellNativeAppWindow::HideWithApp() { ...@@ -219,17 +230,17 @@ void ShellNativeAppWindow::HideWithApp() {
} }
void ShellNativeAppWindow::UpdateShelfMenu() { void ShellNativeAppWindow::UpdateShelfMenu() {
NOTIMPLEMENTED(); // app_shell has no shelf, dock, or system-tray to update.
} }
gfx::Size ShellNativeAppWindow::GetContentMinimumSize() const { gfx::Size ShellNativeAppWindow::GetContentMinimumSize() const {
NOTIMPLEMENTED(); // Content fills the desktop and cannot be resized.
return gfx::Size(); return GetDesktopWindowSize();
} }
gfx::Size ShellNativeAppWindow::GetContentMaximumSize() const { gfx::Size ShellNativeAppWindow::GetContentMaximumSize() const {
NOTIMPLEMENTED(); // Content fills the desktop and cannot be resized.
return gfx::Size(); return GetDesktopWindowSize();
} }
void ShellNativeAppWindow::SetContentSizeConstraints( void ShellNativeAppWindow::SetContentSizeConstraints(
...@@ -243,7 +254,7 @@ void ShellNativeAppWindow::SetVisibleOnAllWorkspaces(bool always_visible) { ...@@ -243,7 +254,7 @@ void ShellNativeAppWindow::SetVisibleOnAllWorkspaces(bool always_visible) {
} }
bool ShellNativeAppWindow::CanHaveAlphaEnabled() const { bool ShellNativeAppWindow::CanHaveAlphaEnabled() const {
NOTIMPLEMENTED(); // No background to display if the window was transparent.
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment