wallpaper_manager_util.cc revision 0529e5d033099cbfc42635f6f6183833b09dff6e
17026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant// Copyright (c) 2012 The Chromium Authors. All rights reserved. 27026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant// Use of this source code is governed by a BSD-style license that can be 37026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant// found in the LICENSE file. 47026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant 5b64f8b07c104c6cc986570ac8ee0ed16a9f23976Howard Hinnant#include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h" 6b64f8b07c104c6cc986570ac8ee0ed16a9f23976Howard Hinnant 77026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant#include "base/logging.h" 87026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant#include "chrome/browser/extensions/extension_service.h" 97026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant#include "chrome/browser/profiles/profile.h" 107026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant#include "chrome/browser/profiles/profile_manager.h" 117026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant#include "chrome/browser/ui/extensions/application_launch.h" 127026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant#include "chrome/common/extensions/extension_constants.h" 137026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant#include "extensions/browser/extension_system.h" 147026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant#include "extensions/common/extension.h" 157026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant#include "ui/base/window_open_disposition.h" 167026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant 177026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnantnamespace wallpaper_manager_util { 187026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant 197026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnantvoid OpenWallpaperManager() { 207026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant Profile* profile = ProfileManager::GetActiveUserProfile(); 217026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant DCHECK(profile); 227026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant 237026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant ExtensionService* service = 247026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant extensions::ExtensionSystem::Get(profile)->extension_service(); 257026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant if (!service) 267026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant return; 277026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant 287026a17a482a9f7fdd9fc41aead6a167167efb1bHoward Hinnant const extensions::Extension* extension = 29 service->GetExtensionById(extension_misc::kWallpaperManagerId, false); 30 if (!extension) 31 return; 32 33 OpenApplication(AppLaunchParams(profile, extension, 34 extensions::LAUNCH_CONTAINER_WINDOW, 35 NEW_WINDOW)); 36} 37 38} // namespace wallpaper_manager_util 39