diff options
author | Ben Murdoch <benm@google.com> | 2010-11-25 19:40:10 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-12-03 13:52:53 +0000 |
commit | 4a5e2dc747d50c653511c68ccb2cfbfb740bd5a7 (patch) | |
tree | 938665d93a11fe7a6d0124e3c1e020d1f9d3f947 /chrome/browser/resources | |
parent | 7c627d87728a355737862918d144f98f69406954 (diff) | |
download | external_chromium-4a5e2dc747d50c653511c68ccb2cfbfb740bd5a7.zip external_chromium-4a5e2dc747d50c653511c68ccb2cfbfb740bd5a7.tar.gz external_chromium-4a5e2dc747d50c653511c68ccb2cfbfb740bd5a7.tar.bz2 |
Merge Chromium at r66597: Initial merge by git.
Change-Id: I9639f8a997f90ec219573aa22a49f5dbde78cc7b
Diffstat (limited to 'chrome/browser/resources')
33 files changed, 677 insertions, 418 deletions
diff --git a/chrome/browser/resources/filebrowse.html b/chrome/browser/resources/filebrowse.html index 5c33205..5f465c5 100644 --- a/chrome/browser/resources/filebrowse.html +++ b/chrome/browser/resources/filebrowse.html @@ -1778,7 +1778,7 @@ function createNewList(title, results, main, path) { if (inFullMode) { divTitle.style['text-align'] = 'center'; } - divTitle.innerHTML = title; + divTitle.innerText = title; if (inFullMode && (path.length != 0)) { var popOutButton = document.createElement('div'); popOutButton.innerHTML = '∏'; diff --git a/chrome/browser/resources/guest_session_tab.html b/chrome/browser/resources/guest_session_tab.html new file mode 100644 index 0000000..06a99be --- /dev/null +++ b/chrome/browser/resources/guest_session_tab.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html i18n-values="dir:textdirection;"> +<head> +<title i18n-content="title"></title> +<link rel="stylesheet" href="incognito_tab.css"> +<script> +// Until themes can clear the cache, force-reload the theme stylesheet. +document.write('<link id="incognitothemecss" rel="stylesheet" ' + + 'href="chrome://theme/css/newincognitotab.css?' + + Date.now() + '">'); +</script> +</head> +<body> +<div class="content" i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> + <img src="shared/images/guest_icon_standalone.png" class="icon" /> + <span i18n-values=".innerHTML:content"></span> +</div> +</body> +<script> +function themeChanged() { + document.getElementById('incognitothemecss').href = + 'chrome://theme/css/newincognitotab.css?' + Date.now(); +} +</script> +</html> diff --git a/chrome/browser/resources/incognito_tab.css b/chrome/browser/resources/incognito_tab.css new file mode 100644 index 0000000..154f727 --- /dev/null +++ b/chrome/browser/resources/incognito_tab.css @@ -0,0 +1,35 @@ +body { + margin: 10px 8px; +} +html[dir="ltr"] .icon { + float: right; + margin: 0 6px 0 3px; + -webkit-transform: scale(-1, 1); +} +html[dir="rtl"] .icon { + float: left; + margin: 0 3px 0 6px; +} +.content { + border-radius: 5px 5px; + background-color: #eee; + color: black; + padding: 10px; + max-width: 600px; + margin-left: auto; + margin-right: auto; + margin-top: 66px; +} +.extensionsmessage { + color: black; + padding: 10px; + max-width: 600px; + margin-left: auto; + margin-right: auto; + margin-top: 5px; +} +.extensionicon { + float: left; + margin: 10px 5px 0 0px; + width: 30px; +} diff --git a/chrome/browser/resources/incognito_tab.html b/chrome/browser/resources/incognito_tab.html index 67846e5..03dad1d 100644 --- a/chrome/browser/resources/incognito_tab.html +++ b/chrome/browser/resources/incognito_tab.html @@ -2,43 +2,7 @@ <html i18n-values="dir:textdirection;bookmarkbarattached:bookmarkbarattached"> <head> <title i18n-content="title"></title> -<style> -body { - margin:10px 8px 10px 8px; -} -html[dir="ltr"] .icon { - float:right; - margin:0 6px 0 3px; - -webkit-transform: scale(-1, 1); -} -html[dir="rtl"] .icon { - float:left; - margin:0 3px 0 6px; -} -.content { - border-radius: 5px 5px; - background-color:#eee; - color:black; - padding:10px 10px 10px 10px; - max-width:600px; - margin-left:auto; - margin-right:auto; - margin-top:66px; -} -.extensionsmessage { - color:black; - padding:10px 10px 10px 10px; - max-width:600px; - margin-left:auto; - margin-right:auto; - margin-top:5px; -} -.extensionicon { - float:left; - margin:10px 5px 0 0px; - width:30px; -} -</style> +<link rel="stylesheet" href="incognito_tab.css"> <script> // Until themes can clear the cache, force-reload the theme stylesheet. document.write('<link id="incognitothemecss" rel="stylesheet" ' + diff --git a/chrome/browser/resources/mobile_setup.html b/chrome/browser/resources/mobile_setup.html index eba150e..278938d 100644 --- a/chrome/browser/resources/mobile_setup.html +++ b/chrome/browser/resources/mobile_setup.html @@ -58,30 +58,17 @@ iframe { .logo { background: url('file:///usr/share/chromeos-assets/mobile/carrier_logo.png') no-repeat; + background-position: center; height: 58px; + margin-bottom: 20px; + margin-top: 20px; } #errorMessage { margin: 20px; } -.box { - display: -webkit-box; -} - -#finalLogo { - position: absolute; - right: 130px; - width: 150px; -} - -#activationLogo { - background-position: center; - margin-bottom: 20px; - margin-top: 20px; -} - -#splitter { +.splitter { margin-top: 10px; left: 50%; margin-left: 150px; @@ -100,6 +87,25 @@ iframe { top: 0; } +#finalMessage { + padding-bottom: 50px; +} + +.action-area { + -webkit-box-orient: horizontal; + -webkit-box-align: center; + padding: 12px; + position: absolute; + right: 0px; + bottom: 0px; + display: -webkit-box; +} + +.button-strip { + -webkit-box-orient: horizontal; + display: -webkit-box; +} + </style> <script src="chrome://resources/js/cr.js"></script> <script src="chrome://resources/js/local_strings.js"></script> @@ -109,24 +115,26 @@ iframe { <body onload="mobile.MobileSetup.loadPage();" i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> <iframe class="hidden" id="paymentForm" frameborder="0"></iframe> - <div id="systemStatus" class="startup hidden"> - <div><h3 id="statusHeader"></h3></div> - <div id="errorMessage"></div> - <canvas id="canvas" width="56" height="56"></canvas> - <div id="splitter"></div> - <div id="activationLogo" class="logo"></div> + <div id="systemStatus" class="overlay hidden"> + <div class="startup"> + <div><h3 id="statusHeader"></h3></div> + <div id="errorMessage"></div> + <canvas id="canvas" width="56" height="56"></canvas> + <div class="splitter"></div> + <div class="logo"></div> + </div> </div> <div id="finalMessage" class="overlay hidden"> - <div class="box"> - <div> - <div class="header"><h3 i18n-content="completed_header"></h3></div> - <div id="action" i18n-content="completed_text"></div> + <div class="startup"> + <div class="header"><h3 i18n-content="completed_header"></h3></div> + <div i18n-content="completed_text"></div> + <div class="splitter"></div> + <div class="logo"></div> + <div class="action-area button-strip"> + <button id="closeButton" + i18n-content="close_button"></button> </div> - <div id="finalLogo" class="logo"></div> </div> </div> - <div class="testing-only"> - <button id="cheat">Fake activation!</button> - </div> </body> </html> diff --git a/chrome/browser/resources/mobile_setup.js b/chrome/browser/resources/mobile_setup.js index 16b02cf..eb67b9a 100644 --- a/chrome/browser/resources/mobile_setup.js +++ b/chrome/browser/resources/mobile_setup.js @@ -46,13 +46,8 @@ cr.define('mobile', function() { window.addEventListener('message', function(e) { self.onMessageReceived_(e); }); - $('cheat').addEventListener('click', function(e) { - console.log('calling setTransactionStatus from cheat.onclick'); - if (self.faked_transaction_) - return; - $('paymentForm').classList.add('hidden'); - chrome.send('setTransactionStatus', ['OK']); - self.faked_transaction_ = true; + $('closeButton').addEventListener('click', function(e) { + $('finalMessage').classList.add('hidden'); }); $(frame_name).addEventListener('load', function(e) { // Flip the visibility of the payment page only after the frame is @@ -62,6 +57,7 @@ cr.define('mobile', function() { $('finalMessage').classList.add('hidden'); $('errorMessage').classList.add('hidden'); $('systemStatus').classList.add('hidden'); + $('canvas').classList.add('hidden'); $('paymentForm').classList.remove('hidden'); } }); @@ -104,6 +100,7 @@ cr.define('mobile', function() { switch(new_state) { case MobileSetup.PLAN_ACTIVATION_LOADING: case MobileSetup.PLAN_ACTIVATION_START: + case MobileSetup.PLAN_ACTIVATION_RECONNECTING: $('statusHeader').textContent = MobileSetup.localStrings_.getString('connecting_header'); $('errorMessage').textContent = ''; @@ -111,9 +108,9 @@ cr.define('mobile', function() { $('finalMessage').classList.add('hidden'); $('errorMessage').classList.add('hidden'); $('systemStatus').classList.remove('hidden'); + $('canvas').classList.remove('hidden'); break; case MobileSetup.PLAN_ACTIVATION_INITIATING_ACTIVATION: - case MobileSetup.PLAN_ACTIVATION_RECONNECTING: $('statusHeader').textContent = MobileSetup.localStrings_.getString('activating_header'); $('errorMessage').textContent = ''; @@ -121,18 +118,21 @@ cr.define('mobile', function() { $('finalMessage').classList.add('hidden'); $('errorMessage').classList.add('hidden'); $('systemStatus').classList.remove('hidden'); + $('canvas').classList.remove('hidden'); break; case MobileSetup.PLAN_ACTIVATION_SHOWING_PAYMENT: $('paymentForm').classList.add('hidden'); $('finalMessage').classList.add('hidden'); $('errorMessage').classList.add('hidden'); $('systemStatus').classList.remove('hidden'); + $('canvas').classList.remove('hidden'); this.loadPaymentFrame_(deviceInfo); break; case MobileSetup.PLAN_ACTIVATION_DONE: $('statusHeader').textContent = ''; $('errorMessage').classList.add('hidden'); $('systemStatus').classList.add('hidden'); + $('canvas').classList.add('hidden'); $('paymentForm').classList.remove('hidden'); $('finalMessage').classList.remove('hidden'); break; @@ -142,6 +142,7 @@ cr.define('mobile', function() { $('errorMessage').textContent = deviceInfo.error; $('paymentForm').classList.add('hidden'); $('finalMessage').classList.add('hidden'); + $('canvas').classList.add('hidden'); $('errorMessage').classList.remove('hidden'); $('systemStatus').classList.remove('hidden'); break; diff --git a/chrome/browser/resources/network_menu.js b/chrome/browser/resources/network_menu.js index 8413e99..19f40a6 100644 --- a/chrome/browser/resources/network_menu.js +++ b/chrome/browser/resources/network_menu.js @@ -31,13 +31,13 @@ const NetworkOther = 'other'; /** * Sends "connect" using the 'action' DOMUI message. */ -function sendConnect(index, passphrase, identity, remember) { +function sendConnect(index, passphrase, identity, auto_connect) { chrome.send('action', ['connect', String(index), passphrase, identity, - remember ? '1' : '0']); + auto_connect ? '1' : '0']); } var networkMenuItemProto = (function() { @@ -62,7 +62,7 @@ NetworkMenuItem.prototype = { ssidEdit: null, passwordEdit: null, - rememberCheckbox: null, + autoConnectCheckbox: null, /** * The label element. @@ -135,19 +135,18 @@ NetworkMenuItem.prototype = { sendConnect(index, this.passwordEdit.value, this.ssidEdit.value, - this.rememberCheckbox.checked); + this.autoConnectCheckbox.checked); } } else if (this.passwordEdit) { if (this.passwordEdit.value) { sendConnect(index, - this.passwordEdit.value, '', this.rememberCheckbox.checked); + this.passwordEdit.value, '', this.autoConnectCheckbox.checked); } } else { if (this.attrs.remembered) { - sendConnect(index, this.attrs.passphrase, '', - this.rememberCheckbox.checked); + sendConnect(index, this.attrs.passphrase, '', this.attrs.auto_connect); } else { - sendConnect(index, '', '', this.rememberCheckbox.checked); + sendConnect(index, '', '', this.autoConnectCheckbox.checked); } } }, @@ -230,22 +229,23 @@ NetworkMenuItem.prototype = { }, /** - * Add remember this network check box to action area. + * Add auto-connect this network check box to action area. * @private */ - addRememberCheckbox_: function() { - this.rememberCheckbox = this.ownerDocument.createElement('input'); - this.rememberCheckbox.type = 'checkbox'; - this.rememberCheckbox.checked = this.attrs.remembered; + addAutoConnectCheckbox_: function() { + this.autoConnectCheckbox = this.ownerDocument.createElement('input'); + this.autoConnectCheckbox.type = 'checkbox'; + this.autoConnectCheckbox.checked = this.attrs.auto_connect; - var rememberSpan = this.ownerDocument.createElement('span'); - rememberSpan.textContent = localStrings.getString('remeber_this_network'); + var autoConnectSpan = this.ownerDocument.createElement('span'); + autoConnectSpan.textContent = + localStrings.getString('auto_connect_this_network'); - var rememberLabel = this.ownerDocument.createElement('label'); - rememberLabel.appendChild(this.rememberCheckbox); - rememberLabel.appendChild(rememberSpan); + var autoConnectLabel = this.ownerDocument.createElement('label'); + autoConnectLabel.appendChild(this.autoConnectCheckbox); + autoConnectLabel.appendChild(autoConnectSpan); - this.action_.appendChild(rememberLabel); + this.action_.appendChild(autoConnectLabel); }, /** @@ -266,7 +266,7 @@ NetworkMenuItem.prototype = { if (attrs.network_type == NetworkOther) { this.addSsidEdit_(); this.addPasswordEdit_(); - this.addRememberCheckbox_(); + this.addAutoConnectCheckbox_(); } else if (attrs.status && attrs.status != 'unknown') { if (attrs.status == StatusConnected) { this.setStatus_(attrs.ip_address); @@ -293,7 +293,7 @@ NetworkMenuItem.prototype = { this.addPasswordEdit_(); } - this.addRememberCheckbox_(); + this.addAutoConnectCheckbox_(); } //////// End NetworkMenuItem specifi code @@ -346,10 +346,10 @@ NetworkMenu.prototype = { /** @inheritDoc */ onClick_: function(event, item) { // If item is a NetworkMenuItem, it must have at least one of the following. - if (item.rememberCheckbox || item.ssidEdit || item.passwordEdit) { + if (item.autoConnectCheckbox || item.ssidEdit || item.passwordEdit) { // Ignore clicks other than on the NetworkMenuItem itself. - if (event.target == item.rememberCheckbox || - event.target == item.rememberCheckbox.nextElementSibling || + if (event.target == item.autoConnectCheckbox || + event.target == item.autoConnectCheckbox.nextElementSibling || event.target == item.ssidEdit || event.target == item.passwordEdit) { return; diff --git a/chrome/browser/resources/new_new_tab.css b/chrome/browser/resources/new_new_tab.css index fca01f6..258aebf 100644 --- a/chrome/browser/resources/new_new_tab.css +++ b/chrome/browser/resources/new_new_tab.css @@ -30,7 +30,9 @@ body.loading #main { #main, .section, -.maxiview { +.maxiview, +#login-container, +#notification-container { width: 920px; } @@ -73,6 +75,10 @@ html[anim=false] *, /* Notification */ +#notification-container { + position: fixed; +} + #notification { position: relative; background-color: hsl(52, 100%, 80%); @@ -81,10 +87,7 @@ html[anim=false] *, padding: 7px 15px; white-space: nowrap; display: table; - /* Set the height and margin so that the element does not use any vertical - space */ - height: 16px; - margin: -44px auto 12px auto; + margin: 2px auto; font-weight: bold; opacity: 0; pointer-events: none; @@ -312,8 +315,8 @@ html[anim=true][enable-section-animations=true] .section { #login-container { display: none; - height: 0; /* This should not take any vertical space and this simpler than - position absolute which changes the width to intrinsic */ + margin-top: 5px; + position: fixed; text-align: end; } @@ -494,7 +497,9 @@ html[anim=true] .maxiview { #main, .section, - .maxiview { + .maxiview, + #login-container, + #notification-container { width: 692px; } diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index db64c26..001c378 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -128,9 +128,11 @@ if ('mode' in hashParams) { <div id="main"> - <div id="notification"> - <span> </span> - <span class="link"><span class="link-color"></span></span> + <div id="notification-container"> + <div id="notification"> + <span> </span> + <span class="link"><span class="link-color"></span></span> + </div> </div> <div id="login-container"> diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js index 6b3be4a..89deeef 100644 --- a/chrome/browser/resources/new_new_tab.js +++ b/chrome/browser/resources/new_new_tab.js @@ -1206,7 +1206,10 @@ function isDoneLoading() { document.addEventListener('DOMContentLoaded', function() { var promoText1 = $('apps-promo-text1'); promoText1.innerHTML = promoText1.textContent; - promoText1.querySelector('a').href = localStrings.getString('web_store_url'); + + var promoLink = promoText1.querySelector('a'); + promoLink.id = 'apps-promo-link'; + promoLink.href = localStrings.getString('web_store_url'); $('apps-promo-hide').addEventListener('click', function() { chrome.send('hideAppsPromo', []); diff --git a/chrome/browser/resources/ntp/apps.js b/chrome/browser/resources/ntp/apps.js index 81d7eb0..7069231 100644 --- a/chrome/browser/resources/ntp/apps.js +++ b/chrome/browser/resources/ntp/apps.js @@ -6,19 +6,28 @@ var MAX_APPS_PER_ROW = []; MAX_APPS_PER_ROW[LayoutMode.SMALL] = 4; MAX_APPS_PER_ROW[LayoutMode.NORMAL] = 6; +// The URL prefix used in the app link 'ping' attributes. +var PING_APP_LAUNCH_PREFIX = 'record-app-launch'; + +// The URL prefix used in the webstore link 'ping' attributes. +var PING_WEBSTORE_LAUNCH_PREFIX = 'record-webstore-launch'; + function getAppsCallback(data) { logEvent('received apps'); var appsSection = $('apps'); var appsSectionContent = $('apps-content'); var appsMiniview = appsSection.getElementsByClassName('miniview')[0]; var appsPromo = $('apps-promo'); + var appsPromoPing = PING_WEBSTORE_LAUNCH_PREFIX + '+' + data.showPromo; var webStoreEntry; appsMiniview.textContent = ''; appsSectionContent.textContent = ''; + apps.showPromo = data.showPromo; + data.apps.sort(function(a,b) { - return a.app_launch_index - b.app_launch_index + return a.app_launch_index - b.app_launch_index; }); clearClosedMenu(apps.menu); @@ -31,6 +40,7 @@ function getAppsCallback(data) { }); webStoreEntry = apps.createWebStoreElement(); + webStoreEntry.querySelector('a').setAttribute('ping', appsPromoPing); appsSectionContent.appendChild(webStoreEntry); data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) { @@ -49,6 +59,7 @@ function getAppsCallback(data) { document.documentElement.classList.add('apps-promo-visible'); else document.documentElement.classList.remove('apps-promo-visible'); + $('apps-promo-link').setAttribute('ping', appsPromoPing); maybeDoneLoading(); if (data.apps.length > 0 && isDoneLoading()) { @@ -227,11 +238,14 @@ var apps = (function() { menu: $('apps-menu'), + showPromo: false, + createElement: function(app) { var div = createElement(app); var a = div.firstChild; a.onclick = handleClick; + a.setAttribute('ping', PING_APP_LAUNCH_PREFIX + '+' + this.showPromo); a.style.backgroundImage = url(app['icon_big']); if (hashParams['app-id'] == app['id']) { div.setAttribute('new', 'new'); @@ -271,6 +285,7 @@ var apps = (function() { a.textContent = app['name']; a.href = app['launch_url']; a.onclick = handleClick; + a.setAttribute('ping', PING_APP_LAUNCH_PREFIX + '+' + this.showPromo); a.style.backgroundImage = url(app['icon_small']); a.className = 'item'; span.appendChild(a); @@ -286,6 +301,7 @@ var apps = (function() { a.textContent = app['name']; a.href = app['launch_url']; a.onclick = handleClick; + a.setAttribute('ping', PING_APP_LAUNCH_PREFIX + '+' + this.showPromo); a.style.backgroundImage = url(app['icon_small']); a.className = 'item'; return a; diff --git a/chrome/browser/resources/options.html b/chrome/browser/resources/options.html index f28de4f..4efe084 100644 --- a/chrome/browser/resources/options.html +++ b/chrome/browser/resources/options.html @@ -162,23 +162,54 @@ function load() { localStrings = new LocalStrings(); if (cr.isChromeOS) { - OptionsPage.registerSubPage(AboutPage.getInstance()); OptionsPage.register(SystemOptions.getInstance()); + OptionsPage.registerSubPage(AboutPage.getInstance(), + SystemOptions.getInstance()); + OptionsPage.registerSubPage(LanguageOptions.getInstance(), + SystemOptions.getInstance()); + OptionsPage.registerSubPage( + new OptionsPage('languageChewing', + localStrings.getString('languageChewingPage'), + 'languageChewingPage'), + SystemOptions.getInstance()); + OptionsPage.registerSubPage( + new OptionsPage('languageHangul', + localStrings.getString('languageHangulPage'), + 'languageHangulPage'), + SystemOptions.getInstance()); + OptionsPage.registerSubPage( + new OptionsPage('languageMozc', + localStrings.getString('languageMozcPage'), + 'languageMozcPage'), + SystemOptions.getInstance()); + OptionsPage.registerSubPage( + new OptionsPage('languagePinyin', + localStrings.getString('languagePinyinPage'), + 'languagePinyinPage'), + SystemOptions.getInstance()); OptionsPage.register(InternetOptions.getInstance()); } OptionsPage.register(BrowserOptions.getInstance()); + OptionsPage.registerSubPage(SearchEngineManager.getInstance(), + BrowserOptions.getInstance()); OptionsPage.register(PersonalOptions.getInstance()); + OptionsPage.registerSubPage(AutoFillOptions.getInstance(), + PersonalOptions.getInstance()); + OptionsPage.registerSubPage(PasswordsExceptions.getInstance(), + PersonalOptions.getInstance()); + OptionsPage.registerSubPage(SyncOptions.getInstance(), + PersonalOptions.getInstance()); OptionsPage.register(AdvancedOptions.getInstance()); - OptionsPage.registerSubPage(AutoFillOptions.getInstance()); - OptionsPage.registerSubPage(ContentSettings.getInstance()); - OptionsPage.registerSubPage(CookiesView.getInstance()); - OptionsPage.registerSubPage(FontSettings.getInstance()); - OptionsPage.registerSubPage(PasswordsExceptions.getInstance()); - OptionsPage.registerSubPage(SearchEngineManager.getInstance()); - OptionsPage.registerSubPage(SyncOptions.getInstance()); + OptionsPage.registerSubPage(ContentSettings.getInstance(), + AdvancedOptions.getInstance()); + OptionsPage.registerSubPage(CookiesView.getInstance(), + AdvancedOptions.getInstance()); + OptionsPage.registerSubPage(FontSettings.getInstance(), + AdvancedOptions.getInstance()); if (!cr.isWindows && !cr.isMac) { - OptionsPage.registerSubPage(CertificateManager.getInstance()); + OptionsPage.registerSubPage(CertificateManager.getInstance(), + AdvancedOptions.getInstance()); OptionsPage.registerOverlay(CertificateRestoreOverlay.getInstance()); OptionsPage.registerOverlay(CertificateBackupOverlay.getInstance()); OptionsPage.registerOverlay(CertificateEditCaTrustOverlay.getInstance()); @@ -195,28 +226,8 @@ function load() { if (cr.isChromeOS) { OptionsPage.register(AccountsOptions.getInstance()); - var labsOptions = new OptionsPage('labs', - localStrings.getString('labsPage'), - 'labsPage'); - OptionsPage.register(labsOptions); - OptionsPage.registerSubPage(LanguageOptions.getInstance()); - OptionsPage.registerSubPage(new OptionsPage( - 'languageChewing', - localStrings.getString('languageChewingPage'), - 'languageChewingPage')); - OptionsPage.registerSubPage(new OptionsPage( - 'languageHangul', - localStrings.getString('languageHangulPage'), - 'languageHangulPage')); - OptionsPage.registerSubPage(new OptionsPage( - 'languageMozc', - localStrings.getString('languageMozcPage'), - 'languageMozcPage')); - OptionsPage.registerSubPage(new OptionsPage( - 'languagePinyin', - localStrings.getString('languagePinyinPage'), - 'languagePinyinPage')); - OptionsPage.registerSubPage(ProxyOptions.getInstance()); + OptionsPage.registerSubPage(ProxyOptions.getInstance(), + InternetOptions.getInstance()); OptionsPage.registerOverlay(new OptionsPage( 'detailsInternetPage', 'detailsInternetPage', @@ -305,9 +316,6 @@ window.onpopstate = function(e) { <h1 id="settings-title" i18n-content="title"></h1> <ul id="navbar"> </ul> - <hr/> - <ul id="subpagesnav"> - </ul> </div> <div id="mainview"> <div class="hidden" id="managed-prefs-banner"> @@ -317,31 +325,36 @@ window.onpopstate = function(e) { </div> <div id="mainview-content"> <if expr="pp_ifdef('chromeos')"> - <include src="options/about_page.html"> <include src="options/chromeos_system_options.html"> <include src="options/chromeos_internet_options.html"> - <include src="options/chromeos_language_options.html"> - <include src="options/chromeos_language_chewing_options.html"> - <include src="options/chromeos_language_hangul_options.html"> - <include src="options/chromeos_language_mozc_options.html"> - <include src="options/chromeos_language_pinyin_options.html"> - <include src="options/chromeos_labs.html"> <include src="options/chromeos_accounts_options.html"> - <include src="options/chromeos_proxy.html"> - </if> - <if expr="not pp_ifdef('win32') and not pp_ifdef('darwin')"> - <include src="options/certificate_manager.html"> </if> <include src="options/advanced_options.html"> - <include src="options/autofill_options.html"> <include src="options/browser_options.html"> - <include src="options/content_settings.html"> - <include src="options/cookies_view.html"> - <include src="options/font_settings.html"> - <include src="options/passwords_exceptions.html"> <include src="options/personal_options.html"> - <include src="options/search_engine_manager.html"> - <include src="options/sync_options.html"> + <div id="subpage-sheet-container" class="hidden"> + <div id="subpage-sheet"> + <if expr="pp_ifdef('chromeos')"> + <include src="options/about_page.html"> + <include src="options/chromeos_language_options.html"> + <include src="options/chromeos_language_chewing_options.html"> + <include src="options/chromeos_language_hangul_options.html"> + <include src="options/chromeos_language_mozc_options.html"> + <include src="options/chromeos_language_pinyin_options.html"> + <include src="options/chromeos_proxy.html"> + </if> + <if expr="not pp_ifdef('win32') and not pp_ifdef('darwin')"> + <include src="options/certificate_manager.html"> + </if> + <include src="options/autofill_options.html"> + <include src="options/content_settings.html"> + <include src="options/cookies_view.html"> + <include src="options/font_settings.html"> + <include src="options/passwords_exceptions.html"> + <include src="options/search_engine_manager.html"> + <include src="options/sync_options.html"> + </div> + </div> </div> </div> </div> diff --git a/chrome/browser/resources/options/about_page.html b/chrome/browser/resources/options/about_page.html index edcd1e9..d531815 100644 --- a/chrome/browser/resources/options/about_page.html +++ b/chrome/browser/resources/options/about_page.html @@ -25,6 +25,7 @@ <!-- <option value="release" i18n-content="release"></option> --> <option value="beta-channel" i18n-content="beta"></option> <option value="dev-channel" i18n-content="development"></option> + <option value="canary-channel" i18n-content="canary"></option> </select> </section> <section> diff --git a/chrome/browser/resources/options/advanced_options.html b/chrome/browser/resources/options/advanced_options.html index c317349..2ffe8d7 100644 --- a/chrome/browser/resources/options/advanced_options.html +++ b/chrome/browser/resources/options/advanced_options.html @@ -32,13 +32,19 @@ metric="Options_SafeBrowsingCheckbox" type="checkbox"> <span i18n-content="safeBrowsingEnableProtection"></span> </label> -<if expr="pp_ifdef('_google_chrome')"> +<if expr="pp_ifdef('_google_chrome') and pp_ifdef('chromeos')"> <label class="checkbox" id="metricsReportingSetting"> <input id="metricsReportingEnabled" pref="cros.metrics.reportingEnabled" type="checkbox"> <span i18n-content="enableLogging"></span> </label> </if> +<if expr="pp_ifdef('_google_chrome') and not pp_ifdef('chromeos')"> + <label class="checkbox" id="metricsReportingSetting"> + <input id="metricsReportingEnabled" type="checkbox"> + <span i18n-content="enableLogging"></span> + </label> +</if> </div> </section> <section> diff --git a/chrome/browser/resources/options/advanced_options.js b/chrome/browser/resources/options/advanced_options.js index db7cf1d..785e5ba 100644 --- a/chrome/browser/resources/options/advanced_options.js +++ b/chrome/browser/resources/options/advanced_options.js @@ -28,7 +28,7 @@ var OptionsPage = options.OptionsPage; // Call base class implementation to starts preference initialization. OptionsPage.prototype.initializePage.call(this); - // Setup click handlers for buttons. + // Set up click handlers for buttons. $('privacyContentSettingsButton').onclick = function(event) { OptionsPage.showPageByName('content'); OptionsPage.showTab($('cookies-nav-tab')); diff --git a/chrome/browser/resources/options/autofill_options.html b/chrome/browser/resources/options/autofill_options.html index fe357c5..6e1d7a9 100644 --- a/chrome/browser/resources/options/autofill_options.html +++ b/chrome/browser/resources/options/autofill_options.html @@ -1,9 +1,5 @@ <div class="page hidden" id="autoFillOptionsPage"> - <h1> - <span i18n-content="personalPage"></span> - > - <span i18n-content="autoFillOptionsTitle"></span> - </h1> + <h1 i18n-content="autoFillOptionsTitle"></h1> <div class="autofill-section"> <label class="checkbox"> @@ -38,7 +34,13 @@ </div> <div class="autofill-section"> +<if expr="pp_ifdef('chromeos')"> + <a href="http://www.google.com/support/chromeos/bin/answer.py?answer=142893" + target="_blank" i18n-content="helpButton"></a> +</if> +<if expr="not pp_ifdef('chromeos')"> <a href="http://www.google.com/support/chrome/bin/answer.py?answer=142893" - target=”_blank” i18n-content="helpButton"></a> + target="_blank" i18n-content="helpButton"></a> +</if> </div> </div> diff --git a/chrome/browser/resources/options/certificate_manager.html b/chrome/browser/resources/options/certificate_manager.html index 187c503..2f205c1 100644 --- a/chrome/browser/resources/options/certificate_manager.html +++ b/chrome/browser/resources/options/certificate_manager.html @@ -1,20 +1,32 @@ <div class="page hidden" id="certificateManagerPage"> - <h1> - <span i18n-content="advancedPage"></span> - > - <span i18n-content="certificateManagerPage"></span> - </h1> + <h1 i18n-content="certificateManagerPage"></h1> <!-- Navigation tabs --> <div class="subpages-nav-tabs"> - <span i18n-content="personalCertsTabTitle" id="personal-certs-nav-tab" - class="inactive-tab" tab-contents="personalCertsTab"></span><span - i18n-content="serverCertsTabTitle" id="server-certs-nav-tab" - class="inactive-tab" tab-contents="serverCertsTab"></span><span - i18n-content="caCertsTabTitle" id="ca-certs-nav-tab" - class="inactive-tab" tab-contents="caCertsTab"></span><span - i18n-content="unknownCertsTabTitle" id="other-certs-nav-tab" - class="inactive-tab" tab-contents="otherCertsTab"></span> + <span id="personal-certs-nav-tab" class="inactive-tab" + tab-contents="personalCertsTab"> + <span class="inactive-tab-label" + i18n-content="personalCertsTabTitle"></span> + <span class="active-tab-label" + i18n-content="personalCertsTabTitle"></span> + </span> + <span id="server-certs-nav-tab" class="inactive-tab" + tab-contents="serverCertsTab"> + <span class="inactive-tab-label" + i18n-content="serverCertsTabTitle"></span> + <span class="active-tab-label" i18n-content="serverCertsTabTitle"></span> + </span> + <span id="ca-certs-nav-tab" class="inactive-tab" + tab-contents="caCertsTab"> + <span class="inactive-tab-label" i18n-content="caCertsTabTitle"></span> + <span class="active-tab-label" i18n-content="caCertsTabTitle"></span> + </span> + <span id="other-certs-nav-tab" class="inactive-tab" + tab-contents="otherCertsTab"> + <span class="inactive-tab-label" + i18n-content="unknownCertsTabTitle"></span> + <span class="active-tab-label" i18n-content="unknownCertsTabTitle"></span> + </span> </div> <!-- TODO(mattm): get rid of use of tables? --> diff --git a/chrome/browser/resources/options/chromeos_internet_detail.html b/chrome/browser/resources/options/chromeos_internet_detail.html index 98c4b46..a6ddd4c 100644 --- a/chrome/browser/resources/options/chromeos_internet_detail.html +++ b/chrome/browser/resources/options/chromeos_internet_detail.html @@ -2,16 +2,35 @@ <h1 id="inetTitle"></h1> <!-- Navigation tabs --> <div class="subpages-nav-tabs" id="details-tab-strip"> - <span i18n-content="wifiNetworkTabLabel" id="wifiNetworkNavTab" - class="inactive-tab wifi-details" tab-contents="wifiNetworkTab"></span><span - i18n-content="cellularPlanTabLabel" id="cellularPlanNavTab" - class="inactive-tab cellular-details" tab-contents="cellularPlanTab"></span><span - i18n-content="cellularConnTabLabel" id="cellularConnNavTab" - class="inactive-tab cellular-details" tab-contents="cellularConnTab"></span><span - i18n-content="cellularDeviceTabLabel" id="cellularDeviceNavTab" - class="inactive-tab cellular-details" tab-contents="cellularDeviceTab"></span><span - i18n-content="networkTabLabel" id="internetNavTab" - class="inactive-tab" tab-contents="internetTab"></span> + <span id="wifiNetworkNavTab" class="inactive-tab wifi-details" + tab-contents="wifiNetworkTab"> + <span class="inactive-tab-label" + i18n-content="wifiNetworkTabLabel"></span> + <span class="active-tab-label" i18n-content="wifiNetworkTabLabel"></span> + </span> + <span id="cellularPlanNavTab" class="inactive-tab cellular-details" + tab-contents="cellularPlanTab"> + <span class="inactive-tab-label" + i18n-content="cellularPlanTabLabel"></span> + <span class="active-tab-label" i18n-content="cellularPlanTabLabel"></span> + </span> + <span id="cellularConnNavTab" class="inactive-tab cellular-details" + tab-contents="cellularConnTab"> + <span class="inactive-tab-label" + i18n-content="cellularConnTabLabel"></span> + <span class="active-tab-label" i18n-content="cellularConnTabLabel"></span> + </span> + <span id="cellularDeviceNavTab" class="inactive-tab cellular-details" + tab-contents="cellularDeviceTab"> + <span class="inactive-tab-label" + i18n-content="cellularDeviceTabLabel"></span> + <span class="active-tab-label" + i18n-content="cellularDeviceTabLabel"></span> + </span> + <span id="internetNavTab" class="inactive-tab" tab-contents="internetTab"> + <span class="inactive-tab-label" i18n-content="networkTabLabel"></span> + <span class="active-tab-label" i18n-content="networkTabLabel"></span> + </span> </div> <div id="wifiNetworkTab" class="subpages-tab-contents wifi-details"> <section> @@ -23,8 +42,8 @@ <tr> <td colspan="2"> <label class="checkbox"> - <input id="rememberNetwork" type="checkbox"> - <span i18n-content="inetRememberNetwork"></span> + <input id="autoConnectNetwork" type="checkbox"> + <span i18n-content="inetAutoConnectNetwork"></span> </label> </td> </tr> diff --git a/chrome/browser/resources/options/chromeos_internet_network_element.js b/chrome/browser/resources/options/chromeos_internet_network_element.js index 7541f2b..175b7b0 100644 --- a/chrome/browser/resources/options/chromeos_internet_network_element.js +++ b/chrome/browser/resources/options/chromeos_internet_network_element.js @@ -57,7 +57,7 @@ cr.define('options.internet', function() { while (item && !item.data) { item = item.parentNode; } - if (item.connecting) + if (item.connecting || !item.connectable) return; if (item) { @@ -70,6 +70,7 @@ cr.define('options.internet', function() { if (this.childNodes[i] != item) this.childNodes[i].hidePassword(); } + InternetOptions.unlockUpdates(); // If clicked on other networks item. if (data && data.servicePath == '?') { item.showOtherLogin(); @@ -105,7 +106,8 @@ cr.define('options.internet', function() { iconURL: network[6], remembered: network[7], activation_state: network[8], - restricted: network[9] + restricted: network[9], + connectable: network[10] }; NetworkItem.decorate(el); return el; @@ -147,6 +149,7 @@ cr.define('options.internet', function() { decorate: function() { this.className = 'network-item'; this.connected = this.data.connected; + this.connectable = this.data.connectable; this.other = this.data.servicePath == '?'; this.id = this.data.servicePath; // textDiv holds icon, name and status text. @@ -254,6 +257,9 @@ cr.define('options.internet', function() { showPassword: function() { if (this.connecting) return; + + InternetOptions.lockUpdates(); + var passwordDiv = this.ownerDocument.createElement('div'); passwordDiv.className = 'network-password'; var passInput = this.ownerDocument.createElement('input'); @@ -317,6 +323,8 @@ cr.define('options.internet', function() { if (this.connecting) return; + InternetOptions.lockUpdates(); + var ssidDiv = this.ownerDocument.createElement('div'); ssidDiv.className = 'network-password'; var ssidInput = this.ownerDocument.createElement('input'); @@ -405,6 +413,9 @@ cr.define('options.internet', function() { }, handleLogin_: function(e) { + // The user has clicked on the Login button. It's now safe to + // unclock UI updates. + InternetOptions.unlockUpdates(); var el = e.target; var parent = el.parentNode; el.disabled = true; @@ -414,6 +425,8 @@ cr.define('options.internet', function() { }, handleOtherLogin_: function(e) { + // See comments in handleLogin_(). + InternetOptions.unlockUpdates(); var el = e.target; var parent = el.parentNode.parentNode; el.disabled = true; @@ -460,6 +473,12 @@ cr.define('options.internet', function() { */ cr.defineProperty(NetworkItem, 'other', cr.PropertyKind.BOOL_ATTR); + /** + * Whether the underlying network is connectable. + * @type {boolean} + */ + cr.defineProperty(NetworkItem, 'connectable', cr.PropertyKind.BOOL_ATTR); + return { NetworkElement: NetworkElement }; diff --git a/chrome/browser/resources/options/chromeos_internet_options.js b/chrome/browser/resources/options/chromeos_internet_options.js index b3105e5..94e45f1 100644 --- a/chrome/browser/resources/options/chromeos_internet_options.js +++ b/chrome/browser/resources/options/chromeos_internet_options.js @@ -29,7 +29,6 @@ cr.define('options', function() { * Calls base class implementation to starts preference initialization. */ initializePage: function() { - // Call base class implementation to starts preference initialization. OptionsPage.prototype.initializePage.call(this); options.internet.NetworkElement.decorate($('wiredList')); @@ -91,13 +90,18 @@ cr.define('options', function() { } }; + // Network status update will be blocked while typing in WEP password etc. + InternetOptions.updateLocked = false; + InternetOptions.updatePending = false; + InternetOptions.updataData = null; + InternetOptions.loginFromDetails = function () { var data = $('inetAddress').data; var servicePath = data.servicePath; - if (data.certinpkcs) { + if (data.certInPkcs) { chrome.send('loginToCertNetwork',[String(servicePath), String(data.certPath), - String(data.ident)]); + String($('inetIdentPkcs').value)]); } else { chrome.send('loginToCertNetwork',[String(servicePath), String($('inetCert').value), @@ -112,11 +116,15 @@ cr.define('options', function() { if (data.type == 2) { var newinfo = []; newinfo.push(data.servicePath); - newinfo.push($('rememberNetwork').checked ? "true" : "false"); + newinfo.push($('autoConnectNetwork').checked ? "true" : "false"); if (data.encrypted && data.certNeeded) { - newinfo.push($('inetIdent').value); - newinfo.push($('inetCert').value); - newinfo.push($('inetCertPass').value); + if (data.certInPkcs) { + newinfo.push($('inetIdentPkcs').value); + } else { + newinfo.push($('inetIdent').value); + newinfo.push($('inetCert').value); + newinfo.push($('inetCertPass').value); + } } chrome.send('setDetails', newinfo); } @@ -150,18 +158,37 @@ cr.define('options', function() { } }; + // Prevent clobbering of password input field. + InternetOptions.lockUpdates = function () { + InternetOptions.updateLocked = true; + }; + + InternetOptions.unlockUpdates = function () { + InternetOptions.updateLocked = false; + if (InternetOptions.updatePending) { + InternetOptions.refreshNetworkData(InternetOptions.updateData); + } + }; + // //Chrome callbacks // InternetOptions.refreshNetworkData = function (data) { - $('wiredList').load(data.wiredList); - $('wirelessList').load(data.wirelessList); - $('rememberedList').load(data.rememberedList); + if (InternetOptions.updateLocked) { + InternetOptions.updateData = data; + InternetOptions.updatePending = true; + } else { + $('wiredList').load(data.wiredList); + $('wirelessList').load(data.wirelessList); + $('rememberedList').load(data.rememberedList); - $('wiredSection').hidden = (data.wiredList.length == 0); - $('wirelessSection').hidden = (data.wirelessList.length == 0); - InternetOptions.setupAttributes(data); - $('rememberedSection').hidden = (data.rememberedList.length == 0); + $('wiredSection').hidden = (data.wiredList.length == 0); + $('wirelessSection').hidden = (data.wirelessList.length == 0); + InternetOptions.setupAttributes(data); + $('rememberedSection').hidden = (data.rememberedList.length == 0); + InternetOptions.updateData = null; + InternetOptions.updatePending = false; + } }; InternetOptions.updateCellularPlans = function (data) { @@ -216,7 +243,6 @@ cr.define('options', function() { } else { // This is most likely a transient state due to device still connecting. address.textContent = '?'; - address.data = null; $('inetSubnetAddress').textContent = '?'; $('inetGateway').textContent = '?'; $('inetDns').textContent = '?'; @@ -235,10 +261,10 @@ cr.define('options', function() { page.removeAttribute('cellular'); page.removeAttribute('gsm'); $('inetSsid').textContent = data.ssid; - $('rememberNetwork').checked = data.autoConnect; + $('autoConnectNetwork').checked = data.autoConnect; if (!AccountsOptions.currentUserIsOwner()) { // Disable this for guest non-Owners. - $('rememberNetwork').disabled = true; + $('autoConnectNetwork').disabled = true; } page.removeAttribute('password'); page.removeAttribute('cert'); diff --git a/chrome/browser/resources/options/chromeos_internet_options_page.css b/chrome/browser/resources/options/chromeos_internet_options_page.css index 9374dfa..a5c89b0 100644 --- a/chrome/browser/resources/options/chromeos_internet_options_page.css +++ b/chrome/browser/resources/options/chromeos_internet_options_page.css @@ -34,7 +34,7 @@ position: relative; } -.network-password > input, select { +.network-password > input, .network-password > select { width: 200px; } @@ -47,7 +47,7 @@ height: 35px; } -.network-item:hover { +.network-item[connectable]:hover { border-color: hsl(214, 91%, 85%); background-color: hsl(214, 91%, 97%); } diff --git a/chrome/browser/resources/options/chromeos_labs.html b/chrome/browser/resources/options/chromeos_labs.html deleted file mode 100644 index 56f6619..0000000 --- a/chrome/browser/resources/options/chromeos_labs.html +++ /dev/null @@ -1,47 +0,0 @@ -<div class="page hidden" id="labsPage"> - <h1 i18n-content="labsPage"></h1> - <section> - <h3 i18n-content="mediaplayer_title"></h3> - <div class="option"> - <table class="option-control-table"> - <tr> - <td class="option-name"> - <label class="checkbox"> - <input id="mediaplayer-check" pref="settings.labs.mediaplayer" - type="checkbox"> - <span i18n-content="mediaplayer"></span> - </label> - </td> - </tr> - </table> - </div> - </section> - <section> - <h3 i18n-content="advanced_file_title"></h3> - <div class="option"> - <table class="option-control-table"> - <tr> - <td class="option-name"> - <label class="checkbox"> - <input id="advanced-filesystem-check" - pref="settings.labs.advanced_filesystem" type="checkbox"> - <span i18n-content="advanced_filesystem"></span> - </label> - </td> - </tr> - </table> - </div> - </section> - <section> - <h3 i18n-content="side_tabs_title"></h3> - <div class="option"> - <table class="option-control-table"> - <tr> - <td class="option-name"><label><input id="side-tabs-check" - pref="tabs.use_vertical_tabs" type="checkbox"><span - i18n-content="side_tabs"></span></label></td> - </tr> - </table> - </div> - </section> -</div> diff --git a/chrome/browser/resources/options/chromeos_language_options.js b/chrome/browser/resources/options/chromeos_language_options.js index 6b322ab..af09401 100644 --- a/chrome/browser/resources/options/chromeos_language_options.js +++ b/chrome/browser/resources/options/chromeos_language_options.js @@ -63,7 +63,15 @@ cr.define('options', function() { // Set up add button. $('language-options-add-button').onclick = function(e) { - OptionsPage.showOverlay('addLanguageOverlay'); + // Add the language without showing the overlay if it's specified in + // the URL hash (ex. lang_add=ja). Used for automated testing. + var match = document.location.hash.match(/\blang_add=([\w-]+)/); + if (match) { + var addLanguageCode = match[1]; + $('language-options-list').addLanguage(addLanguageCode); + } else { + OptionsPage.showOverlay('addLanguageOverlay'); + } }; // Set up remove button. $('language-options-remove-button').addEventListener('click', @@ -375,8 +383,8 @@ cr.define('options', function() { * @private */ updateInputMethodList_: function(languageCode) { - // Give one of the checkboxes focus, if it's specified in the URL hash - // (ex. focus=mozc). Used for automated testing. + // Give one of the checkboxes or buttons focus, if it's specified in the + // URL hash (ex. focus=mozc). Used for automated testing. var focusInputMethodId = -1; var match = document.location.hash.match(/\bfocus=([\w:-]+)\b/); if (match) { @@ -399,6 +407,11 @@ cr.define('options', function() { label.style.display = 'none'; } } + if (focusInputMethodId == 'remove') { + $('language-options-remove-button').focus(); + } else if (focusInputMethodId == 'add') { + $('language-options-add-button').focus(); + } }, /** diff --git a/chrome/browser/resources/options/content_settings.html b/chrome/browser/resources/options/content_settings.html index 12640da..dc17ccd 100644 --- a/chrome/browser/resources/options/content_settings.html +++ b/chrome/browser/resources/options/content_settings.html @@ -1,26 +1,46 @@ <div class="page hidden" id="contentSettingsPage"> - <h1> - <span i18n-content="advancedPage"></span> - > - <span i18n-content="contentSettingsPage"></span> - </h1> + <h1 i18n-content="contentSettingsPage"></h1> <!-- Navigation tabs --> <div class="subpages-nav-tabs"> - <span i18n-content="cookies_tab_label" id="cookies-nav-tab" - class="inactive-tab" tab-contents="cookiesFilterTab"></span><span - i18n-content="images_tab_label" id="images-nav-tab" - class="inactive-tab" tab-contents="imagesFilterTab"></span><span - i18n-content="javascript_tab_label" id="javascript-nav-tab" - class="inactive-tab" tab-contents="javascriptFilterTab"></span><span - i18n-content="plugins_tab_label" id="plugins-nav-tab" - class="inactive-tab" tab-contents="pluginsFilterTab"></span><span - i18n-content="popups_tab_label" id="popups-nav-tab" - class="inactive-tab" tab-contents="popupsFilterTab"></span><span - i18n-content="location_tab_label" id="location-nav-tab" - class="inactive-tab" tab-contents="locationFilterTab"></span><span - i18n-content="notifications_tab_label" id="notifications-nav-tab" - class="inactive-tab" tab-contents="notificationsFilterTab"></span> + <span id="cookies-nav-tab" class="inactive-tab" + tab-contents="cookiesFilterTab"> + <span class="inactive-tab-label" i18n-content="cookies_tab_label"></span> + <span class="active-tab-label" i18n-content="cookies_tab_label"></span> + </span> + <span id="images-nav-tab" class="inactive-tab" + tab-contents="imagesFilterTab"> + <span class="inactive-tab-label" i18n-content="images_tab_label"></span> + <span class="active-tab-label" i18n-content="images_tab_label"></span> + </span> + <span id="javascript-nav-tab" class="inactive-tab" + tab-contents="javascriptFilterTab"> + <span class="inactive-tab-label" + i18n-content="javascript_tab_label"></span> + <span class="active-tab-label" i18n-content="javascript_tab_label"></span> + </span> + <span id="plugins-nav-tab" class="inactive-tab" + tab-contents="pluginsFilterTab"> + <span class="inactive-tab-label" i18n-content="plugins_tab_label"></span> + <span class="active-tab-label" i18n-content="plugins_tab_label"></span> + </span> + <span id="popups-nav-tab" class="inactive-tab" + tab-contents="popupsFilterTab"> + <span class="inactive-tab-label" i18n-content="popups_tab_label"></span> + <span class="active-tab-label" i18n-content="popups_tab_label"></span> + </span> + <span id="location-nav-tab" class="inactive-tab" + tab-contents="locationFilterTab"> + <span class="inactive-tab-label" i18n-content="location_tab_label"></span> + <span class="active-tab-label" i18n-content="location_tab_label"></span> + </span> + <span id="notifications-nav-tab" class="inactive-tab" + tab-contents="notificationsFilterTab"> + <span class="inactive-tab-label" + i18n-content="notifications_tab_label"></span> + <span class="active-tab-label" + i18n-content="notifications_tab_label"></span> + </span> </div> <!-- Cookie filter tab contents --> diff --git a/chrome/browser/resources/options/content_settings_exceptions_area.js b/chrome/browser/resources/options/content_settings_exceptions_area.js index 31abc1f..66dab83 100644 --- a/chrome/browser/resources/options/content_settings_exceptions_area.js +++ b/chrome/browser/resources/options/content_settings_exceptions_area.js @@ -281,6 +281,10 @@ cr.define('options.contentSettings', function() { select.classList.toggle('hidden'); var doc = this.ownerDocument; + var area = doc.querySelector('div[contentType=' + + listItem.contentType + '][mode=' + listItem.mode + ']'); + area.enableAddAndEditButtons(!editing); + if (editing) { this.setAttribute('editing', ''); cr.ui.limitInputWidth(input, this, 20); @@ -456,6 +460,7 @@ cr.define('options.contentSettings', function() { emptyException.setting = ''; self.exceptionsList.addException(emptyException); }; + this.addRow = addRow; var editRow = cr.doc.createElement('button'); editRow.textContent = templateData.editExceptionRow; @@ -509,12 +514,26 @@ cr.define('options.contentSettings', function() { */ updateButtonSensitivity: function() { var selectionSize = this.exceptionsList.selectedItems.length; - if (this.editRow) - this.editRow.disabled = selectionSize != 1; + if (this.addRow) + this.addRow.disabled = this.addAndEditButtonsDisabled; + if (this.editRow) { + this.editRow.disabled = selectionSize != 1 || + this.addAndEditButtonsDisabled; + } this.removeRow.disabled = selectionSize == 0; }, /** + * Manually toggle the enabled/disabled state for the add and edit buttons. + * They'll be disabled while another row is being edited. + * @param {boolean} + */ + enableAddAndEditButtons: function(enable) { + this.addAndEditButtonsDisabled = !enable; + this.updateButtonSensitivity(); + }, + + /** * Callback from the selection model. * @param {!cr.Event} ce Event with change info. * @private diff --git a/chrome/browser/resources/options/options_page.css b/chrome/browser/resources/options/options_page.css index 4aa545f..ee7fc8f 100644 --- a/chrome/browser/resources/options/options_page.css +++ b/chrome/browser/resources/options/options_page.css @@ -6,13 +6,13 @@ body { #settings-title { -webkit-padding-end: 24px; - padding-top: 16px; - padding-bottom: 34px; - text-align: end; - font-size: 125%; + color: #53637d; + font-size: 200%; font-weight: normal; - color: #53627d; margin: 0; + padding-bottom: 14px; + padding-top: 13px; + text-align: end; } #main-content { @@ -56,18 +56,18 @@ html[dir='rtl'] #close-overlay { } .action-area { + -webkit-box-orient: horizontal; + -webkit-box-align: center; padding: 12px; position: absolute; right: 0px; bottom: 0px; display: -webkit-box; - -webkit-box-orient: horizontal; - -webkit-box-align: center; } .button-strip { - display: -webkit-box; -webkit-box-orient: horizontal; + display: -webkit-box; } html[toolkit=views] .button-strip { @@ -75,18 +75,18 @@ html[toolkit=views] .button-strip { } .button-strip > button { - display: block; -webkit-margin-start: 4px; + display: block; } .overlay > div { + -webkit-box-shadow: 3px 3px 3px #666; background: white; border-radius: 5px; padding: 15px; border: 1px solid #666; padding-bottom: 50px; position: relative; - -webkit-box-shadow: 3px 3px 3px #666; } #navbar { @@ -108,12 +108,12 @@ html[toolkit=views] .button-strip { to(#d3d7db)); bottom: 0; cursor: pointer; + display: none; left: 0; position: fixed; top: 0; width: 250px; z-index: 2; - display: none; } html[dir='rtl'] #navbar-container { @@ -145,32 +145,28 @@ html[hide-menu=false] #navbar-container { width: 65%; } +#navbar-container > ul { + list-style-type: none; + margin: 0; + padding: 0; +} + .navbar-item, .navbar-item2 { + color: #426dc9; + display: block; + font-size: 105%; + outline: none; padding: 7px 0; - -webkit-padding-end: 24px; text-align: end; - display: block; - color: #426dc9; - outline:none; + -webkit-padding-end: 24px; } .navbar-item-selected { - background: -webkit-gradient(linear, - left top, - right top, - from(#eaeef3), - color-stop(0.95, #b4c8ea), - to(#9bacc5)); - font-weight: bold; + background: #bbcee9; + border-bottom: 1px solid #8faad9; + border-top: 1px solid #8faad9; color: black; -} - -html[dir='rtl'] .navbar-item-selected { - background: -webkit-gradient(linear, - right top, - left top, - from(white), - to(#d6def3)); + font-weight: bold; } .navbar-item-normal { @@ -194,8 +190,33 @@ html[hide-menu=true] #mainview { } #mainview-content { - width: 600px; + box-sizing: border-box; + min-height: 100%; padding: 0 24px; + position: relative; + width: 600px; +} + +#subpage-sheet-container { + box-sizing: border-box; + height: 100%; + padding: 8px; + -webkit-padding-start: 60px; + position: absolute; + top: 0; + left: 0; + width: 748px; +} + +#subpage-sheet { + -webkit-box-shadow: #666 0px 3px 5px; + background-color: white; + border: 1px solid #b8b8b8; + border-radius: 2px; + box-sizing: border-box; + min-height: 100%; + padding: 0px 20px; + width: 100%; } #managed-prefs-banner { @@ -219,11 +240,11 @@ html[hide-menu=true] #mainview { background-image: url("chrome://theme/IDR_WARNING"); background-repeat: no-repeat; background-position:center; + display: inline-block; padding: 5px; - width: 24px; height: 21px; - display: inline-block; vertical-align: middle; + width: 24px; } #managed-prefs-text { @@ -232,33 +253,37 @@ html[hide-menu=true] #mainview { .page > h1 { -webkit-padding-end: 24px; - padding-top: 1em; - padding-bottom: 1em; border-bottom: 1px solid #eeeeee; - -webkit-padding-start: 0; - font-size: 125%; - color: #54637f; + color: #53637d; + font-size: 200%; + font-weight: normal; margin: 0; + padding-bottom: 4px; + padding-top: 13px; +} + +#subpage-sheet .page > h1 { + padding-top: 7px; } section { - display: -webkit-box; -webkit-box-orient: horizontal; border-bottom: 1px solid #eeeeee; - margin-top: 1em; - margin-bottom: 1em; - padding-bottom: 0.5em; + display: -webkit-box; + margin-top: 17px; + padding-bottom: 20px; +} + +section:last-child { + border-bottom: none; } section > h3 { - width: 150px; - font-weight: normal; - -webkit-padding-start: 0; - vertical-align: middle; - margin: 0; - font-size: 100%; - padding-top: 2px; + font-size: 105%; font-weight: bold; + margin: 0; + vertical-align: middle; + width: 140px; } section > div:only-of-type { @@ -279,7 +304,7 @@ section > div:only-of-type { */ section > div:only-of-type label { display: block; - margin: 3px 0; + margin: 5px 0; } .hidden { @@ -345,10 +370,11 @@ html[dir=rtl].option-name { } .favicon-cell { + -webkit-padding-start: 20px; background-position: left; background-repeat: no-repeat; - -webkit-padding-start: 20px; } + html[dir=rtl] .favicon-cell { background-position: right; } diff --git a/chrome/browser/resources/options/options_page.js b/chrome/browser/resources/options/options_page.js index 4059117..af66889 100644 --- a/chrome/browser/resources/options/options_page.js +++ b/chrome/browser/resources/options/options_page.js @@ -27,8 +27,7 @@ cr.define('options', function() { OptionsPage.registeredPages_ = {}; /** - * Pages which are meant to have an entry in the nav, but - * not have a permanent entry. + * Pages which are nested under a main page. */ OptionsPage.registeredSubPages_ = {}; @@ -38,7 +37,7 @@ cr.define('options', function() { OptionsPage.registeredOverlayPages_ = {}; /** - * Shows a registered page. + * Shows a registered page. This handles both top-level pages and sub-pages. * @param {string} pageName Page name. */ OptionsPage.showPageByName = function(pageName) { @@ -46,6 +45,13 @@ cr.define('options', function() { var page = OptionsPage.registeredPages_[name]; page.visible = name == pageName; } + for (var name in OptionsPage.registeredSubPages_) { + var pageInfo = OptionsPage.registeredSubPages_[name]; + var match = name == pageName; + if (match) + pageInfo.parentPage.visible = true; + pageInfo.page.visible = match; + } }; /** @@ -55,7 +61,11 @@ cr.define('options', function() { * @param {string} hash The value of the hash component of the URL. */ OptionsPage.handleHashForPage = function(pageName, hash) { - OptionsPage.registeredPages_[pageName].handleHash(hash); + var page = OptionsPage.registeredPages_[pageName]; + if (!page) { + page = OptionsPage.registeredSubPages_[pageName].page; + } + page.handleHash(hash); }; /** @@ -90,11 +100,32 @@ cr.define('options', function() { }; /** + * Closes any currently-open subpage. + */ + OptionsPage.closeSubPage = function() { + for (var name in OptionsPage.registeredSubPages_) { + var pageInfo = OptionsPage.registeredSubPages_[name]; + if (pageInfo.page.visible) { + pageInfo.page.visible = false; + // Since the managed pref banner lives outside the overlay, and the + // parent is not changing visibility, update the banner explicitly. + pageInfo.parentPage.updateManagedBannerVisibility(); + } + } + }; + + /** * Shows the tab contents for the given navigation tab. * @param {!Element} tab The tab that the user clicked. */ OptionsPage.showTab = function(tab) { - if (!tab.classList.contains('inactive-tab')) + // Search parents until we find a tab, or the nav bar itself. This allows + // tabs to have child nodes, e.g. labels in separately-styled spans. + while (tab && !tab.classList.contains('subpages-nav-tabs') && + !tab.classList.contains('inactive-tab')) { + tab = tab.parentNode; + } + if (!tab || !tab.classList.contains('inactive-tab')) return; if (this.activeNavTab != null) { @@ -106,7 +137,7 @@ cr.define('options', function() { tab.classList.add('active-tab'); $(tab.getAttribute('tab-contents')).classList.add('active-tab-contents'); this.activeNavTab = tab; - } + }; /** * Registers new options page. @@ -140,17 +171,12 @@ cr.define('options', function() { * Registers a new Sub tab page. * @param {OptionsPage} page Page to register. */ - OptionsPage.registerSubPage = function(page) { - OptionsPage.registeredPages_[page.name] = page; - var pageNav = document.createElement('li'); - pageNav.id = page.name + 'PageNav'; - pageNav.className = 'navbar-item hidden'; - pageNav.setAttribute('pageName', page.name); - pageNav.textContent = page.title; - var subpagesnav = $('subpagesnav'); - subpagesnav.appendChild(pageNav); - page.tab = pageNav; - page.initializePage(); + OptionsPage.registerSubPage = function(subPage, parentPage) { + OptionsPage.registeredSubPages_[subPage.name] = { + page: subPage, parentPage: parentPage }; + subPage.tab = undefined; + subPage.isSubPageSheet = true; + subPage.initializePage(); }; /** @@ -181,6 +207,14 @@ cr.define('options', function() { */ OptionsPage.initialize = function() { chrome.send('coreOptionsInitialize'); + + // Set up the overlay sheet. Clicks on the visible part of the parent page + // should close the overlay, not fall through to the parent page. + $('subpage-sheet-container').onclick = function(event) { + if (!$('subpage-sheet').contains(event.target)) + OptionsPage.closeSubPage(); + event.stopPropagation(); + } }; OptionsPage.prototype = { @@ -197,7 +231,18 @@ cr.define('options', function() { setManagedBannerVisibility: function(visible) { this.managed = visible; if (this.visible) { - $('managed-prefs-banner').style.display = visible ? 'block' : 'none'; + this.updateManagedBannerVisibility(); + } + }, + + /** + * Updates managed banner visibility state. + */ + updateManagedBannerVisibility: function() { + if (this.managed) { + $('managed-prefs-banner').classList.remove('hidden'); + } else { + $('managed-prefs-banner').classList.add('hidden'); } }, @@ -218,37 +263,34 @@ cr.define('options', function() { return; if (visible) { - this.pageDiv.style.display = 'block'; + this.pageDiv.classList.remove('hidden'); if (this.isOverlay) { - var overlay = $('overlay'); - overlay.classList.remove('hidden'); + $('overlay').classList.remove('hidden'); document.addEventListener('keydown', OptionsPage.clearOverlaysOnEsc_); } else { - var banner = $('managed-prefs-banner'); - banner.style.display = this.managed ? 'block' : 'none'; + if (this.isSubPageSheet) + $('subpage-sheet-container').classList.remove('hidden'); + + this.updateManagedBannerVisibility(); // Recent webkit change no longer allows url change from "chrome://". - window.history.pushState({pageName: this.name}, - this.title); + window.history.pushState({pageName: this.name}, this.title); } if (this.tab) { this.tab.classList.add('navbar-item-selected'); - if (this.tab.parentNode && this.tab.parentNode.id == 'subpagesnav') - this.tab.classList.remove('hidden'); } } else { + this.pageDiv.classList.add('hidden'); if (this.isOverlay) { - var overlay = $('overlay'); - overlay.classList.add('hidden'); + $('overlay').classList.add('hidden'); document.removeEventListener('keydown', OptionsPage.clearOverlaysOnEsc_); + } else if (this.isSubPageSheet) { + $('subpage-sheet-container').classList.add('hidden'); } - this.pageDiv.style.display = 'none'; if (this.tab) { this.tab.classList.remove('navbar-item-selected'); - if (this.tab.parentNode && this.tab.parentNode.id == 'subpagesnav') - this.tab.classList.add('hidden'); } } diff --git a/chrome/browser/resources/options/passwords_exceptions.html b/chrome/browser/resources/options/passwords_exceptions.html index f45c263..c75f715 100644 --- a/chrome/browser/resources/options/passwords_exceptions.html +++ b/chrome/browser/resources/options/passwords_exceptions.html @@ -1,17 +1,20 @@ <div class="page hidden" id="passwordsExceptionsPage"> - <h1> - <span i18n-content="personalPage"></span> - > - <span i18n-content="savedPasswordsExceptionsTitle"></span> - </h1> + <h1 i18n-content="savedPasswordsExceptionsTitle"></h1> <!-- Navigation tabs --> <div class="subpages-nav-tabs"> - <span i18n-content="passwordsTabTitle" id="passwords-nav-tab" - class="inactive-tab" tab-contents="passwordsTab"></span> - <span i18n-content="passwordExceptionsTabTitle" - id="password-exceptions-nav-tab" - class="inactive-tab" tab-contents="passwordExceptionsTab"></span> + <span id="passwords-nav-tab" class="inactive-tab" + tab-contents="passwordsTab"> + <span class="inactive-tab-label" i18n-content="passwordsTabTitle"></span> + <span class="active-tab-label" i18n-content="passwordsTabTitle"></span> + </span> + <span id="password-exceptions-nav-tab" class="inactive-tab" + tab-contents="passwordExceptionsTab"> + <span class="inactive-tab-label" + i18n-content="passwordExceptionsTabTitle"></span> + <span class="active-tab-label" + i18n-content="passwordExceptionsTabTitle"></span> + </span> </div> <!-- Passwords tab contents --> diff --git a/chrome/browser/resources/options/personal_options.html b/chrome/browser/resources/options/personal_options.html index 5988915..440bbda 100644 --- a/chrome/browser/resources/options/personal_options.html +++ b/chrome/browser/resources/options/personal_options.html @@ -17,7 +17,7 @@ </div> </section> </if> - <section> + <section id="sync-section"> <h3 i18n-content="sync_section"></h3> <div> <div id="sync-status" class="section-text"></div> @@ -26,8 +26,8 @@ <button id="start-stop-sync"></button> <button id="customize-sync""></button> </div> - <button id="privacy-dashboard-link" class="link-button" - i18n-content="privacy_dashboard_link"></button> + <a href="https://www.google.com/dashboard" id="privacy-dashboard-link" + i18n-content="privacy_dashboard_link" target="_blank"></a> </div> </section> <section> @@ -74,7 +74,8 @@ i18n-content="themes_GTK_button"></button> <button id="themes_set_classic" i18n-content="themes_set_classic"></button> - <a i18n-content="themes_gallery" id="themes-gallery" href="#"></a> + <a id="themes-gallery" i18n-content="themes_gallery" + i18n-values="href:themes_gallery_url" target="_blank"></a> </div> <label class="radio"> <input name="decorations_radio" @@ -96,7 +97,8 @@ <h3 i18n-content="themes"></h3> <div> <button id="themes_reset" i18n-content="themes_reset"></button> - <a i18n-content="themes_gallery" id="themes-gallery" href="#"></a> + <a id="themes-gallery" i18n-content="themes_gallery" + i18n-values="href:themes_gallery_url" target="_blank"></a> </div> </section> </if> diff --git a/chrome/browser/resources/options/personal_options.js b/chrome/browser/resources/options/personal_options.js index cdc8958..58a5481 100644 --- a/chrome/browser/resources/options/personal_options.js +++ b/chrome/browser/resources/options/personal_options.js @@ -34,16 +34,18 @@ cr.define('options', function() { $('customize-sync').onclick = function(event) { OptionsPage.showPageByName('sync'); }; + $('sync-action-link').onclick = function(event) { + chrome.send('showSyncLoginDialog'); + }; $('start-stop-sync').onclick = function(event) { if (self.syncSetupCompleted) self.showStopSyncingOverlay_(); else - self.showSyncLoginDialog_(); + chrome.send('showSyncLoginDialog'); }; $('privacy-dashboard-link').onclick = function(event) { chrome.send('openPrivacyDashboardTabAndActivate'); }; - $('showpasswords').onclick = function(event) { PasswordsExceptions.load(); OptionsPage.showPageByName('passwordsExceptions'); @@ -51,7 +53,6 @@ cr.define('options', function() { chrome.send('coreOptionsUserMetricsAction', ['Options_ShowPasswordsExceptions']); }; - $('autofill_options').onclick = function(event) { OptionsPage.showPageByName('autoFillOptions'); chrome.send('coreOptionsUserMetricsAction', @@ -69,22 +70,15 @@ cr.define('options', function() { $('themes_GTK_button').onclick = function(event) { chrome.send('themesSetGTK'); }; - $('themes_set_classic').onclick = function(event) { chrome.send('themesReset'); }; - $('themes-gallery').onclick = function(event) { - chrome.send('themesGallery'); - } } if (cr.isMac || cr.isWindows || cr.isChromeOS) { $('themes_reset').onclick = function(event) { chrome.send('themesReset'); }; - $('themes-gallery').onclick = function(event) { - chrome.send('themesGallery'); - } } if (cr.isChromeOS) { @@ -101,12 +95,11 @@ cr.define('options', function() { function() { chrome.send('stopSyncing'); }); }, - showSyncLoginDialog_: function(event) { - chrome.send('showSyncLoginDialog'); - }, - setElementVisible_: function(element, visible) { - element.style.display = visible ? 'inline' : 'none'; + if (visible) + element.classList.remove('hidden'); + else + element.classList.add('hidden'); }, setElementClassSyncError_: function(element, visible) { @@ -185,6 +178,10 @@ cr.define('options', function() { $('themes_set_classic').disabled = !enabled; } }, + + hideSyncSection_: function() { + this.setElementVisible_($('sync-section'), false); + }, }; // Forward public APIs to private implementations. @@ -205,6 +202,7 @@ cr.define('options', function() { 'setCustomizeButtonLabel', 'setGtkThemeButtonEnabled', 'setClassicThemeButtonEnabled', + 'hideSyncSection', ].forEach(function(name) { PersonalOptions[name] = function(value) { PersonalOptions.getInstance()[name + '_'](value); diff --git a/chrome/browser/resources/options/search_engine_manager.html b/chrome/browser/resources/options/search_engine_manager.html index a936b7a..d058b6f 100644 --- a/chrome/browser/resources/options/search_engine_manager.html +++ b/chrome/browser/resources/options/search_engine_manager.html @@ -1,9 +1,5 @@ <div class="page hidden" id="searchEngineManagerPage"> - <h1> - <span i18n-content="browserPage"></span> - > - <span i18n-content="searchEngineManagerPage"></span> - </h1> + <h1 i18n-content="searchEngineManagerPage"></h1> <div class="left-side-table"> <div> <div id="searchEngineHeading"> diff --git a/chrome/browser/resources/options/subpages_tab_controls.css b/chrome/browser/resources/options/subpages_tab_controls.css index 273078a..cfefdcc 100644 --- a/chrome/browser/resources/options/subpages_tab_controls.css +++ b/chrome/browser/resources/options/subpages_tab_controls.css @@ -5,27 +5,57 @@ found in the LICENSE file. */ .subpages-nav-tabs .inactive-tab { - background: -webkit-gradient(linear, - left top, - left bottom, - from(white), - to(#f3f3f3)); + position: relative; padding: 4px 8px; } .subpages-nav-tabs .active-tab { + position: relative; background: white; - border: 1px solid #a0a0a0; - border-bottom: 1px solid white; + border: 1px solid #A0A0A0; /* light gray */ + border-bottom: 2px solid white; -webkit-border-top-left-radius: 3px; -webkit-border-top-right-radius: 3px; +} + +/* To avoid tabs changing size when they are clicked and their labels become + * bold, we actually put two labels inside each tab: an inactive label and an + * active label. Only one is visible at a time, but the bold label is used to + * size the tab even when it's not visible. This keeps the tab size constant. */ +.subpages-nav-tabs .active-tab-label { font-weight: bold; } +.subpages-nav-tabs .inactive-tab-label { + position: absolute; + top: 5px; + left: 9px; +} + +html[dir=rtl] .subpages-nav-tabs .inactive-tab-label { + right: 9px; +} + +.subpages-nav-tabs .active-tab-label, +.subpages-nav-tabs .active-tab .inactive-tab-label { + visibility: hidden; +} + +/* .inactive-tab is not removed when .active-tab is added, so we must + * override the hidden visibility above in the active tab case. */ +/* BUG(62409): rename .inactive-tab to help avoid this confusion */ +.subpages-nav-tabs .active-tab .active-tab-label { + visibility: visible; +} + .subpages-nav-tabs { padding: 4px; - border-bottom: 1px solid #A0A0A0; - background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(white), to(#F3F3F3)); + border-bottom: 1px solid #A0A0A0; /* light gray */ + background: -webkit-gradient(linear, + left top, + left bottom, + from(white), + to(#F3F3F3)); /* very light gray */ margin-bottom: 15px; } diff --git a/chrome/browser/resources/shared/images/guest_icon_standalone.png b/chrome/browser/resources/shared/images/guest_icon_standalone.png Binary files differnew file mode 100644 index 0000000..967e8b8 --- /dev/null +++ b/chrome/browser/resources/shared/images/guest_icon_standalone.png |