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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 : BrowserMessageFilter(ChromeMsgStart), |
95 context_(render_process_id, profile), | 95 context_(render_process_id, profile), |
96 weak_ptr_factory_(this) { | 96 weak_ptr_factory_(this) { |
97 } | 97 } |
98 | 98 |
99 bool PluginInfoMessageFilter::OnMessageReceived(const IPC::Message& message, | 99 bool PluginInfoMessageFilter::OnMessageReceived(const IPC::Message& message) { |
100 bool* message_was_ok) { | 100 IPC_BEGIN_MESSAGE_MAP(PluginInfoMessageFilter, message) |
101 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, |
106 OnIsInternalPluginRegisteredForMimeType) | 105 OnIsInternalPluginRegisteredForMimeType) |
107 IPC_MESSAGE_UNHANDLED(return false) | 106 IPC_MESSAGE_UNHANDLED(return false) |
108 IPC_END_MESSAGE_MAP() | 107 IPC_END_MESSAGE_MAP() |
109 return true; | 108 return true; |
110 } | 109 } |
111 | 110 |
(...skipping 271 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 |