Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Side by Side Diff: chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc

Issue 10391158: Moves methods for finding browsers to browser_finder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include fixs Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/background/ash_user_wallpaper_delegate.h" 5 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/desktop_background/desktop_background_controller.h" 8 #include "ash/desktop_background/desktop_background_controller.h"
9 #include "ash/desktop_background/desktop_background_resources.h" 9 #include "ash/desktop_background/desktop_background_resources.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "chrome/browser/chromeos/login/user_manager.h" 11 #include "chrome/browser/chromeos/login/user_manager.h"
12 #include "chrome/browser/profiles/profile_manager.h" 12 #include "chrome/browser/profiles/profile_manager.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_list.h" 14 #include "chrome/browser/ui/browser_finder.h"
15 #include "chrome/common/chrome_notification_types.h" 15 #include "chrome/common/chrome_notification_types.h"
16 #include "content/public/browser/notification_service.h" 16 #include "content/public/browser/notification_service.h"
17 17
18 namespace chromeos { 18 namespace chromeos {
19 19
20 namespace { 20 namespace {
21 21
22 class UserWallpaperDelegate: public ash::UserWallpaperDelegate { 22 class UserWallpaperDelegate: public ash::UserWallpaperDelegate {
23 public: 23 public:
24 UserWallpaperDelegate() { 24 UserWallpaperDelegate() {
25 } 25 }
26 26
27 virtual ~UserWallpaperDelegate() { 27 virtual ~UserWallpaperDelegate() {
28 } 28 }
29 29
30 virtual const int GetUserWallpaperIndex() OVERRIDE { 30 virtual const int GetUserWallpaperIndex() OVERRIDE {
31 return chromeos::UserManager::Get()->GetLoggedInUserWallpaperIndex(); 31 return chromeos::UserManager::Get()->GetLoggedInUserWallpaperIndex();
32 } 32 }
33 33
34 virtual void OpenSetWallpaperPage() OVERRIDE { 34 virtual void OpenSetWallpaperPage() OVERRIDE {
35 Browser* browser = Browser::GetOrCreateTabbedBrowser( 35 Browser* browser = browser::FindOrCreateTabbedBrowser(
36 ProfileManager::GetDefaultProfileOrOffTheRecord()); 36 ProfileManager::GetDefaultProfileOrOffTheRecord());
37 browser->ShowOptionsTab("setWallpaper"); 37 browser->ShowOptionsTab("setWallpaper");
38 } 38 }
39 39
40 virtual bool CanOpenSetWallpaperPage() OVERRIDE { 40 virtual bool CanOpenSetWallpaperPage() OVERRIDE {
41 return !chromeos::UserManager::Get()->IsLoggedInAsGuest(); 41 return !chromeos::UserManager::Get()->IsLoggedInAsGuest();
42 } 42 }
43 43
44 private: 44 private:
45 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate); 45 DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate);
46 }; 46 };
47 47
48 } // namespace 48 } // namespace
49 49
50 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() { 50 ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() {
51 return new chromeos::UserWallpaperDelegate(); 51 return new chromeos::UserWallpaperDelegate();
52 } 52 }
53 53
54 } // namespace chromeos 54 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698