When accessing chrome://settings/overlayName or chrome://help/channel-change-page,

uber.onContentFrameLoaded is mistakenly called *after* the overlay is opened. This function
always brings the navigation frame to the foreground, so it should be called before any overlay
might be opened. The overlay being opened will then cause the navigation frame to recede
into the background.

This was inadvertently broken in r287989 (issue 423533003).

BUG=401903
TBR=dbeam@chromium.org

Review URL: https://codereview.chromium.org/452113002

Cr-Commit-Position: refs/heads/master@{#288394}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288394 0039d316-1c4b-4281-b951-d872f2087c98
parent da4d4fb0
...@@ -22,6 +22,7 @@ function load() { ...@@ -22,6 +22,7 @@ function load() {
cr.ui.FocusManager.disableMouseFocusOnButtons(); cr.ui.FocusManager.disableMouseFocusOnButtons();
PageManager.addObserver(new uber.PageManagerObserver()); PageManager.addObserver(new uber.PageManagerObserver());
PageManager.initialize(HelpPage.getInstance()); PageManager.initialize(HelpPage.getInstance());
uber.onContentFrameLoaded();
var pageName = PageManager.getPageNameFromPath(); var pageName = PageManager.getPageNameFromPath();
// Still update history so that chrome://help/nonexistant redirects // Still update history so that chrome://help/nonexistant redirects
...@@ -29,8 +30,6 @@ function load() { ...@@ -29,8 +30,6 @@ function load() {
// will avoid adding the extra state. // will avoid adding the extra state.
var updateHistory = true; var updateHistory = true;
PageManager.showPageByName(pageName, updateHistory, {replaceState: true}); PageManager.showPageByName(pageName, updateHistory, {replaceState: true});
uber.onContentFrameLoaded();
} }
document.addEventListener('DOMContentLoaded', load); document.addEventListener('DOMContentLoaded', load);
......
...@@ -232,6 +232,7 @@ function load() { ...@@ -232,6 +232,7 @@ function load() {
OptionsPage.initialize(); OptionsPage.initialize();
PageManager.initialize(BrowserOptions.getInstance()); PageManager.initialize(BrowserOptions.getInstance());
PageManager.addObserver(new uber.PageManagerObserver()); PageManager.addObserver(new uber.PageManagerObserver());
uber.onContentFrameLoaded();
var pageName = PageManager.getPageNameFromPath(); var pageName = PageManager.getPageNameFromPath();
// Still update history so that chrome://settings/nonexistant redirects // Still update history so that chrome://settings/nonexistant redirects
...@@ -247,8 +248,6 @@ function load() { ...@@ -247,8 +248,6 @@ function load() {
}; };
} }
uber.onContentFrameLoaded();
window.setTimeout(function() { window.setTimeout(function() {
document.documentElement.classList.remove('loading'); document.documentElement.classList.remove('loading');
chrome.send('onFinishedLoadingOptions'); chrome.send('onFinishedLoadingOptions');
......
...@@ -26,8 +26,28 @@ GEN('#define MAYBE_testOpenBrowserOptions testOpenBrowserOptions'); ...@@ -26,8 +26,28 @@ GEN('#define MAYBE_testOpenBrowserOptions testOpenBrowserOptions');
GEN('#endif // defined(OS_MACOSX)'); GEN('#endif // defined(OS_MACOSX)');
TEST_F('BrowserOptionsWebUITest', 'MAYBE_testOpenBrowserOptions', function() { TEST_F('BrowserOptionsWebUITest', 'MAYBE_testOpenBrowserOptions', function() {
assertEquals(this.browsePreload, document.location.href); assertEquals(this.browsePreload, document.location.href);
expectFalse($('navigation').classList.contains('background'));
}); });
/**
* TestFixture for the uber page when the browser options page has an overlay.
* @extends {testing.Test}
* @constructor
*/
function BrowserOptionsOverlayWebUITest() {}
BrowserOptionsOverlayWebUITest.prototype = {
__proto__: testing.Test.prototype,
/** @override */
browsePreload: 'chrome://chrome/settings/autofill',
};
TEST_F('BrowserOptionsOverlayWebUITest', 'testNavigationInBackground',
function() {
assertEquals(this.browsePreload, document.location.href);
expectTrue($('navigation').classList.contains('background'));
});
/** /**
* @extends {testing.Test} * @extends {testing.Test}
...@@ -48,7 +68,6 @@ TEST_F('BrowserOptionsFrameWebUITest', 'testAdvancedSettingsHiddenByDefault', ...@@ -48,7 +68,6 @@ TEST_F('BrowserOptionsFrameWebUITest', 'testAdvancedSettingsHiddenByDefault',
expectTrue($('advanced-settings').hidden); expectTrue($('advanced-settings').hidden);
}); });
/** /**
* @extends {testing.Test} * @extends {testing.Test}
* @constructor * @constructor
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment