| Index: chrome/browser/chromeos/ui/screensaver_extension_dialog.cc
|
| diff --git a/chrome/browser/chromeos/ui/screensaver_extension_dialog.cc b/chrome/browser/chromeos/ui/screensaver_extension_dialog.cc
|
| index 8eb28794d927ea8c5762384c386d4895ceb945af..b8e02a64a1dcf7f014f63668756f1f33edad44da 100644
|
| --- a/chrome/browser/chromeos/ui/screensaver_extension_dialog.cc
|
| +++ b/chrome/browser/chromeos/ui/screensaver_extension_dialog.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/bind.h"
|
| #include "base/logging.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_helper.h"
|
| #include "chrome/browser/extensions/extension_service.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| @@ -55,21 +56,28 @@ ScreensaverExtensionDialog::ScreensaverExtensionDialog()
|
| }
|
|
|
| void ScreensaverExtensionDialog::LoadExtension() {
|
| + // If the helper is not initialized, call us again when it is.
|
| + // We can't get the screensaver path till the helper is ready.
|
| + if (!chromeos::KioskModeHelper::Get()->is_initialized()) {
|
| + chromeos::KioskModeHelper::Get()->Initialize(
|
| + base::Bind(&ScreensaverExtensionDialog::LoadExtension,
|
| + base::Unretained(this)));
|
| + return;
|
| + }
|
| +
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
|
| std::string error;
|
| - std::string extension_path = CommandLine::ForCurrentProcess()->
|
| - GetSwitchValueASCII(switches::kKioskModeScreensaverPath);
|
|
|
| scoped_refptr<Extension> screensaver_extension =
|
| extension_file_util::LoadExtension(
|
| - FilePath(extension_path),
|
| + FilePath(chromeos::KioskModeHelper::Get()->GetScreensaverPath()),
|
| Extension::COMPONENT,
|
| Extension::NO_FLAGS,
|
| &error);
|
|
|
| if (!screensaver_extension) {
|
| LOG(ERROR) << "Could not load screensaver extension from: " <<
|
| - extension_path;
|
| + chromeos::KioskModeHelper::Get()->GetScreensaverPath();
|
| return;
|
| }
|
|
|
|
|