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

Unified Diff: chrome/browser/resources/new_profile.js

Issue 7275026: Revert 90820 - Multi-Profiles: New Profile Setup UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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
« no previous file with comments | « chrome/browser/resources/new_profile.html ('k') | chrome/browser/ui/webui/chrome_web_ui_data_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/new_profile.js
===================================================================
--- chrome/browser/resources/new_profile.js (revision 90826)
+++ chrome/browser/resources/new_profile.js (working copy)
@@ -1,73 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var gSelectedAvatarIconIndex = 0;
-
-///////////////////////////////////////////////////////////////////////////////
-// Helper functions
-function $(o) {return document.getElementById(o);}
-
-function load() {
- chrome.send('requestProfileInfo', []);
- updateLogo();
-}
-
-function onCreate() {
- chrome.send('create', [$('profile-name').value,
- String(gSelectedAvatarIconIndex)]);
-}
-
-function onCancel() {
- chrome.send('cancel', []);
-}
-
-function onAvatarClicked(index) {
- var menu = document.getElementById("avatar-menu");
- for (var i = 0; i < menu.childNodes.length; i++) {
- var button = menu.childNodes[i];
- if (i == index) {
- button.setAttribute("style", "background-color: #bbcee9");
- } else {
- button.setAttribute("style", "background-color: transparent");
- }
- }
- gSelectedAvatarIconIndex = index;
-}
-
-function updateLogo() {
- var imageId = 'IDR_PRODUCT_LOGO';
- if (document.documentElement.getAttribute('customlogo') == 'true')
- imageId = 'IDR_CUSTOM_PRODUCT_LOGO';
-
- $('logo-img').src = 'chrome://theme/' + imageId + '?' + Date.now();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Chrome callbacks:
-
-function setProfileInfo(profileName, profileIconIndex) {
- $('profile-name').value = profileName;
- onAvatarClicked(profileIconIndex);
-}
-
-function setDefaultAvatarImages(imageUrlList) {
- var menu = document.getElementById("avatar-menu");
- for (var i = 0; i < imageUrlList.length; i++) {
- var button = document.createElement("input");
- button.setAttribute("type", "image");
- button.setAttribute("class", "avatar-button");
- button.setAttribute("src", imageUrlList[i]);
- button.setAttribute("onclick", "onAvatarClicked(" + i + ")");
- menu.appendChild(button);
- }
-}
-
-// Add handlers to HTML elements.
-document.body.onload = load;
-$('create-button').onclick = function () { onCreate(''); };
-$('cancel-button').onclick = function () { onCancel(''); };
-$('profile-name-form').onsubmit = function () {
- onCreate('');
- return false;
-};
« no previous file with comments | « chrome/browser/resources/new_profile.html ('k') | chrome/browser/ui/webui/chrome_web_ui_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698