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

Side by Side Diff: chrome/browser/resources/uber/uber.js

Issue 755173004: Support presentational iframes and make use of them in the uber frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address test failures Created 6 years 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 | « chrome/browser/resources/uber/uber.html ('k') | chrome/common/extensions/api/automation.idl » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 cr.define('uber', function() { 5 cr.define('uber', function() {
6 /** 6 /**
7 * Options for how web history should be handled. 7 * Options for how web history should be handled.
8 */ 8 */
9 var HISTORY_STATE_OPTION = { 9 var HISTORY_STATE_OPTION = {
10 PUSH: 1, // Push a new history state. 10 PUSH: 1, // Push a new history state.
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 */ 330 */
331 function showPage(pageId, historyOption, path) { 331 function showPage(pageId, historyOption, path) {
332 var container = $(pageId); 332 var container = $(pageId);
333 333
334 // Lazy load of iframe contents. 334 // Lazy load of iframe contents.
335 var sourceUrl = container.dataset.url + (path || ''); 335 var sourceUrl = container.dataset.url + (path || '');
336 var frame = container.querySelector('iframe'); 336 var frame = container.querySelector('iframe');
337 if (!frame) { 337 if (!frame) {
338 frame = container.ownerDocument.createElement('iframe'); 338 frame = container.ownerDocument.createElement('iframe');
339 frame.name = pageId; 339 frame.name = pageId;
340 frame.setAttribute('role', 'presentation');
340 container.appendChild(frame); 341 container.appendChild(frame);
341 frame.src = sourceUrl; 342 frame.src = sourceUrl;
342 } else { 343 } else {
343 // There's no particularly good way to know what the current URL of the 344 // There's no particularly good way to know what the current URL of the
344 // content frame is as we don't have access to its contentWindow's 345 // content frame is as we don't have access to its contentWindow's
345 // location, so just replace every time until necessary to do otherwise. 346 // location, so just replace every time until necessary to do otherwise.
346 frame.contentWindow.location.replace(sourceUrl); 347 frame.contentWindow.location.replace(sourceUrl);
347 frame.dataset.ready = false; 348 frame.dataset.ready = false;
348 } 349 }
349 350
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 } 467 }
467 468
468 return { 469 return {
469 onLoad: onLoad, 470 onLoad: onLoad,
470 onPopHistoryState: onPopHistoryState 471 onPopHistoryState: onPopHistoryState
471 }; 472 };
472 }); 473 });
473 474
474 window.addEventListener('popstate', uber.onPopHistoryState); 475 window.addEventListener('popstate', uber.onPopHistoryState);
475 document.addEventListener('DOMContentLoaded', uber.onLoad); 476 document.addEventListener('DOMContentLoaded', uber.onLoad);
OLDNEW
« no previous file with comments | « chrome/browser/resources/uber/uber.html ('k') | chrome/common/extensions/api/automation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698