OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h" | 5 #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_system.h" |
10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
12 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/browser_finder.h" | 14 #include "chrome/browser/ui/browser_finder.h" |
14 #include "chrome/browser/ui/browser_list.h" | 15 #include "chrome/browser/ui/browser_list.h" |
15 #include "chrome/browser/ui/browser_tabstrip.h" | 16 #include "chrome/browser/ui/browser_tabstrip.h" |
16 #include "chrome/browser/ui/browser_window.h" | 17 #include "chrome/browser/ui/browser_window.h" |
17 #include "chrome/browser/ui/chrome_pages.h" | 18 #include "chrome/browser/ui/chrome_pages.h" |
18 #include "chrome/browser/ui/host_desktop.h" | 19 #include "chrome/browser/ui/host_desktop.h" |
19 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 20 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
(...skipping 21 matching lines...) Expand all Loading... |
41 } | 42 } |
42 } | 43 } |
43 return NULL; | 44 return NULL; |
44 } | 45 } |
45 | 46 |
46 } // namespace | 47 } // namespace |
47 | 48 |
48 void OpenWallpaperManager() { | 49 void OpenWallpaperManager() { |
49 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 50 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
50 std::string url = chrome::kChromeUIWallpaperURL; | 51 std::string url = chrome::kChromeUIWallpaperURL; |
51 ExtensionService* service = profile->GetExtensionService(); | 52 ExtensionService* service = |
| 53 extensions::ExtensionSystem::Get(profile)->extension_service(); |
52 if (!service) | 54 if (!service) |
53 return; | 55 return; |
54 | 56 |
55 const extensions::Extension* extension = | 57 const extensions::Extension* extension = |
56 service->GetExtensionById(extension_misc::kWallpaperManagerId, false); | 58 service->GetExtensionById(extension_misc::kWallpaperManagerId, false); |
57 if (!extension) | 59 if (!extension) |
58 return; | 60 return; |
59 | 61 |
60 GURL wallpaper_picker_url(url); | 62 GURL wallpaper_picker_url(url); |
61 int width = extension->launch_width(); | 63 int width = extension->launch_width(); |
(...skipping 15 matching lines...) Expand all Loading... |
77 bounds, | 79 bounds, |
78 profile)); | 80 profile)); |
79 | 81 |
80 chrome::AddSelectedTabWithURL(browser, wallpaper_picker_url, | 82 chrome::AddSelectedTabWithURL(browser, wallpaper_picker_url, |
81 content::PAGE_TRANSITION_LINK); | 83 content::PAGE_TRANSITION_LINK); |
82 } | 84 } |
83 browser->window()->Show(); | 85 browser->window()->Show(); |
84 } | 86 } |
85 | 87 |
86 } // namespace wallpaper_manager_util | 88 } // namespace wallpaper_manager_util |
OLD | NEW |