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 "chrome/common/extensions/extension_constants.h" 20 21 namespace wallpaper_manager_util { 22 23 void OpenWallpaperManager() { 24 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); 25 ExtensionService* service = 26 extensions::ExtensionSystem::Get(profile)->extension_service(); 27 if (!service) 28 return; 29 30 const extensions::Extension* extension = 31 service->GetExtensionById(extension_misc::kWallpaperManagerId, false); 32 if (!extension) 33 return; 34 35 chrome::OpenApplication(chrome::AppLaunchParams(profile, extension, 36 extension_misc::LAUNCH_WINDOW, 37 NEW_WINDOW)); 38 } 39 40 } // namespace wallpaper_manager_util 41