| 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/search_engines/search_provider_install_state_message_fi
lter.h" | 5 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 provider_data_(profile, | 24 provider_data_(profile, |
| 25 content::RenderProcessHost::FromID(render_process_id)), | 25 content::RenderProcessHost::FromID(render_process_id)), |
| 26 is_off_the_record_(profile->IsOffTheRecord()), | 26 is_off_the_record_(profile->IsOffTheRecord()), |
| 27 weak_factory_(this) { | 27 weak_factory_(this) { |
| 28 // This is initialized by RenderProcessHostImpl. Do not add any non-trivial | 28 // This is initialized by RenderProcessHostImpl. Do not add any non-trivial |
| 29 // initialization here. Instead do it lazily when required. | 29 // initialization here. Instead do it lazily when required. |
| 30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 bool SearchProviderInstallStateMessageFilter::OnMessageReceived( | 33 bool SearchProviderInstallStateMessageFilter::OnMessageReceived( |
| 34 const IPC::Message& message, | 34 const IPC::Message& message) { |
| 35 bool* message_was_ok) { | |
| 36 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 35 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 37 bool handled = true; | 36 bool handled = true; |
| 38 IPC_BEGIN_MESSAGE_MAP_EX(SearchProviderInstallStateMessageFilter, message, | 37 IPC_BEGIN_MESSAGE_MAP(SearchProviderInstallStateMessageFilter, message) |
| 39 *message_was_ok) | |
| 40 IPC_MESSAGE_HANDLER_DELAY_REPLY( | 38 IPC_MESSAGE_HANDLER_DELAY_REPLY( |
| 41 ChromeViewHostMsg_GetSearchProviderInstallState, | 39 ChromeViewHostMsg_GetSearchProviderInstallState, |
| 42 OnGetSearchProviderInstallState) | 40 OnGetSearchProviderInstallState) |
| 43 IPC_MESSAGE_UNHANDLED(handled = false) | 41 IPC_MESSAGE_UNHANDLED(handled = false) |
| 44 IPC_END_MESSAGE_MAP() | 42 IPC_END_MESSAGE_MAP() |
| 45 return handled; | 43 return handled; |
| 46 } | 44 } |
| 47 | 45 |
| 48 SearchProviderInstallStateMessageFilter:: | 46 SearchProviderInstallStateMessageFilter:: |
| 49 ~SearchProviderInstallStateMessageFilter() { | 47 ~SearchProviderInstallStateMessageFilter() { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 IPC::Message* reply_msg) { | 100 IPC::Message* reply_msg) { |
| 103 DCHECK(reply_msg); | 101 DCHECK(reply_msg); |
| 104 search_provider::InstallState install_state = | 102 search_provider::InstallState install_state = |
| 105 GetSearchProviderInstallState(page_location, requested_host); | 103 GetSearchProviderInstallState(page_location, requested_host); |
| 106 | 104 |
| 107 ChromeViewHostMsg_GetSearchProviderInstallState::WriteReplyParams( | 105 ChromeViewHostMsg_GetSearchProviderInstallState::WriteReplyParams( |
| 108 reply_msg, | 106 reply_msg, |
| 109 install_state); | 107 install_state); |
| 110 Send(reply_msg); | 108 Send(reply_msg); |
| 111 } | 109 } |
| OLD | NEW |