| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" | 
| 11 #include "chrome/browser/tab_contents_wrapper.h" | 11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 
| 12 | 12 | 
| 13 InstantLoaderManager::InstantLoaderManager( | 13 InstantLoaderManager::InstantLoaderManager( | 
| 14     InstantLoaderDelegate* loader_delegate) | 14     InstantLoaderDelegate* loader_delegate) | 
| 15     : loader_delegate_(loader_delegate), | 15     : loader_delegate_(loader_delegate), | 
| 16       current_loader_(NULL), | 16       current_loader_(NULL), | 
| 17       pending_loader_(NULL) { | 17       pending_loader_(NULL) { | 
| 18 } | 18 } | 
| 19 | 19 | 
| 20 InstantLoaderManager::~InstantLoaderManager() { | 20 InstantLoaderManager::~InstantLoaderManager() { | 
| 21   for (Loaders::iterator i = instant_loaders_.begin(); | 21   for (Loaders::iterator i = instant_loaders_.begin(); | 
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 142   InstantLoader* loader = new InstantLoader(loader_delegate_, id); | 142   InstantLoader* loader = new InstantLoader(loader_delegate_, id); | 
| 143   if (id) | 143   if (id) | 
| 144     instant_loaders_[id] = loader; | 144     instant_loaders_[id] = loader; | 
| 145   return loader; | 145   return loader; | 
| 146 } | 146 } | 
| 147 | 147 | 
| 148 InstantLoader* InstantLoaderManager::GetInstantLoader(TemplateURLID id) { | 148 InstantLoader* InstantLoaderManager::GetInstantLoader(TemplateURLID id) { | 
| 149   Loaders::iterator i = instant_loaders_.find(id); | 149   Loaders::iterator i = instant_loaders_.find(id); | 
| 150   return i == instant_loaders_.end() ? CreateLoader(id) : i->second; | 150   return i == instant_loaders_.end() ? CreateLoader(id) : i->second; | 
| 151 } | 151 } | 
| OLD | NEW | 
|---|