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 3 // found in the LICENSE file. 4 5 #include "chrome/browser/extensions/external_loader.h" 6 7 #include "base/logging.h" 8 #include "base/values.h" 9 #include "chrome/browser/extensions/external_provider_impl.h" 10 #include "content/public/browser/browser_thread.h" 11 12 using content::BrowserThread; 13 14 namespace extensions { 15 16 ExternalLoader::ExternalLoader() 17 : owner_(NULL) { 18 } 19 20 void ExternalLoader::Init(ExternalProviderImpl* owner) { 21 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 22 owner_ = owner; 23 } 24 25 const base::FilePath ExternalLoader::GetBaseCrxFilePath() { 26 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 27 28 // By default, relative paths are not supported. 29 // Subclasses that wish to support them should override this method. 30 return base::FilePath(); 31 } 32 33 void ExternalLoader::OwnerShutdown() { 34 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 35 owner_ = NULL; 36 } 37 38 ExternalLoader::~ExternalLoader() {} 39 40 void ExternalLoader::LoadFinished() { 41 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 42 if (owner_) { 43 owner_->SetPrefs(prefs_.release()); 44 } 45 } 46 47 } // namespace extensions 48