| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/thread.h" | 10 #include "base/thread.h" |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 | 1022 |
| 1023 void AutomationProvider::GoBack(int handle, IPC::Message* reply_message) { | 1023 void AutomationProvider::GoBack(int handle, IPC::Message* reply_message) { |
| 1024 if (tab_tracker_->ContainsHandle(handle)) { | 1024 if (tab_tracker_->ContainsHandle(handle)) { |
| 1025 NavigationController* tab = tab_tracker_->GetResource(handle); | 1025 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 1026 Browser* browser = FindAndActivateTab(tab); | 1026 Browser* browser = FindAndActivateTab(tab); |
| 1027 if (browser && browser->command_updater()->IsCommandEnabled(IDC_BACK)) { | 1027 if (browser && browser->command_updater()->IsCommandEnabled(IDC_BACK)) { |
| 1028 AddNavigationStatusListener<AutomationMsg_NavigationResponseValues>( | 1028 AddNavigationStatusListener<AutomationMsg_NavigationResponseValues>( |
| 1029 tab, reply_message, AUTOMATION_MSG_NAVIGATION_SUCCESS, | 1029 tab, reply_message, AUTOMATION_MSG_NAVIGATION_SUCCESS, |
| 1030 AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED, | 1030 AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED, |
| 1031 AUTOMATION_MSG_NAVIGATION_ERROR); | 1031 AUTOMATION_MSG_NAVIGATION_ERROR); |
| 1032 browser->GoBack(); | 1032 browser->GoBack(CURRENT_TAB); |
| 1033 return; | 1033 return; |
| 1034 } | 1034 } |
| 1035 } | 1035 } |
| 1036 | 1036 |
| 1037 AutomationMsg_GoBack::WriteReplyParams( | 1037 AutomationMsg_GoBack::WriteReplyParams( |
| 1038 reply_message, AUTOMATION_MSG_NAVIGATION_ERROR); | 1038 reply_message, AUTOMATION_MSG_NAVIGATION_ERROR); |
| 1039 Send(reply_message); | 1039 Send(reply_message); |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 void AutomationProvider::GoForward(int handle, IPC::Message* reply_message) { | 1042 void AutomationProvider::GoForward(int handle, IPC::Message* reply_message) { |
| 1043 if (tab_tracker_->ContainsHandle(handle)) { | 1043 if (tab_tracker_->ContainsHandle(handle)) { |
| 1044 NavigationController* tab = tab_tracker_->GetResource(handle); | 1044 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 1045 Browser* browser = FindAndActivateTab(tab); | 1045 Browser* browser = FindAndActivateTab(tab); |
| 1046 if (browser && browser->command_updater()->IsCommandEnabled(IDC_FORWARD)) { | 1046 if (browser && browser->command_updater()->IsCommandEnabled(IDC_FORWARD)) { |
| 1047 AddNavigationStatusListener<AutomationMsg_NavigationResponseValues>( | 1047 AddNavigationStatusListener<AutomationMsg_NavigationResponseValues>( |
| 1048 tab, reply_message, AUTOMATION_MSG_NAVIGATION_SUCCESS, | 1048 tab, reply_message, AUTOMATION_MSG_NAVIGATION_SUCCESS, |
| 1049 AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED, | 1049 AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED, |
| 1050 AUTOMATION_MSG_NAVIGATION_ERROR); | 1050 AUTOMATION_MSG_NAVIGATION_ERROR); |
| 1051 browser->GoForward(); | 1051 browser->GoForward(CURRENT_TAB); |
| 1052 return; | 1052 return; |
| 1053 } | 1053 } |
| 1054 } | 1054 } |
| 1055 | 1055 |
| 1056 AutomationMsg_GoForward::WriteReplyParams( | 1056 AutomationMsg_GoForward::WriteReplyParams( |
| 1057 reply_message, AUTOMATION_MSG_NAVIGATION_ERROR); | 1057 reply_message, AUTOMATION_MSG_NAVIGATION_ERROR); |
| 1058 Send(reply_message); | 1058 Send(reply_message); |
| 1059 } | 1059 } |
| 1060 | 1060 |
| 1061 void AutomationProvider::Reload(int handle, IPC::Message* reply_message) { | 1061 void AutomationProvider::Reload(int handle, IPC::Message* reply_message) { |
| (...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2732 | 2732 |
| 2733 if (thread_id != GetCurrentThreadId()) { | 2733 if (thread_id != GetCurrentThreadId()) { |
| 2734 NOTREACHED(); | 2734 NOTREACHED(); |
| 2735 return; | 2735 return; |
| 2736 } | 2736 } |
| 2737 | 2737 |
| 2738 SetWindowPos(params.window, params.window_insert_after, params.left, | 2738 SetWindowPos(params.window, params.window_insert_after, params.left, |
| 2739 params.top, params.width, params.height, params.flags); | 2739 params.top, params.width, params.height, params.flags); |
| 2740 } | 2740 } |
| 2741 #endif // defined(OS_WIN) | 2741 #endif // defined(OS_WIN) |
| OLD | NEW |