OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/profiles/avatar_menu_actions_desktop.h" | 5 #include "chrome/browser/profiles/avatar_menu_actions_desktop.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 AvatarMenuActions* AvatarMenuActions::Create() { | 33 AvatarMenuActions* AvatarMenuActions::Create() { |
34 return new AvatarMenuActionsDesktop(); | 34 return new AvatarMenuActionsDesktop(); |
35 } | 35 } |
36 | 36 |
37 void AvatarMenuActionsDesktop::AddNewProfile(ProfileMetrics::ProfileAdd type) { | 37 void AvatarMenuActionsDesktop::AddNewProfile(ProfileMetrics::ProfileAdd type) { |
38 // TODO: Remove dependency on Browser by delegating AddNewProfile and | 38 // TODO: Remove dependency on Browser by delegating AddNewProfile and |
39 // and EditProfile actions. | 39 // and EditProfile actions. |
40 | 40 |
41 Browser* settings_browser = browser_; | 41 Browser* settings_browser = browser_; |
42 if (!settings_browser) { | 42 if (!settings_browser) { |
43 const Browser::CreateParams params(ProfileManager::GetLastUsedProfile(), | 43 const Browser::CreateParams params( |
44 chrome::GetActiveDesktop()); | 44 g_browser_process->profile_manager()->GetLastUsedProfile(), |
| 45 chrome::GetActiveDesktop()); |
45 settings_browser = new Browser(params); | 46 settings_browser = new Browser(params); |
46 } | 47 } |
47 chrome::ShowSettingsSubPage(settings_browser, chrome::kCreateProfileSubPage); | 48 chrome::ShowSettingsSubPage(settings_browser, chrome::kCreateProfileSubPage); |
48 ProfileMetrics::LogProfileAddNewUser(type); | 49 ProfileMetrics::LogProfileAddNewUser(type); |
49 } | 50 } |
50 | 51 |
51 void AvatarMenuActionsDesktop::EditProfile(Profile* profile, size_t index) { | 52 void AvatarMenuActionsDesktop::EditProfile(Profile* profile, size_t index) { |
52 Browser* settings_browser = browser_; | 53 Browser* settings_browser = browser_; |
53 if (!settings_browser) { | 54 if (!settings_browser) { |
54 settings_browser = new Browser( | 55 settings_browser = new Browser( |
(...skipping 20 matching lines...) Expand all Loading... |
75 #if defined(OS_WIN) | 76 #if defined(OS_WIN) |
76 return chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH; | 77 return chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH; |
77 #else | 78 #else |
78 return true; | 79 return true; |
79 #endif | 80 #endif |
80 } | 81 } |
81 | 82 |
82 void AvatarMenuActionsDesktop::ActiveBrowserChanged(Browser* browser) { | 83 void AvatarMenuActionsDesktop::ActiveBrowserChanged(Browser* browser) { |
83 browser_ = browser; | 84 browser_ = browser; |
84 } | 85 } |
OLD | NEW |