diff options
author | jamescook <jamescook@chromium.org> | 2014-09-19 18:00:15 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-20 01:00:29 +0000 |
commit | 14f0c3d1df8086e18097e1cf1c648d5b6fc9890c (patch) | |
tree | d40c67fa364ad98bcad2e649202f23731d1cfd13 | |
parent | 8235c315fcaae79400f098484d991ff4a94015bc (diff) | |
download | chromium_src-14f0c3d1df8086e18097e1cf1c648d5b6fc9890c.zip chromium_src-14f0c3d1df8086e18097e1cf1c648d5b6fc9890c.tar.gz chromium_src-14f0c3d1df8086e18097e1cf1c648d5b6fc9890c.tar.bz2 |
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}
-rw-r--r-- | extensions/browser/app_window/app_delegate.h | 3 | ||||
-rw-r--r-- | extensions/shell/browser/shell_app_delegate.cc | 2 | ||||
-rw-r--r-- | extensions/shell/browser/shell_app_window_client.cc | 7 | ||||
-rw-r--r-- | extensions/shell/browser/shell_native_app_window.cc | 61 |
4 files changed, 46 insertions, 27 deletions
diff --git a/extensions/browser/app_window/app_delegate.h b/extensions/browser/app_window/app_delegate.h index 2d5fa1d..7961f2a 100644 --- a/extensions/browser/app_window/app_delegate.h +++ b/extensions/browser/app_window/app_delegate.h @@ -68,6 +68,9 @@ class AppDelegate { content::MediaStreamType type, const Extension* extension) = 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; // Web contents modal dialog support. diff --git a/extensions/shell/browser/shell_app_delegate.cc b/extensions/shell/browser/shell_app_delegate.cc index 483da67..be70ec4 100644 --- a/extensions/shell/browser/shell_app_delegate.cc +++ b/extensions/shell/browser/shell_app_delegate.cc @@ -92,6 +92,8 @@ bool ShellAppDelegate::IsWebContentsVisible( } 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(); } diff --git a/extensions/shell/browser/shell_app_window_client.cc b/extensions/shell/browser/shell_app_window_client.cc index 90287a6..734df75 100644 --- a/extensions/shell/browser/shell_app_window_client.cc +++ b/extensions/shell/browser/shell_app_window_client.cc @@ -4,6 +4,8 @@ #include "extensions/shell/browser/shell_app_window_client.h" +#include <vector> + #include "extensions/browser/app_window/app_window.h" #include "extensions/shell/browser/desktop_controller.h" #include "extensions/shell/browser/shell_native_app_window.h" @@ -39,11 +41,12 @@ NativeAppWindow* ShellAppWindowClient::CreateNativeAppWindow( } 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() { - NOTIMPLEMENTED(); + // See IncrementKeepAliveCount(). } void ShellAppWindowClient::OpenDevToolsWindow( diff --git a/extensions/shell/browser/shell_native_app_window.cc b/extensions/shell/browser/shell_native_app_window.cc index 8099846..97968a9 100644 --- a/extensions/shell/browser/shell_native_app_window.cc +++ b/extensions/shell/browser/shell_native_app_window.cc @@ -5,13 +5,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, @@ -30,22 +40,24 @@ ShellNativeAppWindow::~ShellNativeAppWindow() { } bool ShellNativeAppWindow::IsActive() const { - NOTIMPLEMENTED(); - return false; + // 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 { - NOTIMPLEMENTED(); return false; } bool ShellNativeAppWindow::IsMinimized() const { - NOTIMPLEMENTED(); return false; } 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; } @@ -54,12 +66,12 @@ gfx::NativeWindow ShellNativeAppWindow::GetNativeWindow() { } gfx::Rect ShellNativeAppWindow::GetRestoredBounds() const { - NOTIMPLEMENTED(); + // app_shell windows cannot be maximized, so the current bounds are the + // restored bounds. return GetBounds(); } ui::WindowShowState ShellNativeAppWindow::GetRestoredState() const { - NOTIMPLEMENTED(); return ui::SHOW_STATE_NORMAL; } @@ -84,11 +96,15 @@ void ShellNativeAppWindow::Close() { } void ShellNativeAppWindow::Activate() { - NOTIMPLEMENTED(); + aura::Window* window = GetWindow(); + if (window) + wm::ActivateWindow(window); } void ShellNativeAppWindow::Deactivate() { - NOTIMPLEMENTED(); + aura::Window* window = GetWindow(); + if (window) + wm::DeactivateWindow(window); } void ShellNativeAppWindow::Maximize() { @@ -112,7 +128,6 @@ void ShellNativeAppWindow::FlashFrame(bool flash) { } bool ShellNativeAppWindow::IsAlwaysOnTop() const { - NOTIMPLEMENTED(); return false; } @@ -150,20 +165,20 @@ void ShellNativeAppWindow::SetFullscreen(int fullscreen_types) { } bool ShellNativeAppWindow::IsFullscreenOrPending() const { - NOTIMPLEMENTED(); + // See comment in IsFullscreen(). return false; } void ShellNativeAppWindow::UpdateWindowIcon() { - NOTIMPLEMENTED(); + // No icon to update. } void ShellNativeAppWindow::UpdateWindowTitle() { - NOTIMPLEMENTED(); + // No window title to update. } void ShellNativeAppWindow::UpdateBadgeIcon() { - NOTIMPLEMENTED(); + // No badge to update. } void ShellNativeAppWindow::UpdateDraggableRegions( @@ -182,7 +197,7 @@ void ShellNativeAppWindow::UpdateShape(scoped_ptr<SkRegion> region) { void ShellNativeAppWindow::HandleKeyboardEvent( const content::NativeWebKeyboardEvent& event) { - NOTIMPLEMENTED(); + // No special handling. The WebContents will handle it. } bool ShellNativeAppWindow::IsFrameless() const { @@ -191,22 +206,18 @@ bool ShellNativeAppWindow::IsFrameless() const { } bool ShellNativeAppWindow::HasFrameColor() const { - NOTIMPLEMENTED(); return false; } SkColor ShellNativeAppWindow::ActiveFrameColor() const { - NOTIMPLEMENTED(); return SkColor(); } SkColor ShellNativeAppWindow::InactiveFrameColor() const { - NOTIMPLEMENTED(); return SkColor(); } gfx::Insets ShellNativeAppWindow::GetFrameInsets() const { - NOTIMPLEMENTED(); return gfx::Insets(); } @@ -219,17 +230,17 @@ void ShellNativeAppWindow::HideWithApp() { } void ShellNativeAppWindow::UpdateShelfMenu() { - NOTIMPLEMENTED(); + // app_shell has no shelf, dock, or system-tray to update. } gfx::Size ShellNativeAppWindow::GetContentMinimumSize() const { - NOTIMPLEMENTED(); - return gfx::Size(); + // Content fills the desktop and cannot be resized. + return GetDesktopWindowSize(); } gfx::Size ShellNativeAppWindow::GetContentMaximumSize() const { - NOTIMPLEMENTED(); - return gfx::Size(); + // Content fills the desktop and cannot be resized. + return GetDesktopWindowSize(); } void ShellNativeAppWindow::SetContentSizeConstraints( @@ -243,7 +254,7 @@ void ShellNativeAppWindow::SetVisibleOnAllWorkspaces(bool always_visible) { } bool ShellNativeAppWindow::CanHaveAlphaEnabled() const { - NOTIMPLEMENTED(); + // No background to display if the window was transparent. return false; } |