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

Unified Diff: chrome/browser/resources/uber/uber_frame.js

Issue 9967017: Upstream Android native crash handling changes. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: sync again Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/uber/uber_frame.js
diff --git a/chrome/browser/resources/uber/uber_frame.js b/chrome/browser/resources/uber/uber_frame.js
index ede1363048901c17a9efe43e471655db2234410b..47f950433e5e5f096e6b34fa8205d85cc1937c9b 100644
--- a/chrome/browser/resources/uber/uber_frame.js
+++ b/chrome/browser/resources/uber/uber_frame.js
@@ -39,6 +39,14 @@ cr.define('uber_frame', function() {
if (e.target.classList.contains('selected'))
return;
+ // Extensions can override Uber content (e.g., if the user has a history
Mark Mentovai 2012/04/09 22:55:58 This too.
+ // extension, it should display when the 'History' navigation is clicked).
+ if (e.currentTarget.getAttribute('override') == 'yes') {
+ window.open('chrome://' + e.currentTarget.getAttribute('controls'),
+ '_blank');
+ return;
+ }
+
uber.invokeMethodOnParent('showPage',
{pageId: e.currentTarget.getAttribute('controls')});
@@ -122,8 +130,23 @@ cr.define('uber_frame', function() {
return document.querySelector('.iframe-container.selected');
}
+ /**
+ * Finds the <li> element whose 'controls' attribute is |controls| and sets
+ * its 'override' attribute to |override|.
+ * @param {string} controls The value of the 'controls' attribute of the
+ * element to change.
+ * @param {string} override The value to set for the 'override' attribute of
+ * that element (either 'yes' or 'no').
+ */
+ function setNavigationOverride(controls, override) {
+ var navItem =
+ document.querySelector('li[controls="' + controls + '"]');
+ navItem.setAttribute('override', override);
+ }
+
return {
onLoad: onLoad,
+ setNavigationOverride: setNavigationOverride,
};
});

Powered by Google App Engine
This is Rietveld 408576698