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

Side by Side Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 8400068: Don't send omnibox bounds for hidden field trials. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « chrome/browser/instant/instant_field_trial.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/webui/options/browser_options_handler.h" 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 void BrowserOptionsHandler::EnableInstant(const ListValue* args) { 455 void BrowserOptionsHandler::EnableInstant(const ListValue* args) {
456 InstantController::Enable(Profile::FromWebUI(web_ui_)); 456 InstantController::Enable(Profile::FromWebUI(web_ui_));
457 } 457 }
458 458
459 void BrowserOptionsHandler::DisableInstant(const ListValue* args) { 459 void BrowserOptionsHandler::DisableInstant(const ListValue* args) {
460 InstantController::Disable(Profile::FromWebUI(web_ui_)); 460 InstantController::Disable(Profile::FromWebUI(web_ui_));
461 } 461 }
462 462
463 void BrowserOptionsHandler::GetInstantFieldTrialStatus(const ListValue* args) { 463 void BrowserOptionsHandler::GetInstantFieldTrialStatus(const ListValue* args) {
464 base::FundamentalValue enabled( 464 base::FundamentalValue enabled(
465 InstantFieldTrial::IsExperimentGroup(Profile::FromWebUI(web_ui_))); 465 InstantFieldTrial::IsInstantExperiment(Profile::FromWebUI(web_ui_)));
466 web_ui_->CallJavascriptFunction("BrowserOptions.setInstantFieldTrialStatus", 466 web_ui_->CallJavascriptFunction("BrowserOptions.setInstantFieldTrialStatus",
467 enabled); 467 enabled);
468 } 468 }
469 469
470 void BrowserOptionsHandler::OnResultChanged(bool default_match_changed) { 470 void BrowserOptionsHandler::OnResultChanged(bool default_match_changed) {
471 const AutocompleteResult& result = autocomplete_controller_->result(); 471 const AutocompleteResult& result = autocomplete_controller_->result();
472 ListValue suggestions; 472 ListValue suggestions;
473 for (size_t i = 0; i < result.size(); ++i) { 473 for (size_t i = 0; i < result.size(); ++i) {
474 const AutocompleteMatch& match = result.match_at(i); 474 const AutocompleteMatch& match = result.match_at(i);
475 AutocompleteMatch::Type type = match.type; 475 AutocompleteMatch::Type type = match.type;
476 if (type != AutocompleteMatch::HISTORY_URL && 476 if (type != AutocompleteMatch::HISTORY_URL &&
477 type != AutocompleteMatch::HISTORY_TITLE && 477 type != AutocompleteMatch::HISTORY_TITLE &&
478 type != AutocompleteMatch::HISTORY_BODY && 478 type != AutocompleteMatch::HISTORY_BODY &&
479 type != AutocompleteMatch::HISTORY_KEYWORD && 479 type != AutocompleteMatch::HISTORY_KEYWORD &&
480 type != AutocompleteMatch::NAVSUGGEST) 480 type != AutocompleteMatch::NAVSUGGEST)
481 continue; 481 continue;
482 DictionaryValue* entry = new DictionaryValue(); 482 DictionaryValue* entry = new DictionaryValue();
483 entry->SetString("title", match.description); 483 entry->SetString("title", match.description);
484 entry->SetString("displayURL", match.contents); 484 entry->SetString("displayURL", match.contents);
485 entry->SetString("url", match.destination_url.spec()); 485 entry->SetString("url", match.destination_url.spec());
486 suggestions.Append(entry); 486 suggestions.Append(entry);
487 } 487 }
488 488
489 web_ui_->CallJavascriptFunction( 489 web_ui_->CallJavascriptFunction(
490 "BrowserOptions.updateAutocompleteSuggestions", suggestions); 490 "BrowserOptions.updateAutocompleteSuggestions", suggestions);
491 } 491 }
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_field_trial.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698