| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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 goog.provide('image.collections.extension.Controller'); | |
| 6 | |
| 7 goog.require('goog.events.EventHandler'); | |
| 8 goog.require('goog.events.EventTarget'); | |
| 9 | |
| 10 goog.scope(function() { | |
| 11 | |
| 12 | |
| 13 | |
| 14 /** | |
| 15 * A base class for all controller classes. Controllers connect UI of the | |
| 16 * 'Google Stars' Chrome extension (see go/stars for details) to backends | |
| 17 * (such as GWS, Chrome Sync etc.) Should not be instantiated by itself. | |
| 18 * Each derived controller should handle certain types of UI events | |
| 19 * (e.g. search requests, clustering requests etc.) | |
| 20 * | |
| 21 * @extends {goog.events.EventTarget} | |
| 22 * @constructor | |
| 23 */ | |
| 24 image.collections.extension.Controller = function() { | |
| 25 Controller.base(this, 'constructor'); | |
| 26 | |
| 27 /** @protected {!goog.events.EventHandler} */ | |
| 28 this.eventHandler = new goog.events.EventHandler(this); | |
| 29 this.registerDisposable(this.eventHandler); | |
| 30 }; | |
| 31 goog.inherits(image.collections.extension.Controller, goog.events.EventTarget); | |
| 32 var Controller = image.collections.extension.Controller; | |
| 33 | |
| 34 | |
| 35 /** | |
| 36 * Initializes the controller. By default, sets the parent event target | |
| 37 * (controllers communicate with UI by handling and dispatching events | |
| 38 * on this event target). | |
| 39 * @param {!goog.events.EventTarget} parentEventTarget | |
| 40 */ | |
| 41 Controller.prototype.initialize = function(parentEventTarget) { | |
| 42 this.setParentEventTarget(parentEventTarget); | |
| 43 }; | |
| 44 }); // goog.scope | |
| OLD | NEW |