1// Copyright (c) 2013 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'use strict';
6
7/**
8 * @fileoverview QuadStackViewer controls the content and viewing angle a
9 * QuadStack.
10 */
11
12base.require('ui.quad_stack');
13
14base.exportTo('ui', function() {
15  /**
16   * @constructor
17   */
18  var QuadStackViewer = ui.define('quad-stack-viewer');
19
20  QuadStackViewer.prototype = {
21    __proto__: HTMLUnknownElement.prototype,
22
23    decorate: function() {
24      this.className = 'quad-stack-viewer';
25      this.scale_ = 0.25;
26
27      this.quadStack_ = new ui.QuadStack();
28      this.appendChild(this.quadStack_);
29
30      this.camera_ = new ui.Camera(this.quadStack_);
31    },
32
33    get quadStack() {
34      return this.quadStack_;
35    },
36
37    get scale() {
38      return this.scale_;
39    },
40
41    set scale(newValue) {
42      this.scale_ = newValue;
43      if (this.quadStack_.viewport)
44        this.quadStack_.viewport.scale = newValue;
45    },
46
47    get camera() {
48      return this.camera_;
49    }
50
51  };
52
53  return {
54    QuadStackViewer: QuadStackViewer
55  };
56});
57