Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1221)

Unified Diff: chrome/browser/extensions/api/app_window/app_window_api.cc

Issue 10878040: Move context-sensitive app.window.* functions to app.window.current().* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/app_window/app_window_api.cc
diff --git a/chrome/browser/extensions/api/app_window/app_window_api.cc b/chrome/browser/extensions/api/app_window/app_window_api.cc
index 4bebe7e0415ef1db19c2c5d376af015ffb6d230c..294cbf41ea37f5c2947600ce807efa45728e2dad 100644
--- a/chrome/browser/extensions/api/app_window/app_window_api.cc
+++ b/chrome/browser/extensions/api/app_window/app_window_api.cc
@@ -6,11 +6,9 @@
#include "base/time.h"
#include "base/values.h"
-#include "chrome/browser/extensions/shell_window_registry.h"
#include "chrome/browser/extensions/window_controller.h"
#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/common/extensions/api/app_window.h"
-#include "chrome/common/extensions/extension_error_utils.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
@@ -22,28 +20,6 @@ namespace Create = app_window::Create;
namespace extensions {
-namespace app_window_constants {
-const char kNoAssociatedShellWindow[] =
- "The context from which the function was called did not have an "
- "associated shell window.";
-};
-
-bool AppWindowExtensionFunction::RunImpl() {
- ShellWindowRegistry* registry = ShellWindowRegistry::Get(profile());
- CHECK(registry);
- content::RenderViewHost* rvh = render_view_host();
- if (!rvh)
- // No need to set an error, since we won't return to the caller anyway if
- // there's no RVH.
- return false;
- ShellWindow* window = registry->GetShellWindowForRenderViewHost(rvh);
- if (!window) {
- error_ = app_window_constants::kNoAssociatedShellWindow;
- return false;
- }
- return RunWithWindow(window);
-}
-
const char kNoneFrameOption[] = "none";
bool AppWindowCreateFunction::RunImpl() {
@@ -113,24 +89,4 @@ bool AppWindowCreateFunction::RunImpl() {
return true;
}
-bool AppWindowFocusFunction::RunWithWindow(ShellWindow* window) {
- window->GetBaseWindow()->Activate();
- return true;
-}
-
-bool AppWindowMaximizeFunction::RunWithWindow(ShellWindow* window) {
- window->GetBaseWindow()->Maximize();
- return true;
-}
-
-bool AppWindowMinimizeFunction::RunWithWindow(ShellWindow* window) {
- window->GetBaseWindow()->Minimize();
- return true;
-}
-
-bool AppWindowRestoreFunction::RunWithWindow(ShellWindow* window) {
- window->GetBaseWindow()->Restore();
- return true;
-}
-
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698