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

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

Issue 11421079: Persist the Instant API to committed search result pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes Created 8 years 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 3168 matching lines...) Expand 10 before | Expand all | Expand 10 after
3179 void TestingAutomationProvider::GetInstantInfo(Browser* browser, 3179 void TestingAutomationProvider::GetInstantInfo(Browser* browser,
3180 DictionaryValue* args, 3180 DictionaryValue* args,
3181 IPC::Message* reply_message) { 3181 IPC::Message* reply_message) {
3182 DictionaryValue* info = new DictionaryValue; 3182 DictionaryValue* info = new DictionaryValue;
3183 if (chrome::BrowserInstantController::IsInstantEnabled(browser->profile()) && 3183 if (chrome::BrowserInstantController::IsInstantEnabled(browser->profile()) &&
3184 browser->instant_controller()) { 3184 browser->instant_controller()) {
3185 InstantController* instant = browser->instant_controller()->instant(); 3185 InstantController* instant = browser->instant_controller()->instant();
3186 info->SetBoolean("enabled", true); 3186 info->SetBoolean("enabled", true);
3187 info->SetBoolean("active", (instant->GetPreviewContents() != NULL)); 3187 info->SetBoolean("active", (instant->GetPreviewContents() != NULL));
3188 info->SetBoolean("current", instant->IsCurrent()); 3188 info->SetBoolean("current", instant->IsCurrent());
3189 if (instant->GetPreviewContents() && 3189 if (instant->GetPreviewContents()) {
3190 instant->GetPreviewContents()->web_contents()) { 3190 WebContents* contents = instant->GetPreviewContents();
3191 WebContents* contents = instant->GetPreviewContents()->web_contents();
3192 info->SetBoolean("loading", contents->IsLoading()); 3191 info->SetBoolean("loading", contents->IsLoading());
3193 info->SetString("location", contents->GetURL().spec()); 3192 info->SetString("location", contents->GetURL().spec());
3194 info->SetString("title", contents->GetTitle()); 3193 info->SetString("title", contents->GetTitle());
3195 } 3194 }
3196 } else { 3195 } else {
3197 info->SetBoolean("enabled", false); 3196 info->SetBoolean("enabled", false);
3198 } 3197 }
3199 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 3198 scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
3200 return_value->Set("instant", info); 3199 return_value->Set("instant", info);
3201 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); 3200 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get());
(...skipping 3156 matching lines...) Expand 10 before | Expand all | Expand 10 after
6358 if (g_browser_process) 6357 if (g_browser_process)
6359 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 6358 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
6360 } 6359 }
6361 6360
6362 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 6361 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
6363 WebContents* tab) { 6362 WebContents* tab) {
6364 TabStripModel* tab_strip = browser->tab_strip_model(); 6363 TabStripModel* tab_strip = browser->tab_strip_model();
6365 if (tab_strip->GetActiveWebContents() != tab) 6364 if (tab_strip->GetActiveWebContents() != tab)
6366 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); 6365 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true);
6367 } 6366 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/instant/instant_browsertest.cc » ('j') | chrome/browser/instant/instant_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698