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

Unified Diff: chrome/browser/extensions/extension_api_handler.cc

Issue 42680: Add more of the server-side plumbing for extension APIs. Also (Closed)
Patch Set: Introduce SyncExtensionFunction Created 11 years, 9 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 | « chrome/browser/extensions/extension_api_handler.h ('k') | chrome/browser/extensions/extension_function.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_api_handler.cc
diff --git a/chrome/browser/extensions/extension_api_handler.cc b/chrome/browser/extensions/extension_api_handler.cc
deleted file mode 100644
index 702917bde797c0715db2d5c4f03cf2cfe971bae4..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/extension_api_handler.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2009 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 "chrome/browser/extensions/extension_api_handler.h"
-
-#include "base/json_reader.h"
-#include "base/json_writer.h"
-#include "base/values.h"
-#include "chrome/browser/browser.h"
-#include "chrome/browser/browser_list.h"
-#include "chrome/browser/renderer_host/render_view_host.h"
-
-ExtensionAPIHandler::ExtensionAPIHandler(RenderViewHost* render_view_host)
- : render_view_host_(render_view_host) {}
-
-void ExtensionAPIHandler::HandleRequest(const std::string& name,
- const std::string& args,
- int callback_id) {
- scoped_ptr<Value> value;
- if (!args.empty()) {
- value.reset(JSONReader::Read(args, false));
- DCHECK(value.get());
- }
-
- // TODO(aa): This will probably dispatch to per-module specialized classes.
- // Consider refactoring similar work in dom_ui to reuse.
- if (name == "CreateTab") {
- Browser* browser = BrowserList::GetLastActive();
- if (browser) {
- DCHECK(value->IsType(Value::TYPE_DICTIONARY));
- std::string url;
- static_cast<DictionaryValue*>(value.get())->GetString(L"url", &url);
- browser->AddTabWithURL(GURL(url), GURL(), PageTransition::TYPED, true,
- NULL);
-
- static int response_count = 0;
- scoped_ptr<Value> response(Value::CreateIntegerValue(response_count++));
- std::string json;
- JSONWriter::Write(response.get(), false, &json);
-
- render_view_host_->SendExtensionResponse(callback_id, json);
- }
- }
-}
« no previous file with comments | « chrome/browser/extensions/extension_api_handler.h ('k') | chrome/browser/extensions/extension_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698