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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/ui/app_list/app_list_service.h" | 9 #include "chrome/browser/ui/app_list/app_list_service.h" |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 // Opens a Chrome browser tab at chrome://apps. | 91 // Opens a Chrome browser tab at chrome://apps. |
92 void OpenAppsPage(Profile* fallback_profile) { | 92 void OpenAppsPage(Profile* fallback_profile) { |
93 Browser* browser = chrome::FindLastActive(); | 93 Browser* browser = chrome::FindLastActive(); |
94 Profile* app_list_profile = browser ? browser->profile() : fallback_profile; | 94 Profile* app_list_profile = browser ? browser->profile() : fallback_profile; |
95 app_list_profile = app_list_profile->GetOriginalProfile(); | 95 app_list_profile = app_list_profile->GetOriginalProfile(); |
96 | 96 |
97 if (IsProfileSignedOut(app_list_profile) || | 97 if (IsProfileSignedOut(app_list_profile) || |
98 app_list_profile->IsSystemProfile() || | 98 app_list_profile->IsSystemProfile() || |
99 app_list_profile->IsGuestSession()) { | 99 app_list_profile->IsGuestSession()) { |
100 UserManager::Show(base::FilePath(), profiles::USER_MANAGER_NO_TUTORIAL, | 100 UserManager::Show(base::FilePath(), |
101 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); | 101 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
102 return; | 102 return; |
103 } | 103 } |
104 | 104 |
105 chrome::NavigateParams params(app_list_profile, | 105 chrome::NavigateParams params(app_list_profile, |
106 GURL(chrome::kChromeUIAppsURL), | 106 GURL(chrome::kChromeUIAppsURL), |
107 ui::PAGE_TRANSITION_AUTO_BOOKMARK); | 107 ui::PAGE_TRANSITION_AUTO_BOOKMARK); |
108 chrome::Navigate(¶ms); | 108 chrome::Navigate(¶ms); |
109 } | 109 } |
110 #endif | 110 #endif |
(...skipping 23 matching lines...) Expand all Loading... |
134 #if defined(TOOLKIT_VIEWS) | 134 #if defined(TOOLKIT_VIEWS) |
135 if (!command_line.HasSwitch(switches::kShowAppList)) | 135 if (!command_line.HasSwitch(switches::kShowAppList)) |
136 return false; | 136 return false; |
137 | 137 |
138 OpenAppsPage(launch_profile); | 138 OpenAppsPage(launch_profile); |
139 return true; | 139 return true; |
140 #else | 140 #else |
141 return false; | 141 return false; |
142 #endif | 142 #endif |
143 } | 143 } |
OLD | NEW |