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

Side by Side Diff: ios/chrome/browser/ui/contextual_search/resources/contextualsearch.js

Issue 2817943002: Fully deprecate core.js. Moved last method to error.js. (Closed)
Patch Set: Tweak language Created 3 years, 8 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
« no previous file with comments | « ios/chrome/browser/passwords/js_password_manager.h ('k') | ios/web/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Support code for the Contextual Search feature. Given a tap 6 * @fileoverview Support code for the Contextual Search feature. Given a tap
7 * location, locates and highlights the word at that location, and retuns 7 * location, locates and highlights the word at that location, and retuns
8 * some contextual data about the selection. 8 * some contextual data about the selection.
9 * 9 *
10 */ 10 */
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 779
780 /** 780 /**
781 * Checks whether the context in a given point is valid. A context will be 781 * Checks whether the context in a given point is valid. A context will be
782 * valid when the element at the given point is not interactive or editable. 782 * valid when the element at the given point is not interactive or editable.
783 * @param {number} x The point's x coordinate. 783 * @param {number} x The point's x coordinate.
784 * @param {number} y The point's y coordinate. 784 * @param {number} y The point's y coordinate.
785 * @return {ContextData} Context data from the point, an error set if invalid. 785 * @return {ContextData} Context data from the point, an error set if invalid.
786 * @private 786 * @private
787 */ 787 */
788 Context.contextFromPoint = function(x, y) { 788 Context.contextFromPoint = function(x, y) {
789 // Should this use core.js's elementFromPoint_() instead? 789 // TODO(crbug.com/711350): Evaluate whether this should use context_menu.js's
790 // elementFromPoint_() instead?
790 var contextData = new ContextData(); 791 var contextData = new ContextData();
791 var element = document.elementFromPoint(x, y); 792 var element = document.elementFromPoint(x, y);
792 if (!element) { 793 if (!element) {
793 contextData.error = "Failed: Couldn't locate an element at " + x + ', ' + y; 794 contextData.error = "Failed: Couldn't locate an element at " + x + ', ' + y;
794 return contextData; 795 return contextData;
795 } 796 }
796 797
797 var d = new Date(); 798 var d = new Date();
798 var lastDOM = d.getTime() - Context.lastDOMMutationMillisecond; 799 var lastDOM = d.getTime() - Context.lastDOMMutationMillisecond;
799 if (lastDOM <= Context.DOMMutationTimeoutMillisecond) { 800 if (lastDOM <= Context.DOMMutationTimeoutMillisecond) {
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 var bottom = rects[i].bottom + document.body.scrollTop; 1333 var bottom = rects[i].bottom + document.body.scrollTop;
1333 var left = rects[i].left + document.body.scrollLeft; 1334 var left = rects[i].left + document.body.scrollLeft;
1334 var right = rects[i].right + document.body.scrollLeft; 1335 var right = rects[i].right + document.body.scrollLeft;
1335 rectsArray[i] = '' + top + ' ' + bottom + ' ' + left + ' ' + right; 1336 rectsArray[i] = '' + top + ' ' + bottom + ' ' + left + ' ' + right;
1336 } 1337 }
1337 return rectsArray.join(','); 1338 return rectsArray.join(',');
1338 }; 1339 };
1339 1340
1340 /* Anyonymizing block end */ 1341 /* Anyonymizing block end */
1341 } 1342 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/passwords/js_password_manager.h ('k') | ios/web/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698