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

Unified Diff: content/browser/pepper_flash_settings_helper_impl.cc

Issue 10391173: Pepper Flash settings integration: implement "deauthorize content licenses". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 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: content/browser/pepper_flash_settings_helper_impl.cc
diff --git a/content/browser/pepper_flash_settings_helper_impl.cc b/content/browser/pepper_flash_settings_helper_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2f9e698cd69e8ea90ed9c455d6009db9ca356c68
--- /dev/null
+++ b/content/browser/pepper_flash_settings_helper_impl.cc
@@ -0,0 +1,71 @@
+// 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 "content/browser/pepper_flash_settings_helper_impl.h"
+
+#include "base/file_path.h"
+#include "content/browser/plugin_service_impl.h"
+#include "content/public/browser/browser_thread.h"
+#include "ipc/ipc_channel_handle.h"
+
+namespace content {
+
+// static
+scoped_refptr<PepperFlashSettingsHelper> PepperFlashSettingsHelper::Create() {
+ return new PepperFlashSettingsHelperImpl();
+}
+
+PepperFlashSettingsHelperImpl::PepperFlashSettingsHelperImpl() {
+}
+
+PepperFlashSettingsHelperImpl::~PepperFlashSettingsHelperImpl() {
+}
+
+void PepperFlashSettingsHelperImpl::OpenChannelToBroker(
+ const FilePath& path,
+ const OpenChannelCallback& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+ if (callback.is_null())
+ return;
+ if (!callback_.is_null())
+ callback.Run(false, IPC::ChannelHandle());
+
+ // Balanced in OnPpapiChannelOpened(). We need to keep this object around
+ // until then.
+ AddRef();
+
+ callback_ = callback;
+ PluginServiceImpl* plugin_service = PluginServiceImpl::GetInstance();
+ plugin_service->OpenChannelToPpapiBroker(path, this);
+}
+
+void PepperFlashSettingsHelperImpl::GetPpapiChannelInfo(
+ base::ProcessHandle* renderer_handle,
+ int* renderer_id) {
+ *renderer_handle = base::kNullProcessHandle;
+ *renderer_id = 0;
+}
+
+void PepperFlashSettingsHelperImpl::OnPpapiChannelOpened(
+ const IPC::ChannelHandle& channel_handle,
+ int /* plugin_child_id */) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK(!callback_.is_null());
+
+ if (!channel_handle.name.empty())
+ callback_.Run(true, channel_handle);
+ else
+ callback_.Run(false, IPC::ChannelHandle());
+
+ callback_.Reset();
+ // Balance the AddRef() call in Initialize().
+ Release();
+}
+
+bool PepperFlashSettingsHelperImpl::OffTheRecord() {
+ return false;
+}
+
+} // namespace content
« no previous file with comments | « content/browser/pepper_flash_settings_helper_impl.h ('k') | content/browser/renderer_host/pepper_file_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698