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

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

Issue 410293004: Split OptionsPage into Page and PageManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed feedback Created 6 years, 5 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/options/search_page.js
diff --git a/chrome/browser/resources/options/search_page.js b/chrome/browser/resources/options/search_page.js
index cd72ba5f38354c0c002bc115e83bf026c8fdecbc..f8eaaede263e73b16a18b26bc0f9926019439d6c 100644
--- a/chrome/browser/resources/options/search_page.js
+++ b/chrome/browser/resources/options/search_page.js
@@ -3,7 +3,8 @@
// found in the LICENSE file.
cr.define('options', function() {
- /** @const */ var OptionsPage = options.OptionsPage;
+ /** @const */ var Page = cr.ui.pageManager.Page;
+ /** @const */ var PageManager = cr.ui.pageManager.PageManager;
/**
* Encapsulated handling of a search bubble.
@@ -114,16 +115,16 @@ cr.define('options', function() {
* @constructor
*/
function SearchPage() {
- OptionsPage.call(this, 'search',
- loadTimeData.getString('searchPageTabTitle'),
- 'searchPage');
+ Page.call(this, 'search',
+ loadTimeData.getString('searchPageTabTitle'),
+ 'searchPage');
}
cr.addSingletonGetter(SearchPage);
SearchPage.prototype = {
- // Inherit SearchPage from OptionsPage.
- __proto__: OptionsPage.prototype,
+ // Inherit SearchPage from Page.
+ __proto__: Page.prototype,
/**
* A boolean to prevent recursion. Used by setSearchText_().
@@ -136,8 +137,7 @@ cr.define('options', function() {
* Initialize the page.
*/
initializePage: function() {
- // Call base class implementation to start preference initialization.
- OptionsPage.prototype.initializePage.call(this);
+ Page.prototype.initializePage.call(this);
this.searchField = $('search-field');
@@ -199,7 +199,7 @@ cr.define('options', function() {
} else if (!this.searchField.value) {
// This should only happen if the user goes directly to
// chrome://settings-frame/search
- OptionsPage.showDefaultPage();
+ PageManager.showDefaultPage();
return;
}
@@ -234,7 +234,7 @@ cr.define('options', function() {
if (active) {
// When search is active, remove the 'hidden' tag. This tag may have
- // been added by the OptionsPage.
+ // been added by the PageManager.
page.pageDiv.hidden = false;
}
}
@@ -277,10 +277,10 @@ cr.define('options', function() {
// Toggle the search page if necessary.
if (text) {
if (!this.searchActive_)
- OptionsPage.showPageByName(this.name, false);
+ PageManager.showPageByName(this.name, false);
} else {
if (this.searchActive_)
- OptionsPage.showPageByName(OptionsPage.getDefaultPage().name, false);
+ PageManager.showDefaultPage(false);
this.insideSetSearchText_ = false;
return;
@@ -492,9 +492,9 @@ cr.define('options', function() {
*/
getSearchablePages_: function() {
var name, page, pages = [];
- for (name in OptionsPage.registeredPages) {
+ for (name in PageManager.registeredPages) {
if (name != this.name) {
- page = OptionsPage.registeredPages[name];
+ page = PageManager.registeredPages[name];
if (!page.parentPage)
pages.push(page);
}
@@ -510,16 +510,16 @@ cr.define('options', function() {
*/
getSearchableSubPages_: function() {
var name, pageInfo, page, pages = [];
- for (name in OptionsPage.registeredPages) {
- page = OptionsPage.registeredPages[name];
+ for (name in PageManager.registeredPages) {
+ page = PageManager.registeredPages[name];
if (page.parentPage &&
page.associatedSection &&
!page.associatedSection.hidden) {
pages.push(page);
}
}
- for (name in OptionsPage.registeredOverlayPages) {
- page = OptionsPage.registeredOverlayPages[name];
+ for (name in PageManager.registeredOverlayPages) {
+ page = PageManager.registeredOverlayPages[name];
if (page.associatedSection &&
!page.associatedSection.hidden &&
page.pageDiv != undefined) {

Powered by Google App Engine
This is Rietveld 408576698