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

Side by Side Diff: chrome/browser/instant/instant_controller.cc

Issue 9965143: Revert 130431 - Move the URL string from TemplateURLRef onto the owning TemplateURL. This will mak… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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
« no previous file with comments | « chrome/browser/instant/instant_browsertest.cc ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/instant/instant_controller.h" 5 #include "chrome/browser/instant/instant_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 verbatim, suggested_text); 491 verbatim, suggested_text);
492 UpdateIsDisplayable(); 492 UpdateIsDisplayable();
493 // For the HIDDEN and SILENT field trials, don't send back suggestions. 493 // For the HIDDEN and SILENT field trials, don't send back suggestions.
494 if (!InstantFieldTrial::ShouldSetSuggestedText(tab_contents_->profile())) 494 if (!InstantFieldTrial::ShouldSetSuggestedText(tab_contents_->profile()))
495 suggested_text->clear(); 495 suggested_text->clear();
496 } 496 }
497 497
498 // Returns true if |template_url| is a valid TemplateURL for use by instant. 498 // Returns true if |template_url| is a valid TemplateURL for use by instant.
499 bool InstantController::IsValidInstantTemplateURL( 499 bool InstantController::IsValidInstantTemplateURL(
500 const TemplateURL* template_url) { 500 const TemplateURL* template_url) {
501 return template_url && template_url->id() && 501 return template_url && template_url->instant_url() && template_url->id() &&
502 template_url->instant_url_ref().SupportsReplacement() && 502 template_url->instant_url()->SupportsReplacement() &&
503 !IsBlacklistedFromInstant(template_url->id()); 503 !IsBlacklistedFromInstant(template_url->id());
504 } 504 }
505 505
506 void InstantController::BlacklistFromInstant() { 506 void InstantController::BlacklistFromInstant() {
507 if (!loader_.get()) 507 if (!loader_.get())
508 return; 508 return;
509 509
510 DCHECK(loader_->template_url_id()); 510 DCHECK(loader_->template_url_id());
511 blacklisted_ids_.insert(loader_->template_url_id()); 511 blacklisted_ids_.insert(loader_->template_url_id());
512 512
(...skipping 15 matching lines...) Expand all
528 if (!weak_factory_.HasWeakPtrs()) { 528 if (!weak_factory_.HasWeakPtrs()) {
529 MessageLoop::current()->PostTask( 529 MessageLoop::current()->PostTask(
530 FROM_HERE, base::Bind(&InstantController::DestroyLoaders, 530 FROM_HERE, base::Bind(&InstantController::DestroyLoaders,
531 weak_factory_.GetWeakPtr())); 531 weak_factory_.GetWeakPtr()));
532 } 532 }
533 } 533 }
534 534
535 void InstantController::DestroyLoaders() { 535 void InstantController::DestroyLoaders() {
536 loaders_to_destroy_.reset(); 536 loaders_to_destroy_.reset();
537 } 537 }
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_browsertest.cc ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698