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 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 void AutomationProvider::CloseBrowserAsync(int browser_handle) { | 1371 void AutomationProvider::CloseBrowserAsync(int browser_handle) { |
1372 if (browser_tracker_->ContainsHandle(browser_handle)) { | 1372 if (browser_tracker_->ContainsHandle(browser_handle)) { |
1373 Browser* browser = browser_tracker_->GetResource(browser_handle); | 1373 Browser* browser = browser_tracker_->GetResource(browser_handle); |
1374 browser->window()->Close(); | 1374 browser->window()->Close(); |
1375 } else { | 1375 } else { |
1376 NOTREACHED(); | 1376 NOTREACHED(); |
1377 } | 1377 } |
1378 } | 1378 } |
1379 | 1379 |
1380 void AutomationProvider::NavigateInExternalTab( | 1380 void AutomationProvider::NavigateInExternalTab( |
1381 int handle, const GURL& url, | 1381 int handle, const GURL& url, const GURL& referrer, |
1382 AutomationMsg_NavigationResponseValues* status) { | 1382 AutomationMsg_NavigationResponseValues* status) { |
1383 *status = AUTOMATION_MSG_NAVIGATION_ERROR; | 1383 *status = AUTOMATION_MSG_NAVIGATION_ERROR; |
1384 | 1384 |
1385 if (tab_tracker_->ContainsHandle(handle)) { | 1385 if (tab_tracker_->ContainsHandle(handle)) { |
1386 NavigationController* tab = tab_tracker_->GetResource(handle); | 1386 NavigationController* tab = tab_tracker_->GetResource(handle); |
1387 tab->LoadURL(url, GURL(), PageTransition::TYPED); | 1387 tab->LoadURL(url, referrer, PageTransition::TYPED); |
1388 *status = AUTOMATION_MSG_NAVIGATION_SUCCESS; | 1388 *status = AUTOMATION_MSG_NAVIGATION_SUCCESS; |
1389 } | 1389 } |
1390 } | 1390 } |
1391 | 1391 |
1392 void AutomationProvider::NavigateExternalTabAtIndex( | 1392 void AutomationProvider::NavigateExternalTabAtIndex( |
1393 int handle, int navigation_index, | 1393 int handle, int navigation_index, |
1394 AutomationMsg_NavigationResponseValues* status) { | 1394 AutomationMsg_NavigationResponseValues* status) { |
1395 *status = AUTOMATION_MSG_NAVIGATION_ERROR; | 1395 *status = AUTOMATION_MSG_NAVIGATION_ERROR; |
1396 | 1396 |
1397 if (tab_tracker_->ContainsHandle(handle)) { | 1397 if (tab_tracker_->ContainsHandle(handle)) { |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2098 for (;iter != BrowserList::end(); ++iter) { | 2098 for (;iter != BrowserList::end(); ++iter) { |
2099 gfx::NativeWindow this_window = (*iter)->window()->GetNativeHandle(); | 2099 gfx::NativeWindow this_window = (*iter)->window()->GetNativeHandle(); |
2100 if (window == this_window) { | 2100 if (window == this_window) { |
2101 // Add() returns the existing handle for the resource if any. | 2101 // Add() returns the existing handle for the resource if any. |
2102 *browser_handle = browser_tracker_->Add(*iter); | 2102 *browser_handle = browser_tracker_->Add(*iter); |
2103 *success = true; | 2103 *success = true; |
2104 return; | 2104 return; |
2105 } | 2105 } |
2106 } | 2106 } |
2107 } | 2107 } |
OLD | NEW |