| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/message_box_flags.h" | 9 #include "app/message_box_flags.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 FilePath user_data_dir; | 542 FilePath user_data_dir; |
| 543 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | 543 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
| 544 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 544 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 545 DCHECK(profile_manager); | 545 DCHECK(profile_manager); |
| 546 Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); | 546 Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); |
| 547 DCHECK(profile); | 547 DCHECK(profile); |
| 548 context_getter = profile->GetRequestContext(); | 548 context_getter = profile->GetRequestContext(); |
| 549 } | 549 } |
| 550 DCHECK(context_getter); | 550 DCHECK(context_getter); |
| 551 | 551 |
| 552 ChromeThread::PostTask( | 552 BrowserThread::PostTask( |
| 553 ChromeThread::IO, FROM_HERE, | 553 BrowserThread::IO, FROM_HERE, |
| 554 new SetProxyConfigTask(context_getter, new_proxy_config)); | 554 new SetProxyConfigTask(context_getter, new_proxy_config)); |
| 555 } | 555 } |
| 556 | 556 |
| 557 TabContents* AutomationProvider::GetTabContentsForHandle( | 557 TabContents* AutomationProvider::GetTabContentsForHandle( |
| 558 int handle, NavigationController** tab) { | 558 int handle, NavigationController** tab) { |
| 559 if (tab_tracker_->ContainsHandle(handle)) { | 559 if (tab_tracker_->ContainsHandle(handle)) { |
| 560 NavigationController* nav_controller = tab_tracker_->GetResource(handle); | 560 NavigationController* nav_controller = tab_tracker_->GetResource(handle); |
| 561 if (tab) | 561 if (tab) |
| 562 *tab = nav_controller; | 562 *tab = nav_controller; |
| 563 return nav_controller->tab_contents(); | 563 return nav_controller->tab_contents(); |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 } | 956 } |
| 957 } | 957 } |
| 958 } | 958 } |
| 959 | 959 |
| 960 void AutomationProvider::SaveAsAsync(int tab_handle) { | 960 void AutomationProvider::SaveAsAsync(int tab_handle) { |
| 961 NavigationController* tab = NULL; | 961 NavigationController* tab = NULL; |
| 962 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); | 962 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); |
| 963 if (tab_contents) | 963 if (tab_contents) |
| 964 tab_contents->OnSavePage(); | 964 tab_contents->OnSavePage(); |
| 965 } | 965 } |
| OLD | NEW |