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

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: ugh just no 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 a9eb34b5ab6811f89946576cc2b00661bb8af1f3..5706863c6818fad27a63095438ccad9d70ef4375 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_().
@@ -134,8 +135,7 @@ cr.define('options', function() {
/** @override */
initializePage: function() {
- // Call base class implementation to start preference initialization.
- OptionsPage.prototype.initializePage.call(this);
+ Page.prototype.initializePage.call(this);
this.searchField = $('search-field');
@@ -197,7 +197,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;
}
@@ -232,7 +232,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;
}
}
@@ -275,10 +275,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;
@@ -490,9 +490,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);
}
@@ -508,16 +508,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) {
« no previous file with comments | « chrome/browser/resources/options/search_engine_manager.js ('k') | chrome/browser/resources/options/settings_dialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698