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

Side by Side Diff: third_party/google_input_tools/src/chrome/os/floatingwindow/floatingwindowdragger.js

Issue 1257313003: Update Google Input Tools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Free up grd resources. Created 5 years, 4 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
OLDNEW
(Empty)
1 // Copyright 2015 The ChromeOS IME Authors. All Rights Reserved.
2 // limitations under the License.
3 // See the License for the specific language governing permissions and
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5 // distributed under the License is distributed on an "AS-IS" BASIS,
6 // Unless required by applicable law or agreed to in writing, software
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // You may obtain a copy of the License at
11 // you may not use this file except in compliance with the License.
12 // Licensed under the Apache License, Version 2.0 (the "License");
13 //
14 goog.provide('i18n.input.chrome.FloatingWindowDragger');
15
16 goog.require('goog.fx.Dragger');
17
18 goog.scope(function() {
19
20
21
22 /**
23 * The dragger for floating window.
24 *
25 * @param {!chrome.app.window.AppWindow|!Window} win The window.
26 * @param {Element} handle A handle to control the drag
27 * @constructor
28 * @extends {goog.fx.Dragger}
29 */
30 i18n.input.chrome.FloatingWindowDragger = function(win, handle) {
31 goog.base(this, handle);
32
33 /** @private {!chrome.app.window.AppWindow|!Window} */
34 this.floatingWindow_ = win;
35 };
36 var FloatingWindowDragger = i18n.input.chrome.FloatingWindowDragger;
37 goog.inherits(FloatingWindowDragger, goog.fx.Dragger);
38
39
40 /** @override */
41 FloatingWindowDragger.prototype.defaultAction = function(x, y) {
42 var outerBounds = this.floatingWindow_.outerBounds;
43 if (outerBounds) {
44 outerBounds.setPosition(outerBounds.left + x, outerBounds.top + y);
45 } else {
46 this.floatingWindow_.moveTo(this.floatingWindow_.screenX + x,
47 this.floatingWindow_.screenY + y);
48 }
49 };
50 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698