| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/plugins/plugin_info_message_filter.h" | 5 #include "chrome/browser/plugins/plugin_info_message_filter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 resource_context_(NULL), | 84 resource_context_(NULL), |
| 85 host_content_settings_map_(NULL) { | 85 host_content_settings_map_(NULL) { |
| 86 } | 86 } |
| 87 | 87 |
| 88 PluginInfoMessageFilter::Context::~Context() { | 88 PluginInfoMessageFilter::Context::~Context() { |
| 89 } | 89 } |
| 90 | 90 |
| 91 PluginInfoMessageFilter::PluginInfoMessageFilter( | 91 PluginInfoMessageFilter::PluginInfoMessageFilter( |
| 92 int render_process_id, | 92 int render_process_id, |
| 93 Profile* profile) | 93 Profile* profile) |
| 94 : BrowserMessageFilter(ChromeMsgStart), | 94 : context_(render_process_id, profile), |
| 95 context_(render_process_id, profile), | |
| 96 weak_ptr_factory_(this) { | 95 weak_ptr_factory_(this) { |
| 97 } | 96 } |
| 98 | 97 |
| 99 bool PluginInfoMessageFilter::OnMessageReceived(const IPC::Message& message, | 98 bool PluginInfoMessageFilter::OnMessageReceived(const IPC::Message& message, |
| 100 bool* message_was_ok) { | 99 bool* message_was_ok) { |
| 101 IPC_BEGIN_MESSAGE_MAP_EX(PluginInfoMessageFilter, message, *message_was_ok) | 100 IPC_BEGIN_MESSAGE_MAP_EX(PluginInfoMessageFilter, message, *message_was_ok) |
| 102 IPC_MESSAGE_HANDLER_DELAY_REPLY(ChromeViewHostMsg_GetPluginInfo, | 101 IPC_MESSAGE_HANDLER_DELAY_REPLY(ChromeViewHostMsg_GetPluginInfo, |
| 103 OnGetPluginInfo) | 102 OnGetPluginInfo) |
| 104 IPC_MESSAGE_HANDLER( | 103 IPC_MESSAGE_HANDLER( |
| 105 ChromeViewHostMsg_IsInternalPluginRegisteredForMimeType, | 104 ChromeViewHostMsg_IsInternalPluginRegisteredForMimeType, |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 void PluginInfoMessageFilter::Context::MaybeGrantAccess( | 382 void PluginInfoMessageFilter::Context::MaybeGrantAccess( |
| 384 const ChromeViewHostMsg_GetPluginInfo_Status& status, | 383 const ChromeViewHostMsg_GetPluginInfo_Status& status, |
| 385 const base::FilePath& path) const { | 384 const base::FilePath& path) const { |
| 386 if (status.value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed || | 385 if (status.value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed || |
| 387 status.value == ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay) { | 386 status.value == ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay) { |
| 388 ChromePluginServiceFilter::GetInstance()->AuthorizePlugin( | 387 ChromePluginServiceFilter::GetInstance()->AuthorizePlugin( |
| 389 render_process_id_, path); | 388 render_process_id_, path); |
| 390 } | 389 } |
| 391 } | 390 } |
| 392 | 391 |
| OLD | NEW |