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/chromeos/extensions/wallpaper_manager_util.h" 6 7 #include "ash/shell.h" 8 #include "base/command_line.h" 9 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_system.h" 11 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile_manager.h" 13 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser_finder.h" 15 #include "chrome/browser/ui/chrome_pages.h" 16 #include "chrome/browser/ui/extensions/application_launch.h" 17 #include "chrome/browser/ui/host_desktop.h" 18 #include "chrome/common/chrome_switches.h" 19 #include "extensions/common/constants.h" 20 21 namespace wallpaper_manager_util { 22 23 void OpenWallpaperManager() { 24 Profile* profile = ProfileManager::GetActiveUserProfile(); 25 DCHECK(profile); 26 27 ExtensionService* service = 28 extensions::ExtensionSystem::Get(profile)->extension_service(); 29 if (!service) 30 return; 31 32 const extensions::Extension* extension = 33 service->GetExtensionById(extension_misc::kWallpaperManagerId, false); 34 if (!extension) 35 return; 36 37 OpenApplication(AppLaunchParams(profile, extension, 38 extensions::LAUNCH_CONTAINER_WINDOW, 39 NEW_WINDOW)); 40 } 41 42 } // namespace wallpaper_manager_util 43