Closed Bug 768665 Opened 12 years ago Closed 12 years ago

Add context menu to selected text

Categories

(Firefox for Android Graveyard :: Text Selection, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox15 verified, firefox16 verified, firefox17 verified)

VERIFIED FIXED
Firefox 16
Tracking Status
firefox15 --- verified
firefox16 --- verified
firefox17 --- verified

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(1 file)

It should include "Copy", "Select All", and "Share".
Attached patch patchSplinter Review
Assignee: nobody → margaret.leibovic
Attachment #636937 - Flags: review?(mark.finkle)
What does Select All do on already selected text?
(In reply to Aaron Train [:aaronmt] from comment #2)
> What does Select All do on already selected text?

It selects the entire page (like cmd+a on desktop). The action bar on selection on Chrome also has a button that does this, so it seems useful.
Would this still be needed if the action bar (Bug 768667) was implemented?
(In reply to Yann Brelière from comment #4)
> Would this still be needed if the action bar (Bug 768667) was implemented?

For Froyo and Gingerbread it would be needed. We would not support the ActionBar there.
Comment on attachment 636937 [details] [diff] [review]
patch

>diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js

>+  showContextMenu: function sh_showContextMenu(aX, aY) {

>+      case SELECT_ALL:
>+        let selectionController = this._view.QueryInterface(Ci.nsIInterfaceRequestor).

>+      case SHARE:
>+        let selectedText = this.endSelection();

Can you add {} since you are making local vars in the case blocks?

        case SELECT_ALL: {
          let selectionController = this._view.QueryInterface(Ci.nsIInterfaceRequestor).
          ...
          break;
        }


>+    return selectedText;

Is this used? or is this just a handy thing to do?
Attachment #636937 - Flags: review?(mark.finkle) → review+
(In reply to Mark Finkle (:mfinkle) from comment #6)

>         case SELECT_ALL: {
>           let selectionController =
> this._view.QueryInterface(Ci.nsIInterfaceRequestor).
>           ...
>           break;
>         }
> 
> 
> >+    return selectedText;
> 
> Is this used? or is this just a handy thing to do?

I added it so that it could be used for the share method. It's a little tricksy for my tastes, but I didn't want to try to refactor endSelection to factor out the code that works with the selection.
https://hg.mozilla.org/integration/mozilla-inbound/rev/c64440f55c79
Target Milestone: --- → Firefox 16
https://hg.mozilla.org/mozilla-central/rev/c64440f55c79
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Uplifted to aurora as part of a roll-up patch:
https://hg.mozilla.org/releases/mozilla-aurora/rev/2fb0a358eaf6
Component: General → Text Selection
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: