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