Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(608)

Side by Side Diff: chrome/browser/automation/automation_provider.cc

Issue 17428: Issue 358: Can't open a new tab by middle-clicking home button... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/browser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698