Closed Bug 813828 Opened 12 years ago Closed 12 years ago

Allow chrome code to launch Web Activities

Categories

(Core :: DOM: Core & HTML, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20
blocking-basecamp +
Tracking Status
firefox18 --- fixed
firefox19 --- fixed
firefox20 --- fixed

People

(Reporter: fabrice, Assigned: fabrice)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
Since bug 794407 we restrict web activities to be only launchable by user input. This breaks all use of web activities from chrome code such as protocol and content handlers.
Attachment #683840 - Flags: review?(mounir)
blocking-basecamp: --- → ?
Attached patch patch v2Splinter Review
Simpler patch using nsContentUtils::IsChromeDoc
Assignee: nobody → fabrice
Attachment #683840 - Attachment is obsolete: true
Attachment #683840 - Flags: review?(mounir)
Attachment #683854 - Flags: review?(mounir)
Comment on attachment 683854 [details] [diff] [review]
patch v2

Review of attachment 683854 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the printf_stderr removed.

::: dom/activities/src/Activity.cpp
@@ +55,5 @@
> +  nsCOMPtr<nsIDocument> document = do_QueryInterface(window->GetExtantDocument());
> +
> +  if (!nsEventStateManager::IsHandlingUserInput() &&
> +      !nsContentUtils::IsChromeDoc(document)) {
> +    printf_stderr("!! Can start activity from non user input or chrome code.");

Could you remove this printf_stderr, please? :)

Feel free to write another patch to show something in the console, though. I think that would be handy for developers :)
Attachment #683854 - Flags: review?(mounir) → review+
blocking-basecamp: ? → +
Blocks: 814072
https://hg.mozilla.org/mozilla-central/rev/7ae5ff606cf2
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Comment on attachment 683854 [details] [diff] [review]
patch v2

Review of attachment 683854 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/activities/src/Activity.cpp
@@ +51,5 @@
>    NS_ENSURE_TRUE(window, NS_ERROR_UNEXPECTED);
>  
>    Init(window);
>  
> +  nsCOMPtr<nsIDocument> document = do_QueryInterface(window->GetExtantDocument());

window->GetExtantDoc()

@@ +55,5 @@
> +  nsCOMPtr<nsIDocument> document = do_QueryInterface(window->GetExtantDocument());
> +
> +  if (!nsEventStateManager::IsHandlingUserInput() &&
> +      !nsContentUtils::IsChromeDoc(document)) {
> +    printf_stderr("!! Can start activity from non user input or chrome code.");

NS_NAMED_LITERAL_STRING
Component: DOM: Mozilla Extensions → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: