Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: chrome/browser/search/instant_service.cc

Issue 1543203002: Remove a variety of no-longer-used query params. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/instant_service.h" 5 #include "chrome/browser/search/instant_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return base::StartsWith( 66 return base::StartsWith(
67 base::FieldTrialList::FindFullName(kLocalNTPSuggestionService), 67 base::FieldTrialList::FindFullName(kLocalNTPSuggestionService),
68 kLocalNTPSuggestionServiceEnabled, base::CompareCase::INSENSITIVE_ASCII); 68 kLocalNTPSuggestionServiceEnabled, base::CompareCase::INSENSITIVE_ASCII);
69 } 69 }
70 70
71 } // namespace 71 } // namespace
72 72
73 InstantService::InstantService(Profile* profile) 73 InstantService::InstantService(Profile* profile)
74 : profile_(profile), 74 : profile_(profile),
75 template_url_service_(TemplateURLServiceFactory::GetForProfile(profile_)), 75 template_url_service_(TemplateURLServiceFactory::GetForProfile(profile_)),
76 omnibox_start_margin_(search::kDisableStartMargin),
77 suggestions_service_(NULL), 76 suggestions_service_(NULL),
78 weak_ptr_factory_(this) { 77 weak_ptr_factory_(this) {
79 // The initialization below depends on a typical set of browser threads. Skip 78 // The initialization below depends on a typical set of browser threads. Skip
80 // it if we are running in a unit test without the full suite. 79 // it if we are running in a unit test without the full suite.
81 if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) 80 if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI))
82 return; 81 return;
83 82
84 // This depends on the existence of the typical browser threads. Therefore it 83 // This depends on the existence of the typical browser threads. Therefore it
85 // is only instantiated here (after the check for a UI thread above). 84 // is only instantiated here (after the check for a UI thread above).
86 instant_io_context_ = new InstantIOContext(); 85 instant_io_context_ = new InstantIOContext();
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 default: 289 default:
291 NOTREACHED() << "Unexpected notification type in InstantService."; 290 NOTREACHED() << "Unexpected notification type in InstantService.";
292 } 291 }
293 } 292 }
294 293
295 void InstantService::SendSearchURLsToRenderer(content::RenderProcessHost* rph) { 294 void InstantService::SendSearchURLsToRenderer(content::RenderProcessHost* rph) {
296 rph->Send(new ChromeViewMsg_SetSearchURLs( 295 rph->Send(new ChromeViewMsg_SetSearchURLs(
297 search::GetSearchURLs(profile_), search::GetNewTabPageURL(profile_))); 296 search::GetSearchURLs(profile_), search::GetNewTabPageURL(profile_)));
298 } 297 }
299 298
300 void InstantService::OnOmniboxStartMarginChanged(int start_margin) {
301 omnibox_start_margin_ = start_margin;
302 FOR_EACH_OBSERVER(InstantServiceObserver, observers_,
303 OmniboxStartMarginChanged(omnibox_start_margin_));
304 }
305
306 void InstantService::OnRendererProcessTerminated(int process_id) { 299 void InstantService::OnRendererProcessTerminated(int process_id) {
307 process_ids_.erase(process_id); 300 process_ids_.erase(process_id);
308 301
309 if (instant_io_context_.get()) { 302 if (instant_io_context_.get()) {
310 content::BrowserThread::PostTask( 303 content::BrowserThread::PostTask(
311 content::BrowserThread::IO, FROM_HERE, 304 content::BrowserThread::IO, FROM_HERE,
312 base::Bind(&InstantIOContext::RemoveInstantProcessOnIO, 305 base::Bind(&InstantIOContext::RemoveInstantProcessOnIO,
313 instant_io_context_, process_id)); 306 instant_io_context_, process_id));
314 } 307 }
315 } 308 }
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 } 531 }
539 532
540 void InstantService::ResetInstantSearchPrerenderer() { 533 void InstantService::ResetInstantSearchPrerenderer() {
541 if (!search::ShouldPrefetchSearchResults()) 534 if (!search::ShouldPrefetchSearchResults())
542 return; 535 return;
543 536
544 GURL url(search::GetSearchResultPrefetchBaseURL(profile_)); 537 GURL url(search::GetSearchResultPrefetchBaseURL(profile_));
545 instant_prerenderer_.reset( 538 instant_prerenderer_.reset(
546 url.is_valid() ? new InstantSearchPrerenderer(profile_, url) : NULL); 539 url.is_valid() ? new InstantSearchPrerenderer(profile_, url) : NULL);
547 } 540 }
OLDNEW
« no previous file with comments | « chrome/browser/search/instant_service.h ('k') | chrome/browser/search/instant_service_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698