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

Unified Diff: chrome/browser/extensions/api/streams_private/streams_private_api.cc

Issue 12381035: Move Mime type handling to streamsPrivate API, so that it works on Desktop Chrome. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Initialize test variable Created 7 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
Index: chrome/browser/extensions/api/streams_private/streams_private_api.cc
diff --git a/chrome/browser/extensions/api/streams_private/streams_private_api.cc b/chrome/browser/extensions/api/streams_private/streams_private_api.cc
new file mode 100644
index 0000000000000000000000000000000000000000..db22e8e2a03b611fa67b5f6f9f2e07cdc2566a04
--- /dev/null
+++ b/chrome/browser/extensions/api/streams_private/streams_private_api.cc
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 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/api/streams_private/streams_private_api.h"
+
+#include "base/json/json_writer.h"
+#include "base/lazy_instance.h"
+#include "base/stl_util.h"
+#include "base/strings/string_number_conversions.h"
+#include "base/values.h"
+#include "chrome/browser/extensions/event_router.h"
+#include "chrome/browser/extensions/extension_function_registry.h"
+#include "chrome/browser/extensions/extension_input_module_constants.h"
+#include "chrome/browser/extensions/extension_system.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/extensions/mime_types_handler.h"
+
+namespace keys = extension_input_module_constants;
+
+namespace events {
+
+const char kOnExecuteMimeTypeHandler[] =
+ "streamsPrivate.onExecuteMimeTypeHandler";
+
+} // namespace events
+
+namespace extensions {
+
+StreamsPrivateAPI::StreamsPrivateAPI(Profile* profile)
+ : profile_(profile) {
+ (new MimeTypesHandlerParser)->Register();
+}
+
+StreamsPrivateAPI::~StreamsPrivateAPI() {
+}
+
+static base::LazyInstance<ProfileKeyedAPIFactory<StreamsPrivateAPI> >
+ g_factory = LAZY_INSTANCE_INITIALIZER;
+
+// static
+ProfileKeyedAPIFactory<StreamsPrivateAPI>*
+ StreamsPrivateAPI::GetFactoryInstance() {
+ return &g_factory.Get();
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698