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/automation/automation_util.h" | 5 #include "chrome/browser/automation/automation_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "net/cookies/canonical_cookie.h" | 40 #include "net/cookies/canonical_cookie.h" |
41 #include "net/cookies/cookie_constants.h" | 41 #include "net/cookies/cookie_constants.h" |
42 #include "net/cookies/cookie_monster.h" | 42 #include "net/cookies/cookie_monster.h" |
43 #include "net/cookies/cookie_store.h" | 43 #include "net/cookies/cookie_store.h" |
44 #include "net/url_request/url_request_context.h" | 44 #include "net/url_request/url_request_context.h" |
45 #include "net/url_request/url_request_context_getter.h" | 45 #include "net/url_request/url_request_context_getter.h" |
46 | 46 |
47 #if defined(OS_CHROMEOS) | 47 #if defined(OS_CHROMEOS) |
48 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 48 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
49 #include "chrome/browser/chromeos/login/login_display.h" | 49 #include "chrome/browser/chromeos/login/login_display.h" |
50 #include "chrome/browser/chromeos/login/login_display_host.h" | 50 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
51 #include "chrome/browser/chromeos/login/webui_login_display.h" | 51 #include "chrome/browser/chromeos/login/webui_login_display.h" |
52 #include "chrome/browser/chromeos/login/webui_login_display_host.h" | |
53 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 52 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
54 #endif | 53 #endif |
55 | 54 |
56 using content::BrowserThread; | 55 using content::BrowserThread; |
57 using content::RenderViewHost; | 56 using content::RenderViewHost; |
58 using content::WebContents; | 57 using content::WebContents; |
59 | 58 |
60 #if defined(OS_CHROMEOS) | 59 #if defined(OS_CHROMEOS) |
61 using chromeos::ExistingUserController; | 60 using chromeos::ExistingUserController; |
62 using chromeos::User; | 61 using chromeos::User; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 *error_message = "No user manager."; | 179 *error_message = "No user manager."; |
181 return NULL; | 180 return NULL; |
182 } | 181 } |
183 if (!user_manager->IsUserLoggedIn()) { | 182 if (!user_manager->IsUserLoggedIn()) { |
184 ExistingUserController* controller = | 183 ExistingUserController* controller = |
185 ExistingUserController::current_controller(); | 184 ExistingUserController::current_controller(); |
186 if (!controller) { | 185 if (!controller) { |
187 *error_message = "Cannot get controller though user is not logged in."; | 186 *error_message = "Cannot get controller though user is not logged in."; |
188 return NULL; | 187 return NULL; |
189 } | 188 } |
190 chromeos::WebUILoginDisplayHost* webui_login_display_host = | 189 chromeos::LoginDisplayHostImpl* webui_host = |
191 static_cast<chromeos::WebUILoginDisplayHost*>( | 190 static_cast<chromeos::LoginDisplayHostImpl*>( |
192 controller->login_display_host()); | 191 controller->login_display_host()); |
193 content::WebUI* web_ui = webui_login_display_host->GetOobeUI()->web_ui(); | 192 content::WebUI* web_ui = webui_host->GetOobeUI()->web_ui(); |
194 if (!web_ui) { | 193 if (!web_ui) { |
195 *error_message = "Unable to get webui from login display host."; | 194 *error_message = "Unable to get webui from login display host."; |
196 return NULL; | 195 return NULL; |
197 } | 196 } |
198 return Profile::FromWebUI(web_ui); | 197 return Profile::FromWebUI(web_ui); |
199 } else { | 198 } else { |
200 ash::Shell* shell = ash::Shell::GetInstance(); | 199 ash::Shell* shell = ash::Shell::GetInstance(); |
201 if (!shell || !shell->delegate()) { | 200 if (!shell || !shell->delegate()) { |
202 *error_message = "Unable to get shell delegate."; | 201 *error_message = "Unable to get shell delegate."; |
203 return NULL; | 202 return NULL; |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 const extensions::Extension* extension; | 633 const extensions::Extension* extension; |
635 return GetExtensionForId(id, profile, &extension); | 634 return GetExtensionForId(id, profile, &extension); |
636 } | 635 } |
637 default: | 636 default: |
638 break; | 637 break; |
639 } | 638 } |
640 return false; | 639 return false; |
641 } | 640 } |
642 | 641 |
643 } // namespace automation_util | 642 } // namespace automation_util |
OLD | NEW |