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

Unified Diff: chrome/browser/resources/settings/search_page/search_page.js

Issue 2378253003: MD Settings: Search page, switching paper-dropdown-menu to native select. (Closed)
Patch Set: Nits. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/search_page/search_page.js
diff --git a/chrome/browser/resources/settings/search_page/search_page.js b/chrome/browser/resources/settings/search_page/search_page.js
index 31cc04f9b591f5bb880f9bd9b704af78ca8bd1e2..4c70a30433cf313549cede562266954b265e04a7 100644
--- a/chrome/browser/resources/settings/search_page/search_page.js
+++ b/chrome/browser/resources/settings/search_page/search_page.js
@@ -43,27 +43,9 @@ Polymer({
},
/** @private */
- onIronSelect_: function() {
- var searchEngine = this.searchEngines_[this.$$('paper-listbox').selected];
- if (searchEngine.default) {
- // If the selected search engine is already marked as the default one,
- // this change originated in some other tab, and nothing should be done
- // here.
- return;
- }
-
- // Otherwise, this change originated by an explicit user action in this tab.
- // Submit the default search engine change.
+ onChange_: function(e) {
+ var select = /** @type {!HTMLSelectElement} */ (this.$$('select'));
+ var searchEngine = this.searchEngines_[select.selectedIndex];
this.browserProxy_.setDefaultSearchEngine(searchEngine.modelIndex);
},
-
- /**
- * @return {number}
- * @private
- */
- getSelectedSearchEngineIndex_: function() {
- return this.searchEngines_.findIndex(function(searchEngine) {
- return searchEngine.default;
- });
- },
});

Powered by Google App Engine
This is Rietveld 408576698