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

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

Issue 9968016: Move the URL string from TemplateURLRef onto the owning TemplateURL. This will make it easier to m… (Closed) Base URL: svn://chrome-svn/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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 verbatim, suggested_text); 497 verbatim, suggested_text);
498 UpdateIsDisplayable(); 498 UpdateIsDisplayable();
499 // For the HIDDEN and SILENT field trials, don't send back suggestions. 499 // For the HIDDEN and SILENT field trials, don't send back suggestions.
500 if (!InstantFieldTrial::ShouldSetSuggestedText(tab_contents_->profile())) 500 if (!InstantFieldTrial::ShouldSetSuggestedText(tab_contents_->profile()))
501 suggested_text->clear(); 501 suggested_text->clear();
502 } 502 }
503 503
504 // Returns true if |template_url| is a valid TemplateURL for use by instant. 504 // Returns true if |template_url| is a valid TemplateURL for use by instant.
505 bool InstantController::IsValidInstantTemplateURL( 505 bool InstantController::IsValidInstantTemplateURL(
506 const TemplateURL* template_url) { 506 const TemplateURL* template_url) {
507 return template_url && template_url->instant_url() && template_url->id() && 507 return template_url && template_url->id() &&
508 template_url->instant_url()->SupportsReplacement() && 508 template_url->instant_url_ref().SupportsReplacement() &&
509 !IsBlacklistedFromInstant(template_url->id()); 509 !IsBlacklistedFromInstant(template_url->id());
510 } 510 }
511 511
512 void InstantController::BlacklistFromInstant() { 512 void InstantController::BlacklistFromInstant() {
513 if (!loader_.get()) 513 if (!loader_.get())
514 return; 514 return;
515 515
516 DCHECK(loader_->template_url_id()); 516 DCHECK(loader_->template_url_id());
517 blacklisted_ids_.insert(loader_->template_url_id()); 517 blacklisted_ids_.insert(loader_->template_url_id());
518 518
(...skipping 15 matching lines...) Expand all
534 if (!weak_factory_.HasWeakPtrs()) { 534 if (!weak_factory_.HasWeakPtrs()) {
535 MessageLoop::current()->PostTask( 535 MessageLoop::current()->PostTask(
536 FROM_HERE, base::Bind(&InstantController::DestroyLoaders, 536 FROM_HERE, base::Bind(&InstantController::DestroyLoaders,
537 weak_factory_.GetWeakPtr())); 537 weak_factory_.GetWeakPtr()));
538 } 538 }
539 } 539 }
540 540
541 void InstantController::DestroyLoaders() { 541 void InstantController::DestroyLoaders() {
542 loaders_to_destroy_.reset(); 542 loaders_to_destroy_.reset();
543 } 543 }
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