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

Unified Diff: extensions/shell/browser/api/shell/shell_api.cc

Issue 571643003: Remove app_shell chrome.shell API and ShellAppWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (remove-shell) rebase 2 Created 6 years, 3 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
« no previous file with comments | « extensions/shell/browser/api/shell/shell_api.h ('k') | extensions/shell/browser/desktop_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/shell/browser/api/shell/shell_api.cc
diff --git a/extensions/shell/browser/api/shell/shell_api.cc b/extensions/shell/browser/api/shell/shell_api.cc
deleted file mode 100644
index 6ba0db32a3f57dfc97ca53c392eec1a45bfa63c9..0000000000000000000000000000000000000000
--- a/extensions/shell/browser/api/shell/shell_api.cc
+++ /dev/null
@@ -1,66 +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 "extensions/shell/browser/api/shell/shell_api.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "base/values.h"
-#include "extensions/common/extension.h"
-#include "extensions/shell/browser/desktop_controller.h"
-#include "extensions/shell/browser/shell_app_window.h"
-#include "extensions/shell/common/api/shell.h"
-
-using base::DictionaryValue;
-
-namespace CreateWindow = extensions::shell_api::shell::CreateWindow;
-
-namespace extensions {
-
-namespace {
-
-const char kInvalidArguments[] = "Invalid arguments";
-
-// Creates a function call result to send to the renderer.
-DictionaryValue* CreateResult(ShellAppWindow* app_window) {
- int view_id = app_window->GetRenderViewRoutingID();
-
- DictionaryValue* result = new DictionaryValue;
- result->Set("viewId", new base::FundamentalValue(view_id));
- return result;
-}
-
-} // namespace
-
-ShellCreateWindowFunction::ShellCreateWindowFunction() {
-}
-
-ShellCreateWindowFunction::~ShellCreateWindowFunction() {
-}
-
-ExtensionFunction::ResponseAction ShellCreateWindowFunction::Run() {
- scoped_ptr<CreateWindow::Params> params(CreateWindow::Params::Create(*args_));
- EXTENSION_FUNCTION_VALIDATE(params.get());
-
- GURL url(params->url);
- if (url.GetOrigin().is_empty()) {
- // Convert "main.html" to "chrome-extension:/<id>/main.html".
- url = extension()->GetResourceURL(params->url);
- } else {
- // Load a typical "http://example.com/" URL.
- LOG(WARNING) << "Loading non-extension URL " << url.spec();
- }
- if (!url.is_valid())
- return RespondNow(Error(kInvalidArguments));
-
- // The desktop keeps ownership of the window.
- ShellAppWindow* app_window =
- DesktopController::instance()->CreateShellAppWindow(
- browser_context(), extension());
- app_window->LoadURL(url);
-
- // Create the reply to send to the renderer.
- return RespondNow(OneArgument(CreateResult(app_window)));
-}
-
-} // namespace extensions
« no previous file with comments | « extensions/shell/browser/api/shell/shell_api.h ('k') | extensions/shell/browser/desktop_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698