Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / print_preview / common / search_box.js
index 723174b..836bddb 100644 (file)
@@ -51,7 +51,7 @@ cr.define('print_preview', function() {
   SearchBox.prototype = {
     __proto__: print_preview.Component.prototype,
 
-    /** @param {string} query New query to set the search box's query to. */
+    /** @param {?string} query New query to set the search box's query to. */
     setQuery: function(query) {
       query = query || '';
       this.input_.value = query.trim();
@@ -66,14 +66,16 @@ cr.define('print_preview', function() {
     createDom: function() {
       this.setElementInternal(this.cloneTemplateInternal(
           'search-box-template'));
-      this.input_ = this.getChildElement('.search-box-input');
+      this.input_ = assertInstanceof(this.getChildElement('.search-box-input'),
+          HTMLInputElement);
       this.input_.setAttribute('placeholder', this.searchBoxPlaceholderText_);
     },
 
     /** @override */
     enterDocument: function() {
       print_preview.Component.prototype.enterDocument.call(this);
-      this.tracker.add(this.input_, 'input', this.onInputInput_.bind(this));
+      this.tracker.add(assert(this.input_), 'input',
+                       this.onInputInput_.bind(this));
     },
 
     /** @override */