| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 static_cast<AutomationPageFontSize>(font_size); | 702 static_cast<AutomationPageFontSize>(font_size); |
| 703 | 703 |
| 704 if (automation_font_size < SMALLEST_FONT || | 704 if (automation_font_size < SMALLEST_FONT || |
| 705 automation_font_size > LARGEST_FONT) { | 705 automation_font_size > LARGEST_FONT) { |
| 706 DLOG(ERROR) << "Invalid font size specified : " | 706 DLOG(ERROR) << "Invalid font size specified : " |
| 707 << font_size; | 707 << font_size; |
| 708 return; | 708 return; |
| 709 } | 709 } |
| 710 | 710 |
| 711 if (tab_tracker_->ContainsHandle(tab_handle)) { | 711 if (tab_tracker_->ContainsHandle(tab_handle)) { |
| 712 NavigationController* tab = tab_tracker_->GetResource(tab_handle); | 712 NavigationController* nav = tab_tracker_->GetResource(tab_handle); |
| 713 DCHECK(tab != NULL); | 713 DCHECK(nav != NULL); |
| 714 if (tab && tab->tab_contents()) { | 714 if (nav && nav->tab_contents()) { |
| 715 DCHECK(tab->tab_contents()->profile() != NULL); | 715 DCHECK(nav->browser_context() != NULL); |
| 716 tab->tab_contents()->profile()->GetPrefs()->SetInteger( | 716 Profile* profile = static_cast<Profile*>(nav->browser_context()); |
| 717 prefs::kWebKitDefaultFontSize, font_size); | 717 profile->GetPrefs()->SetInteger(prefs::kWebKitDefaultFontSize, font_size); |
| 718 } | 718 } |
| 719 } | 719 } |
| 720 } | 720 } |
| 721 | 721 |
| 722 void AutomationProvider::RemoveBrowsingData(int remove_mask) { | 722 void AutomationProvider::RemoveBrowsingData(int remove_mask) { |
| 723 BrowsingDataRemover* remover; | 723 BrowsingDataRemover* remover; |
| 724 remover = new BrowsingDataRemover(profile(), | 724 remover = new BrowsingDataRemover(profile(), |
| 725 BrowsingDataRemover::EVERYTHING, // All time periods. | 725 BrowsingDataRemover::EVERYTHING, // All time periods. |
| 726 base::Time()); | 726 base::Time()); |
| 727 remover->Remove(remove_mask); | 727 remover->Remove(remove_mask); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 } | 959 } |
| 960 } | 960 } |
| 961 } | 961 } |
| 962 | 962 |
| 963 void AutomationProvider::SaveAsAsync(int tab_handle) { | 963 void AutomationProvider::SaveAsAsync(int tab_handle) { |
| 964 NavigationController* tab = NULL; | 964 NavigationController* tab = NULL; |
| 965 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); | 965 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); |
| 966 if (tab_contents) | 966 if (tab_contents) |
| 967 tab_contents->OnSavePage(); | 967 tab_contents->OnSavePage(); |
| 968 } | 968 } |
| OLD | NEW |