| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/message_box_flags.h" | 10 #include "app/message_box_flags.h" |
| (...skipping 1987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1998 #else | 1998 #else |
| 1999 // TODO(port): Enable when encoding-related parts of Browser are ported. | 1999 // TODO(port): Enable when encoding-related parts of Browser are ported. |
| 2000 NOTIMPLEMENTED(); | 2000 NOTIMPLEMENTED(); |
| 2001 #endif | 2001 #endif |
| 2002 } | 2002 } |
| 2003 | 2003 |
| 2004 void AutomationProvider::SavePackageShouldPromptUser(bool should_prompt) { | 2004 void AutomationProvider::SavePackageShouldPromptUser(bool should_prompt) { |
| 2005 SavePackage::SetShouldPromptUser(should_prompt); | 2005 SavePackage::SetShouldPromptUser(should_prompt); |
| 2006 } | 2006 } |
| 2007 | 2007 |
| 2008 void AutomationProvider::GetWindowTitle(int handle, string16* text) { | |
| 2009 gfx::NativeWindow window = window_tracker_->GetResource(handle); | |
| 2010 text->assign(platform_util::GetWindowTitle(window)); | |
| 2011 } | |
| 2012 | |
| 2013 void AutomationProvider::GetBlockedPopupCount(int handle, int* count) { | 2008 void AutomationProvider::GetBlockedPopupCount(int handle, int* count) { |
| 2014 *count = -1; // -1 is the error code | 2009 *count = -1; // -1 is the error code |
| 2015 if (tab_tracker_->ContainsHandle(handle)) { | 2010 if (tab_tracker_->ContainsHandle(handle)) { |
| 2016 NavigationController* nav_controller = tab_tracker_->GetResource(handle); | 2011 NavigationController* nav_controller = tab_tracker_->GetResource(handle); |
| 2017 TabContents* tab_contents = nav_controller->tab_contents(); | 2012 TabContents* tab_contents = nav_controller->tab_contents(); |
| 2018 if (tab_contents) { | 2013 if (tab_contents) { |
| 2019 BlockedPopupContainer* container = | 2014 BlockedPopupContainer* container = |
| 2020 tab_contents->blocked_popup_container(); | 2015 tab_contents->blocked_popup_container(); |
| 2021 if (container) { | 2016 if (container) { |
| 2022 *count = static_cast<int>(container->GetBlockedPopupCount()); | 2017 *count = static_cast<int>(container->GetBlockedPopupCount()); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2261 Send(reply_message); | 2256 Send(reply_message); |
| 2262 } | 2257 } |
| 2263 } | 2258 } |
| 2264 | 2259 |
| 2265 void AutomationProvider::SaveAsAsync(int tab_handle) { | 2260 void AutomationProvider::SaveAsAsync(int tab_handle) { |
| 2266 NavigationController* tab = NULL; | 2261 NavigationController* tab = NULL; |
| 2267 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); | 2262 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); |
| 2268 if (tab_contents) | 2263 if (tab_contents) |
| 2269 tab_contents->OnSavePage(); | 2264 tab_contents->OnSavePage(); |
| 2270 } | 2265 } |
| OLD | NEW |