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

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

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More test fixes. Created 7 years, 2 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 | Annotate | Revision Log
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 <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 63
64 } // namespace 64 } // namespace
65 65
66 InstantService::InstantService(Profile* profile) 66 InstantService::InstantService(Profile* profile)
67 : profile_(profile), 67 : profile_(profile),
68 ntp_prerenderer_(profile, this, profile->GetPrefs()), 68 ntp_prerenderer_(profile, this, profile->GetPrefs()),
69 browser_instant_controller_object_count_(0), 69 browser_instant_controller_object_count_(0),
70 weak_ptr_factory_(this) { 70 weak_ptr_factory_(this) {
71 // Stub for unit tests. 71 // Stub for unit tests.
72 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) 72 if (!BrowserThread::CurrentlyOn(BrowserThread::UI) ||
73 base::MessageLoop::current()->type() != base::MessageLoop::TYPE_UI)
73 return; 74 return;
74 75
75 registrar_.Add(this, 76 registrar_.Add(this,
76 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, 77 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
77 content::NotificationService::AllSources()); 78 content::NotificationService::AllSources());
78 79
79 history::TopSites* top_sites = profile_->GetTopSites(); 80 history::TopSites* top_sites = profile_->GetTopSites();
80 if (top_sites) { 81 if (top_sites) {
81 registrar_.Add(this, 82 registrar_.Add(this,
82 chrome::NOTIFICATION_TOP_SITES_CHANGED, 83 chrome::NOTIFICATION_TOP_SITES_CHANGED,
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 // could cause that, neither of which we support. 450 // could cause that, neither of which we support.
450 return; 451 return;
451 } 452 }
452 FOR_EACH_OBSERVER( 453 FOR_EACH_OBSERVER(
453 InstantServiceObserver, observers_, DefaultSearchProviderChanged()); 454 InstantServiceObserver, observers_, DefaultSearchProviderChanged());
454 } 455 }
455 456
456 InstantNTPPrerenderer* InstantService::ntp_prerenderer() { 457 InstantNTPPrerenderer* InstantService::ntp_prerenderer() {
457 return &ntp_prerenderer_; 458 return &ntp_prerenderer_;
458 } 459 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698