Closed
Bug 769467
Opened 12 years ago
Closed 12 years ago
Add a PrivateBrowsingUtils module with a helper for determining whether a content window is in private browsing mode
Categories
(Toolkit :: General, defect)
Toolkit
General
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: ehsan.akhgari, Assigned: cwiiis)
References
Details
Attachments
(1 file, 3 obsolete files)
1.58 KB,
patch
|
Details | Diff | Splinter Review |
from bug 722984 comment #16) > Comment on attachment 637581 [details] [diff] [review] > Patch v3 > > I think it would be much simpler in general if there was a global private > browsing utility function that took a content window and returned whether > it's "private" using the docshell tree, rather than jumping through hoops in > various places to use gPrivateBrowsingUI. > > Something like: > PrivateBrowsingUtils.isWindowPrivate(window) > > isWindowPrivate: function (arbitraryWindow) { > return arbitraryWindow.QueryInterface(Ci.nsIInterfaceRequestor) > .getInterface(Ci.nsIWebNavigation) > .QueryInterface(Ci.nsIDocShellTreeItem) > .rootTreeItem.QueryInterface(Ci.nsILoadContext) > .usePrivateBrowsing; > } Note that the patch here should also switch the existing callers to the new API.
Comment 1•12 years ago
|
||
Bug 722984's patch is another potential consumer (along with your bug 722976).
OS: Mac OS X → All
Hardware: x86 → All
Assignee | ||
Comment 2•12 years ago
|
||
Does as suggested in comment #0
Attachment #638403 -
Flags: review?(gavin.sharp)
Comment 3•12 years ago
|
||
This patch adds the module in browser/ and the patch in bug 722976 uses it outside of browser/. One of these patches is wrong.
Assignee | ||
Comment 4•12 years ago
|
||
Moved from browser/components to dom/base, as discussed on IRC.
Attachment #638403 -
Attachment is obsolete: true
Attachment #638403 -
Flags: review?(gavin.sharp)
Attachment #638706 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 5•12 years ago
|
||
Moving to toolkit/content after discussion on IRC.
Attachment #638706 -
Attachment is obsolete: true
Attachment #638706 -
Flags: review?(gavin.sharp)
Attachment #638717 -
Flags: review?(gavin.sharp)
Comment 6•12 years ago
|
||
Comment on attachment 638717 [details] [diff] [review] Add PrivateBrowsingUtils module (in the more-right place) List it under EXTRA_JS_MODULES instead of EXTRA_PP_JS_MODULES (no need for preprocessing). r=me with that.
Attachment #638717 -
Flags: review?(gavin.sharp) → review+
Updated•12 years ago
|
Component: Private Browsing → General
Product: Firefox → Toolkit
QA Contact: private.browsing → general
Version: unspecified → Trunk
Assignee | ||
Comment 7•12 years ago
|
||
Attaching final patch for reference, carrying r+. Pushed to inbound: http://hg.mozilla.org/integration/mozilla-inbound/rev/505d87bc55d4 Let's deal with code using it in a follow-up bug.
Attachment #638717 -
Attachment is obsolete: true
Comment 8•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/505d87bc55d4
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in
before you can comment on or make changes to this bug.
Description
•