| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 3185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3196 AutomationJSONReply reply(this, reply_message); | 3196 AutomationJSONReply reply(this, reply_message); |
| 3197 if (!args->GetInteger("count", &count)) { | 3197 if (!args->GetInteger("count", &count)) { |
| 3198 reply.SendError("count missing"); | 3198 reply.SendError("count missing"); |
| 3199 return; | 3199 return; |
| 3200 } | 3200 } |
| 3201 LocationBar* loc_bar = browser->window()->GetLocationBar(); | 3201 LocationBar* loc_bar = browser->window()->GetLocationBar(); |
| 3202 if (!loc_bar) { | 3202 if (!loc_bar) { |
| 3203 reply.SendError("The specified browser does not have a location bar."); | 3203 reply.SendError("The specified browser does not have a location bar."); |
| 3204 return; | 3204 return; |
| 3205 } | 3205 } |
| 3206 OmniboxEditModel* model = loc_bar->GetLocationEntry()->model(); | 3206 loc_bar->GetLocationEntry()->model()->OnUpOrDownKeyPressed(count); |
| 3207 model->OnUpOrDownKeyPressed(count); | |
| 3208 reply.SendSuccess(NULL); | 3207 reply.SendSuccess(NULL); |
| 3209 } | 3208 } |
| 3210 | 3209 |
| 3211 // Sample json input: { "command": "OmniboxAcceptInput" } | 3210 // Sample json input: { "command": "OmniboxAcceptInput" } |
| 3212 void TestingAutomationProvider::OmniboxAcceptInput( | 3211 void TestingAutomationProvider::OmniboxAcceptInput( |
| 3213 Browser* browser, | 3212 Browser* browser, |
| 3214 DictionaryValue* args, | 3213 DictionaryValue* args, |
| 3215 IPC::Message* reply_message) { | 3214 IPC::Message* reply_message) { |
| 3216 NavigationController& controller = | 3215 NavigationController& controller = |
| 3217 chrome::GetActiveWebContents(browser)->GetController(); | 3216 chrome::GetActiveWebContents(browser)->GetController(); |
| (...skipping 3686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6904 void TestingAutomationProvider::OnRemoveProvider() { | 6903 void TestingAutomationProvider::OnRemoveProvider() { |
| 6905 if (g_browser_process) | 6904 if (g_browser_process) |
| 6906 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6905 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 6907 } | 6906 } |
| 6908 | 6907 |
| 6909 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6908 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 6910 WebContents* tab) { | 6909 WebContents* tab) { |
| 6911 if (chrome::GetActiveWebContents(browser) != tab) | 6910 if (chrome::GetActiveWebContents(browser) != tab) |
| 6912 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); | 6911 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); |
| 6913 } | 6912 } |
| OLD | NEW |