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

Unified Diff: third_party/google_input_tools/src/chrome/os/inputview/elements/layout/handwritinglayout.js

Issue 1046933003: Updates google-input-tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/google_input_tools/src/chrome/os/inputview/elements/layout/handwritinglayout.js
diff --git a/third_party/google_input_tools/src/chrome/os/inputview/elements/layout/handwritinglayout.js b/third_party/google_input_tools/src/chrome/os/inputview/elements/layout/handwritinglayout.js
index 1024ff61172da366c275f60831ca034f9490b38c..a2a8caee5ba1eab6c244ebcd508c5203aabeb197 100644
--- a/third_party/google_input_tools/src/chrome/os/inputview/elements/layout/handwritinglayout.js
+++ b/third_party/google_input_tools/src/chrome/os/inputview/elements/layout/handwritinglayout.js
@@ -16,10 +16,9 @@ goog.provide('i18n.input.chrome.inputview.elements.layout.HandwritingLayout');
goog.require('goog.dom.classlist');
goog.require('i18n.input.chrome.inputview.Css');
goog.require('i18n.input.chrome.inputview.GlobalFlags');
-goog.require('i18n.input.chrome.inputview.elements.Element');
goog.require('i18n.input.chrome.inputview.elements.ElementType');
goog.require('i18n.input.chrome.inputview.elements.Weightable');
-
+goog.require('i18n.input.chrome.inputview.elements.layout.LinearLayout');
goog.scope(function() {
@@ -31,38 +30,22 @@ goog.scope(function() {
* @param {string} id The id.
* @param {goog.events.EventTarget=} opt_eventTarget The event target.
* @constructor
- * @extends {i18n.input.chrome.inputview.elements.Element}
- * @implements {i18n.input.chrome.inputview.elements.Weightable}
+ * @extends {i18n.input.chrome.inputview.elements.layout.LinearLayout}
*/
i18n.input.chrome.inputview.elements.layout.HandwritingLayout = function(id,
opt_eventTarget) {
- goog.base(this, id, i18n.input.chrome.inputview.elements.ElementType.
- HANDWRITING_LAYOUT, opt_eventTarget);
+ goog.base(this, id, opt_eventTarget);
+
+ /** @override */
+ this.type = i18n.input.chrome.inputview.elements.ElementType.
+ HANDWRITING_LAYOUT;
};
goog.inherits(i18n.input.chrome.inputview.elements.layout.HandwritingLayout,
- i18n.input.chrome.inputview.elements.Element);
+ i18n.input.chrome.inputview.elements.layout.LinearLayout);
var HandwritingLayout =
i18n.input.chrome.inputview.elements.layout.HandwritingLayout;
-/**
- * The height in weight unit.
- *
- * @type {number}
- * @private
- */
-HandwritingLayout.prototype.heightInWeight_ = 0;
-
-
-/**
- * The width in weight unit.
- *
- * @type {number}
- * @private
- */
-HandwritingLayout.prototype.widthInWeight_ = 0;
-
-
/** @override */
HandwritingLayout.prototype.createDom = function() {
goog.base(this, 'createDom');
@@ -73,52 +56,14 @@ HandwritingLayout.prototype.createDom = function() {
/** @override */
-HandwritingLayout.prototype.enterDocument = function() {
- goog.base(this, 'enterDocument');
-
- this.calculate_();
-};
-
-
-/**
- * Gets the first child.
- *
- * @private
- */
-HandwritingLayout.prototype.calculate_ = function() {
- var child = /** @type {i18n.input.chrome.inputview.elements.Weightable} */ (
- this.getChildAt(0));
- this.heightInWeight_ = child.getHeightInWeight();
- this.widthInWeight_ = child.getWidthInWeight();
-};
-
-
-/** @override */
-HandwritingLayout.prototype.getHeightInWeight = function() {
- return this.heightInWeight_;
-};
-
-
-/** @override */
-HandwritingLayout.prototype.getWidthInWeight = function() {
- return this.widthInWeight_;
-};
-
-
-/** @override */
HandwritingLayout.prototype.resize = function(width, height) {
goog.base(this, 'resize', width, height);
- for (var i = 0; i < this.getChildCount(); i++) {
- var child = /** @type {i18n.input.chrome.inputview.elements.Element} */ (
- this.getChildAt(i));
- child.resize(
- Math.ceil(width * child.getWidthInWeight() / this.widthInWeight_),
- Math.ceil(height * child.getHeightInWeight() / this.heightInWeight_));
- if (!i18n.input.chrome.inputview.GlobalFlags.isQPInputView) {
- // 85/140 = 0.6
- child.getElement().style.top =
- Math.ceil(height * 0.6 / this.heightInWeight_);
- }
+
+ if (!i18n.input.chrome.inputview.GlobalFlags.isQPInputView) {
+ // 85/140 = 0.6
+ this.getElement().style.top =
+ Math.ceil(height * 0.6 / this.getHeightInWeight());
}
};
+
}); // goog.scope

Powered by Google App Engine
This is Rietveld 408576698