Closed Bug 769097 Opened 8 years ago Closed 8 years ago

Remember desktop mode preference after OOM

Categories

(Firefox for Android :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 16
Tracking Status
firefox15 --- fixed

People

(Reporter: bnicholson, Assigned: bnicholson)

References

Details

Attachments

(1 file)

We should maintain the desktop mode after restoring from OOM.
Attached patch patchSplinter Review
Attachment #637307 - Flags: review?(mark.finkle)
Blocks: 766406
Comment on attachment 637307 [details] [diff] [review]
patch

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

>     this.id = ++gTabIDFactory;
>+    this.desktopMode = aParams.desktopMode == true;

Use parens to make this a bit more readable:

      this.desktopMode = (aParams.desktopMode == true);

but I think we need more since desktopMode is optional and we want to be more explicit:

      this.desktopMode = ("desktopMode" in aParams) ? aParams.desktopMode : false;

r+ with the nits
Attachment #637307 - Flags: review?(mark.finkle) → review+
Comment on attachment 637307 [details] [diff] [review]
patch

>diff --git a/mobile/android/components/SessionStore.js b/mobile/android/components/SessionStore.js

>-          let params = { selected: isSelected, delayLoad: true, title: entry.title };
>+          let params = {
>+            selected: isSelected,
>+            delayLoad: true,
>+            title: entry.title,
>+            desktopMode: tabData.desktopMode == true
>+          };

Actually, what if the sessionstore.js file has no "desktopMode" data? Will this throw an exception?

I guess it won't and desktopMode would be null which evaluates to false. So we are OK.
https://hg.mozilla.org/mozilla-central/rev/4a5f794edd2d
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 16
Uplifted as part of bug 766406.
You need to log in before you can comment on or make changes to this bug.