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

Side by Side Diff: chrome/browser/resources/options/search_page.js

Issue 298553002: Options: maintain history entries on the parent frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dbeam comments Created 6 years, 7 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 | « chrome/browser/resources/options/options_page.js ('k') | chrome/browser/resources/uber/uber.js » ('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 cr.define('options', function() { 5 cr.define('options', function() {
6 /** @const */ var OptionsPage = options.OptionsPage; 6 /** @const */ var OptionsPage = options.OptionsPage;
7 7
8 /** 8 /**
9 * Encapsulated handling of a search bubble. 9 * Encapsulated handling of a search bubble.
10 * @constructor 10 * @constructor
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // Prevent recursive execution of this method. 265 // Prevent recursive execution of this method.
266 if (this.insideSetSearchText_) return; 266 if (this.insideSetSearchText_) return;
267 this.insideSetSearchText_ = true; 267 this.insideSetSearchText_ = true;
268 268
269 // Cleanup the search query string. 269 // Cleanup the search query string.
270 text = SearchPage.canonicalizeQuery(text); 270 text = SearchPage.canonicalizeQuery(text);
271 271
272 // Set the hash on the current page, and the enclosing uber page 272 // Set the hash on the current page, and the enclosing uber page
273 var hash = text ? '#' + encodeURIComponent(text) : ''; 273 var hash = text ? '#' + encodeURIComponent(text) : '';
274 var path = text ? this.name : ''; 274 var path = text ? this.name : '';
275 window.location.hash = hash; 275 uber.pushState({}, path + hash);
276 uber.invokeMethodOnParent('setPath', {path: path + hash});
277 276
278 // Toggle the search page if necessary. 277 // Toggle the search page if necessary.
279 if (text) { 278 if (text) {
280 if (!this.searchActive_) 279 if (!this.searchActive_)
281 OptionsPage.showPageByName(this.name, false); 280 OptionsPage.showPageByName(this.name, false);
282 } else { 281 } else {
283 if (this.searchActive_) 282 if (this.searchActive_)
284 OptionsPage.showPageByName(OptionsPage.getDefaultPage().name, false); 283 OptionsPage.showPageByName(OptionsPage.getDefaultPage().name, false);
285 284
286 this.insideSetSearchText_ = false; 285 this.insideSetSearchText_ = false;
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 // Trim beginning and ending whitespace. 568 // Trim beginning and ending whitespace.
570 return text.replace(/^\s+|\s+$/g, ''); 569 return text.replace(/^\s+|\s+$/g, '');
571 }; 570 };
572 571
573 // Export 572 // Export
574 return { 573 return {
575 SearchPage: SearchPage 574 SearchPage: SearchPage
576 }; 575 };
577 576
578 }); 577 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/options_page.js ('k') | chrome/browser/resources/uber/uber.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698