Closed Bug 695836 Opened 13 years ago Closed 13 years ago

sync last screen and last uri preference

Categories

(Firefox for Android Graveyard :: General, defect, P1)

x86
macOS
defect

Tracking

(firefox11 fixed, fennec11+)

RESOLVED FIXED
Tracking Status
firefox11 --- fixed
fennec 11+ ---

People

(Reporter: dougt, Assigned: dougt)

Details

Attachments

(1 file)

      No description provided.
Priority: -- → P1
pretty close to what we want.  I want to see if we can also store the offset
Attachment #568994 - Flags: review-
(In reply to Doug Turner (:dougt) from comment #1)
> Created attachment 568994 [details] [diff] [review] [diff] [details] [review]
> work in progress.
> 
> pretty close to what we want.  I want to see if we can also store the offset

Sounds like something we want in session restore anyway
if so, maybe we go with this as-is.  it is a ton better now.

the basic idea is that we can't keep the last uri in prefs because we need it before gecko starts up.
Attachment #568994 - Flags: review- → review?
Comment on attachment 568994 [details] [diff] [review]
work in progress.


>diff --git a/embedding/android/GeckoApp.java b/embedding/android/GeckoApp.java

>+                    // this is already true
>+                    // surfaceView.showStartupBitmap();

Remove these

>+                    final String awesomeURI = uri; 
>+                    mMainHandler.post(new Runnable() {
>+                      public void run() {
>+                        mBrowserToolbar.setTitle(awesomeURI);
>+                      }
>+                    });

Does this pass the blassey-test for mMainHandler vs. mHandler ?

Also, can't we try to use "last-title" pref here?

>+    private void rememberLastScreen(boolean sync) {

>+        if (!tab.getHistory().empty()) {
>+
>+            SharedPreferences prefs = getSharedPreferences ("GeckoApp", 0);

nits: no blank line needed at top of block and drop the space from | getSharedPreferences ( | (you do it every time you use getSharedPreferences)

>+            surfaceView.saveLast(sync);
>+        }
>+
>+    }

no blank line needed here

>+    private boolean restoreLastScreen() {

>+        return true;
>+        //        surfaceView.saveLast(sync);

remove

>     private void quit() {

>+        System.exit(0);
>         GeckoAppShell.nativeQuit();
>         finish();

Brad removed System.exit(0) and added the 2 new lines in this patch:
http://hg.mozilla.org/projects/birch/rev/653aa43e9643

Do we need it?

>diff --git a/embedding/android/GeckoSurfaceView.java b/embedding/android/GeckoSurfaceView.java

>     public void surfaceCreated(SurfaceHolder holder) {

>+        Log.i(LOG_FILE_NAME, "!! surface created");
>+
>+        // Delay sending this event if we are painting the
>+        // load screen.  The native access paint path will
>+        // paint directly to the screen and we will see a
>+        // black screen while content is initally being
>+        // drawn.
>+        if (!mShowingLoadScreen) {
>+            GeckoEvent e = new GeckoEvent(GeckoEvent.SURFACE_CREATED);
>+            GeckoAppShell.sendEventToGecko(e);
>+        }

You might want to move the Log into the if block, so we know if this is _really_ called

>diff --git a/mobile/components/BrowserCLH.js b/mobile/components/BrowserCLH.js

> BrowserCLH.prototype = {
>   handle: function fs_handle(aCmdLine) {
>-    dump("fs_handle");
> 
>-    let urlParam = aCmdLine.handleFlagWithParam("remote", false);

Don't leave the leading blank line

>+    let urlParam = "about:";

about:home? or do you want to wait?

>+    try {
>+        urlParam = aCmdLine.handleFlagWithParam("remote", false);

2 spaces

>+    } catch (e) { dump(""+e); }

nit: dump("" + e);

r+ with nits and some thought for the System.exit(0)

the mMainHandler things is up to you :)
Attachment #568994 - Flags: review? → review+
> Does this pass the blassey-test for mMainHandler vs. mHandler ?

There are like 2 dozen similar patterns here for setting the ui widgets.  we can have a follow up.

> Also, can't we try to use "last-title" pref here?

Not sure what you mean.  We can set the title instead, either way.
http://hg.mozilla.org/projects/birch/rev/45c91268cfee
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
tracking-fennec: --- → 11+
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: