| 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" |
| 11 #include "content/public/browser/notification_source.h" | 11 #include "content/public/browser/notification_source.h" |
| 12 #include "content/public/browser/notification_types.h" | 12 #include "content/public/browser/notification_types.h" |
| 13 #include "content/public/browser/render_process_host.h" | 13 #include "content/public/browser/render_process_host.h" |
| 14 #include "content/public/browser/render_view_host.h" | 14 #include "content/public/browser/render_view_host.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 using content::BrowserThread; | 17 using content::BrowserThread; |
| 18 | 18 |
| 19 SearchProviderInstallStateMessageFilter:: | 19 SearchProviderInstallStateMessageFilter:: |
| 20 SearchProviderInstallStateMessageFilter( | 20 SearchProviderInstallStateMessageFilter( |
| 21 int render_process_id, | 21 int render_process_id, |
| 22 Profile* profile) | 22 Profile* profile) |
| 23 : BrowserMessageFilter(ChromeMsgStart), | 23 : provider_data_(profile, |
| 24 provider_data_(profile, | |
| 25 content::RenderProcessHost::FromID(render_process_id)), | 24 content::RenderProcessHost::FromID(render_process_id)), |
| 26 is_off_the_record_(profile->IsOffTheRecord()), | 25 is_off_the_record_(profile->IsOffTheRecord()), |
| 27 weak_factory_(this) { | 26 weak_factory_(this) { |
| 28 // This is initialized by RenderProcessHostImpl. Do not add any non-trivial | 27 // This is initialized by RenderProcessHostImpl. Do not add any non-trivial |
| 29 // initialization here. Instead do it lazily when required. | 28 // initialization here. Instead do it lazily when required. |
| 30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 29 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 31 } | 30 } |
| 32 | 31 |
| 33 bool SearchProviderInstallStateMessageFilter::OnMessageReceived( | 32 bool SearchProviderInstallStateMessageFilter::OnMessageReceived( |
| 34 const IPC::Message& message, | 33 const IPC::Message& message, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 IPC::Message* reply_msg) { | 101 IPC::Message* reply_msg) { |
| 103 DCHECK(reply_msg); | 102 DCHECK(reply_msg); |
| 104 search_provider::InstallState install_state = | 103 search_provider::InstallState install_state = |
| 105 GetSearchProviderInstallState(page_location, requested_host); | 104 GetSearchProviderInstallState(page_location, requested_host); |
| 106 | 105 |
| 107 ChromeViewHostMsg_GetSearchProviderInstallState::WriteReplyParams( | 106 ChromeViewHostMsg_GetSearchProviderInstallState::WriteReplyParams( |
| 108 reply_msg, | 107 reply_msg, |
| 109 install_state); | 108 install_state); |
| 110 Send(reply_msg); | 109 Send(reply_msg); |
| 111 } | 110 } |
| OLD | NEW |