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

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

Issue 6990015: Preload Instant search when omnibox is focused. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebaseline Created 9 years, 6 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_loader_manager.h ('k') | chrome/common/chrome_switches.h » ('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) 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/instant/instant_loader_manager.h" 5 #include "chrome/browser/instant/instant_loader_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/instant/instant_loader.h" 8 #include "chrome/browser/instant/instant_loader.h"
9 #include "chrome/browser/instant/instant_loader_delegate.h" 9 #include "chrome/browser/instant/instant_loader_delegate.h"
10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 void InstantLoaderManager::RemoveLoaderFromInstant(InstantLoader* loader) { 135 void InstantLoaderManager::RemoveLoaderFromInstant(InstantLoader* loader) {
136 if (!loader->template_url_id()) 136 if (!loader->template_url_id())
137 return; 137 return;
138 138
139 Loaders::iterator i = instant_loaders_.find(loader->template_url_id()); 139 Loaders::iterator i = instant_loaders_.find(loader->template_url_id());
140 DCHECK(i != instant_loaders_.end()); 140 DCHECK(i != instant_loaders_.end());
141 instant_loaders_.erase(i); 141 instant_loaders_.erase(i);
142 } 142 }
143 143
144 InstantLoader* InstantLoaderManager::GetInstantLoader(TemplateURLID id) {
145 Loaders::iterator i = instant_loaders_.find(id);
146 return i == instant_loaders_.end() ? CreateLoader(id) : i->second;
147 }
148
144 InstantLoader* InstantLoaderManager::CreateLoader(TemplateURLID id) { 149 InstantLoader* InstantLoaderManager::CreateLoader(TemplateURLID id) {
145 InstantLoader* loader = new InstantLoader(loader_delegate_, id); 150 InstantLoader* loader = new InstantLoader(loader_delegate_, id);
146 if (id) 151 if (id)
147 instant_loaders_[id] = loader; 152 instant_loaders_[id] = loader;
148 return loader; 153 return loader;
149 } 154 }
150
151 InstantLoader* InstantLoaderManager::GetInstantLoader(TemplateURLID id) {
152 Loaders::iterator i = instant_loaders_.find(id);
153 return i == instant_loaders_.end() ? CreateLoader(id) : i->second;
154 }
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_loader_manager.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698