| <!DOCTYPE html> |
| <!-- |
| Copyright 2015 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. |
| --> |
| |
| <link rel="import" href="/core/scripting_controller.html"> |
| <link rel="import" href="/extras/tquery/filter.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tr.exportTo('tr.e.tquery', function() { |
| function FilterHasTitle(expected) { |
| tr.e.tquery.Filter.call(this); |
| this.expected = expected; |
| } |
| |
| FilterHasTitle.prototype = { |
| __proto__: tr.e.tquery.Filter.prototype, |
| |
| evaluate: function(context) { |
| return this.matchValue_(context.event.title, this.expected); |
| } |
| }; |
| tr.c.ScriptingObjectRegistry.register( |
| function(expected) { |
| var filter = new tr.e.tquery.FilterHasTitle(expected); |
| return filter; |
| }, |
| { |
| name: 'hasTitle' |
| } |
| ); |
| |
| return { |
| FilterHasTitle: FilterHasTitle |
| }; |
| }); |
| </script> |