Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / browser / chromeos / extensions / wallpaper_manager_util.cc
blobda40b7a01ec7b64b60223a5351e74f88b7200ec2
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.
5 #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h"
7 #include "base/logging.h"
8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/profiles/profile_manager.h"
11 #include "chrome/browser/ui/extensions/application_launch.h"
12 #include "chrome/common/extensions/extension_constants.h"
13 #include "extensions/browser/extension_system.h"
14 #include "extensions/common/extension.h"
15 #include "ui/base/window_open_disposition.h"
17 namespace wallpaper_manager_util {
19 void OpenWallpaperManager() {
20 Profile* profile = ProfileManager::GetActiveUserProfile();
21 DCHECK(profile);
23 ExtensionService* service =
24 extensions::ExtensionSystem::Get(profile)->extension_service();
25 if (!service)
26 return;
28 const extensions::Extension* extension =
29 service->GetExtensionById(extension_misc::kWallpaperManagerId, false);
30 if (!extension)
31 return;
33 OpenApplication(AppLaunchParams(profile, extension,
34 extensions::LAUNCH_CONTAINER_WINDOW,
35 NEW_WINDOW));
38 } // namespace wallpaper_manager_util