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

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

Issue 10810062: Moving common code into OmniboxView from OmniboxView* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix final nits Created 8 years, 4 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/omnibox_search_hint.cc » ('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) 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 3267 matching lines...) Expand 10 before | Expand all | Expand 10 after
3278 AutomationJSONReply reply(this, reply_message); 3278 AutomationJSONReply reply(this, reply_message);
3279 if (!args->GetInteger("count", &count)) { 3279 if (!args->GetInteger("count", &count)) {
3280 reply.SendError("count missing"); 3280 reply.SendError("count missing");
3281 return; 3281 return;
3282 } 3282 }
3283 LocationBar* loc_bar = browser->window()->GetLocationBar(); 3283 LocationBar* loc_bar = browser->window()->GetLocationBar();
3284 if (!loc_bar) { 3284 if (!loc_bar) {
3285 reply.SendError("The specified browser does not have a location bar."); 3285 reply.SendError("The specified browser does not have a location bar.");
3286 return; 3286 return;
3287 } 3287 }
3288 OmniboxEditModel* model = loc_bar->GetLocationEntry()->model(); 3288 loc_bar->GetLocationEntry()->model()->OnUpOrDownKeyPressed(count);
3289 model->OnUpOrDownKeyPressed(count);
3290 reply.SendSuccess(NULL); 3289 reply.SendSuccess(NULL);
3291 } 3290 }
3292 3291
3293 // Sample json input: { "command": "OmniboxAcceptInput" } 3292 // Sample json input: { "command": "OmniboxAcceptInput" }
3294 void TestingAutomationProvider::OmniboxAcceptInput( 3293 void TestingAutomationProvider::OmniboxAcceptInput(
3295 Browser* browser, 3294 Browser* browser,
3296 DictionaryValue* args, 3295 DictionaryValue* args,
3297 IPC::Message* reply_message) { 3296 IPC::Message* reply_message) {
3298 NavigationController& controller = 3297 NavigationController& controller =
3299 chrome::GetActiveWebContents(browser)->GetController(); 3298 chrome::GetActiveWebContents(browser)->GetController();
(...skipping 3877 matching lines...) Expand 10 before | Expand all | Expand 10 after
7177 void TestingAutomationProvider::OnRemoveProvider() { 7176 void TestingAutomationProvider::OnRemoveProvider() {
7178 if (g_browser_process) 7177 if (g_browser_process)
7179 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 7178 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
7180 } 7179 }
7181 7180
7182 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 7181 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
7183 WebContents* tab) { 7182 WebContents* tab) {
7184 if (chrome::GetActiveWebContents(browser) != tab) 7183 if (chrome::GetActiveWebContents(browser) != tab)
7185 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); 7184 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true);
7186 } 7185 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/omnibox_search_hint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698