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

Unified Diff: chrome/browser/resources/chromeos/first_run/app/main.js

Issue 169173007: CrOs first-run UI polished. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/chromeos/first_run/app/main.js
diff --git a/chrome/browser/resources/chromeos/first_run/app/main.js b/chrome/browser/resources/chromeos/first_run/app/main.js
index 5b7c1d14601ea2c938c5c3e35bdce075cdd5d6df..e1afc5b29d0d48d44043cfcf25a93a6e161ee597 100644
--- a/chrome/browser/resources/chromeos/first_run/app/main.js
+++ b/chrome/browser/resources/chromeos/first_run/app/main.js
@@ -2,17 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-/**
- * Global wallpaperManager reference useful for poking at from the console.
- */
-var wallpaperManager;
-
function init() {
+ var content = $('greeting');
chrome.firstRunPrivate.getLocalizedStrings(function(strings) {
loadTimeData.data = strings;
i18nTemplate.process(document, loadTimeData);
+ // Resizing and centering app's window.
+ var bounds = {};
+ bounds.width = content.offsetWidth;
+ bounds.height = content.offsetHeight;
+ bounds.left = Math.round(0.5 * (window.screen.availWidth - bounds.width));
Nikita (slow) 2014/02/18 10:36:21 nit: Is this RTL friendly?
+ bounds.top = Math.round(0.5 * (window.screen.availHeight - bounds.height));
+ appWindow.setBounds(bounds);
+ appWindow.show();
});
- var content = $('greeting');
var closeButton = content.getElementsByClassName('close-button')[0];
// Make close unfocusable by mouse.
closeButton.addEventListener('mousedown', function(e) {
« no previous file with comments | « chrome/browser/resources/chromeos/first_run/app/main.html ('k') | chrome/browser/resources/chromeos/first_run/app/style.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698