| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/search_engines/search_engine_tab_helper.h" | 5 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/search_engines/template_url.h" | 8 #include "chrome/browser/search_engines/template_url.h" |
| 9 #include "chrome/browser/search_engines/template_url_fetcher.h" | 9 #include "chrome/browser/search_engines/template_url_fetcher.h" |
| 10 #include "chrome/browser/search_engines/template_url_service.h" | 10 #include "chrome/browser/search_engines/template_url_service.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 void SearchEngineTabHelper::DidNavigateMainFramePostCommit( | 35 void SearchEngineTabHelper::DidNavigateMainFramePostCommit( |
| 36 const content::LoadCommittedDetails& /*details*/, | 36 const content::LoadCommittedDetails& /*details*/, |
| 37 const ViewHostMsg_FrameNavigate_Params& params) { | 37 const ViewHostMsg_FrameNavigate_Params& params) { |
| 38 GenerateKeywordIfNecessary(params); | 38 GenerateKeywordIfNecessary(params); |
| 39 } | 39 } |
| 40 | 40 |
| 41 bool SearchEngineTabHelper::OnMessageReceived(const IPC::Message& message) { | 41 bool SearchEngineTabHelper::OnMessageReceived(const IPC::Message& message) { |
| 42 bool handled = true; | 42 bool handled = true; |
| 43 IPC_BEGIN_MESSAGE_MAP(SearchEngineTabHelper, message) | 43 IPC_BEGIN_MESSAGE_MAP(SearchEngineTabHelper, message) |
| 44 IPC_MESSAGE_HANDLER(ViewHostMsg_PageHasOSDD, OnPageHasOSDD) | 44 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PageHasOSDD, OnPageHasOSDD) |
| 45 IPC_MESSAGE_UNHANDLED(handled = false) | 45 IPC_MESSAGE_UNHANDLED(handled = false) |
| 46 IPC_END_MESSAGE_MAP() | 46 IPC_END_MESSAGE_MAP() |
| 47 | 47 |
| 48 return handled; | 48 return handled; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void SearchEngineTabHelper::OnPageHasOSDD( | 51 void SearchEngineTabHelper::OnPageHasOSDD( |
| 52 int32 page_id, | 52 int32 page_id, |
| 53 const GURL& doc_url, | 53 const GURL& doc_url, |
| 54 const search_provider::OSDDType& msg_provider_type) { | 54 const search_provider::OSDDType& msg_provider_type) { |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // The favicon url isn't valid. This means there really isn't a favicon, | 196 // The favicon url isn't valid. This means there really isn't a favicon, |
| 197 // or the favicon url wasn't obtained before the load started. This assumes | 197 // or the favicon url wasn't obtained before the load started. This assumes |
| 198 // the later. | 198 // the later. |
| 199 // TODO(sky): Need a way to set the favicon that doesn't involve generating | 199 // TODO(sky): Need a way to set the favicon that doesn't involve generating |
| 200 // its url. | 200 // its url. |
| 201 new_url->SetFaviconURL(TemplateURL::GenerateFaviconURL(params.referrer)); | 201 new_url->SetFaviconURL(TemplateURL::GenerateFaviconURL(params.referrer)); |
| 202 } | 202 } |
| 203 new_url->set_safe_for_autoreplace(true); | 203 new_url->set_safe_for_autoreplace(true); |
| 204 url_service->Add(new_url); | 204 url_service->Add(new_url); |
| 205 } | 205 } |
| OLD | NEW |