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

Side by Side Diff: chrome/browser/resources/chromeos/oobe.js

Issue 7076014: [cros] Initial implementation for OOBE WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 cr.define('cr.ui', function() {
6
7 function Oobe() {
8 }
9
10 cr.addSingletonGetter(Oobe);
11
12 // State of the screen.
13 Oobe.SCREEN_LOADING = -1;
14 Oobe.SCREEN_NONE = 0,
15 Oobe.SCREEN_WELCOME = 1,
16 Oobe.SCREEN_EULA = 2;
17 Oobe.SCREEN_UPDATE = 3;
18
19 Oobe.localStrings_ = new LocalStrings();
20
21 Oobe.prototype = {
22 initialized_: false,
23 state_: Oobe.SCREEN_LOADING,
24
25 changeState_: function(screenInfo) {
26 var newState = screenInfo.state;
27 this.hideAll_();
28 switch(newState) {
29 case Oobe.SCREEN_LOADING:
30 break;
31 case Oobe.SCREEN_NONE:
32 break;
33 case Oobe.SCREEN_WELCOME:
34 $('welcome-screen').hidden = false;
35 break;
36 case Oobe.SCREEN_EULA:
37 $('eula-screen').hidden = false;
38 break;
39 case Oobe.SCREEN_UPDATE:
40 break;
41 }
42 this.state_ = newState;
43 },
44
45 hideAll_: function() {
46 $('welcome-screen').hidden = true;
47 $('eula-screen').hidden = true;
48 },
49 };
50
51 Oobe.initialize = function() {
52 this.initialized_ = true;
53
54 $('continue').addEventListener('click', function(event) {
55 // TODO
56 });
57 $('back').addEventListener('click', function(event) {
58 // TODO
59 });
60 $('accept').addEventListener('click', function(event) {
61 // TODO
62 });
63 chrome.send('screenStateInitialize');
64 };
65
66 Oobe.screenStateChanged = function(screenInfo) {
67 Oobe.getInstance().changeState_(screenInfo);
68 };
69
70 // Export
71 return {
72 Oobe: Oobe
73 };
74
75 });
76
77 var Oobe = cr.ui.Oobe;
78
79 document.addEventListener('DOMContentLoaded', cr.ui.Oobe.initialize);
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/oobe.html ('k') | chrome/browser/resources/options/options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698