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_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 #include "content/public/browser/web_contents.h" | 71 #include "content/public/browser/web_contents.h" |
72 #include "content/public/browser/web_contents_view.h" | 72 #include "content/public/browser/web_contents_view.h" |
73 #include "net/proxy/proxy_config_service_fixed.h" | 73 #include "net/proxy/proxy_config_service_fixed.h" |
74 #include "net/proxy/proxy_service.h" | 74 #include "net/proxy/proxy_service.h" |
75 #include "net/url_request/url_request_context.h" | 75 #include "net/url_request/url_request_context.h" |
76 #include "net/url_request/url_request_context_getter.h" | 76 #include "net/url_request/url_request_context_getter.h" |
77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" | 77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" |
78 | 78 |
79 #if defined(OS_CHROMEOS) | 79 #if defined(OS_CHROMEOS) |
80 #include "chrome/browser/chromeos/login/user_manager.h" | 80 #include "chrome/browser/chromeos/login/user_manager.h" |
81 #include "chromeos/chromeos_switches.h" | |
82 #endif // defined(OS_CHROMEOS) | 81 #endif // defined(OS_CHROMEOS) |
83 | 82 |
84 using WebKit::WebFindOptions; | 83 using WebKit::WebFindOptions; |
85 using base::Time; | 84 using base::Time; |
86 using content::BrowserThread; | 85 using content::BrowserThread; |
87 using content::DownloadItem; | 86 using content::DownloadItem; |
88 using content::NavigationController; | 87 using content::NavigationController; |
89 using content::RenderViewHost; | 88 using content::RenderViewHost; |
90 using content::TraceController; | 89 using content::TraceController; |
91 using content::WebContents; | 90 using content::WebContents; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 effective_channel_id, | 209 effective_channel_id, |
211 GetChannelMode(use_named_interface), | 210 GetChannelMode(use_named_interface), |
212 this, | 211 this, |
213 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); | 212 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); |
214 channel_->AddFilter(automation_resource_message_filter_); | 213 channel_->AddFilter(automation_resource_message_filter_); |
215 | 214 |
216 #if defined(OS_CHROMEOS) | 215 #if defined(OS_CHROMEOS) |
217 if (use_initial_load_observers_) { | 216 if (use_initial_load_observers_) { |
218 // Wait for webui login to be ready. | 217 // Wait for webui login to be ready. |
219 // Observer will delete itself. | 218 // Observer will delete itself. |
220 if (CommandLine::ForCurrentProcess()->HasSwitch( | 219 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager) && |
221 chromeos::switches::kLoginManager) && | |
222 !chromeos::UserManager::Get()->IsUserLoggedIn()) { | 220 !chromeos::UserManager::Get()->IsUserLoggedIn()) { |
223 login_webui_ready_ = false; | 221 login_webui_ready_ = false; |
224 new OOBEWebuiReadyObserver(this); | 222 new OOBEWebuiReadyObserver(this); |
225 } | 223 } |
226 | 224 |
227 // Wait for the network manager to initialize. | 225 // Wait for the network manager to initialize. |
228 // The observer will delete itself when done. | 226 // The observer will delete itself when done. |
229 network_library_initialized_ = false; | 227 network_library_initialized_ = false; |
230 NetworkManagerInitObserver* observer = new NetworkManagerInitObserver(this); | 228 NetworkManagerInitObserver* observer = new NetworkManagerInitObserver(this); |
231 if (!observer->Init()) | 229 if (!observer->Init()) |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 | 823 |
826 return NULL; | 824 return NULL; |
827 } | 825 } |
828 | 826 |
829 void AutomationProvider::SaveAsAsync(int tab_handle) { | 827 void AutomationProvider::SaveAsAsync(int tab_handle) { |
830 NavigationController* tab = NULL; | 828 NavigationController* tab = NULL; |
831 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); | 829 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); |
832 if (web_contents) | 830 if (web_contents) |
833 web_contents->OnSavePage(); | 831 web_contents->OnSavePage(); |
834 } | 832 } |
OLD | NEW |