diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-18 21:01:14 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-18 21:01:14 +0000 |
commit | 619482019703c303cee4b9657dcffceae39f9845 (patch) | |
tree | 4b54724778be093ad9695cb3ba27a439106f8a7d /apps/shell | |
parent | 184c2367f3f7243e4621364f89a13af357924ef3 (diff) | |
download | chromium_src-619482019703c303cee4b9657dcffceae39f9845.zip chromium_src-619482019703c303cee4b9657dcffceae39f9845.tar.gz chromium_src-619482019703c303cee4b9657dcffceae39f9845.tar.bz2 |
Remove unused shell_app_window_api.h/cc
This was replaced by the stub in apps/shell/browser/api/shell/ and the
chrome.shell.createWindow implementation.
BUG=none
TEST=compiles
Review URL: https://codereview.chromium.org/284393002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/shell')
-rw-r--r-- | apps/shell/browser/shell_app_window_api.cc | 85 | ||||
-rw-r--r-- | apps/shell/browser/shell_app_window_api.h | 31 |
2 files changed, 0 insertions, 116 deletions
diff --git a/apps/shell/browser/shell_app_window_api.cc b/apps/shell/browser/shell_app_window_api.cc deleted file mode 100644 index de1012c..0000000 --- a/apps/shell/browser/shell_app_window_api.cc +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "apps/shell/browser/shell_app_window_api.h" - -#include "apps/shell/browser/shell_app_window.h" -#include "apps/shell/browser/shell_desktop_controller.h" -#include "base/values.h" - -using base::DictionaryValue; - -namespace extensions { -namespace { - -// Returns stub values for window bounds. -DictionaryValue* CreateStubBoundsProperties() { - DictionaryValue* properties = new DictionaryValue; - properties->SetInteger("left", 0); - properties->SetInteger("top", 0); - properties->SetInteger("width", 0); - properties->SetInteger("height", 0); - return properties; -} - -// Creates a function call result to send to the renderer. -DictionaryValue* CreateResult(apps::ShellAppWindow* app_window) { - int view_id = app_window->GetRenderViewRoutingID(); - - DictionaryValue* result = new DictionaryValue; - result->Set("viewId", new base::FundamentalValue(view_id)); - result->Set("injectTitlebar", new base::FundamentalValue(false)); - result->Set("id", new base::StringValue("app_shell")); - - // Add stub window property data. - result->SetBoolean("fullscreen", true); - result->SetBoolean("minimized", false); - result->SetBoolean("maximized", false); - result->SetBoolean("alwaysOnTop", false); - result->SetBoolean("hasFrameColor", false); - result->SetInteger("frameColor", 0); - result->Set("innerBounds", CreateStubBoundsProperties()); - result->Set("outerBounds", CreateStubBoundsProperties()); - - return result; -} - -} // namespace - -ShellAppWindowCreateFunction::ShellAppWindowCreateFunction() { -} - -ShellAppWindowCreateFunction::~ShellAppWindowCreateFunction() { -} - -bool ShellAppWindowCreateFunction::RunAsync() { - // Arguments must contain a URL and may contain options and a callback. - if (args_->GetSize() < 1 || args_->GetSize() > 3) - return false; - - // Extract the URL for the window contents, e.g. "main.html". - std::string url_string; - if (!args_->GetString(0, &url_string)) - return false; - - // Convert "main.html" to "chrome-extension:/<id>/main.html". - GURL url = GetExtension()->GetResourceURL(url_string); - if (!url.is_valid()) - return false; - - // The desktop keeps ownership of the window. - apps::ShellAppWindow* app_window = - apps::ShellDesktopController::instance()->CreateAppWindow( - browser_context()); - app_window->LoadURL(url); - - // Create the reply to send to the renderer. - DictionaryValue* result = CreateResult(app_window); - SetResult(result); - - SendResponse(true /* success */); - return true; -} - -} // namespace extensions diff --git a/apps/shell/browser/shell_app_window_api.h b/apps/shell/browser/shell_app_window_api.h deleted file mode 100644 index bb5eb37..0000000 --- a/apps/shell/browser/shell_app_window_api.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef APPS_SHELL_BROWSER_SHELL_APP_WINDOW_API_H_ -#define APPS_SHELL_BROWSER_SHELL_APP_WINDOW_API_H_ - -#include "base/compiler_specific.h" -#include "extensions/browser/extension_function.h" - -namespace extensions { - -// A simplified implementation of the chrome.app.window.create() function for -// app_shell. Opens a fullscreen window and invokes the window callback. Most -// of the response is stub data, but the JS contentWindow is valid. -class ShellAppWindowCreateFunction : public AsyncExtensionFunction { - public: - ShellAppWindowCreateFunction(); - - // Don't use the APP_WINDOW_CREATE histogram so we don't pollute the - // statistics for the real Chrome implementation. - DECLARE_EXTENSION_FUNCTION("app.window.create", UNKNOWN); - - private: - virtual ~ShellAppWindowCreateFunction(); - virtual bool RunAsync() OVERRIDE; -}; - -} // namespace extensions - -#endif // APPS_SHELL_BROWSER_SHELL_APP_WINDOW_API_H_ |