Bug 700951 - Factor out method to cancel and finish AwesomeBar (r=mfinkle)
authorLucas Rocha <lucasr@mozilla.com>
Thu, 17 Nov 2011 15:47:03 +0000
changeset 83524 588ef2d53d6e3addb3d26358c479e2a33bfd4e37
parent 83523 3394b96268285428bfc5c58d07e54896bca32eb4
child 83525 1931173a30a0d350782bcffffd287f4c785dd689
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs700951
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 700951 - Factor out method to cancel and finish AwesomeBar (r=mfinkle) So that we can reuse same code in other parts of AwesomeBar.
embedding/android/AwesomeBar.java
--- a/embedding/android/AwesomeBar.java
+++ b/embedding/android/AwesomeBar.java
@@ -153,20 +153,23 @@ public class AwesomeBar extends Activity
 
     @Override
     public void onConfigurationChanged(Configuration newConfiguration) {
         super.onConfigurationChanged(newConfiguration);
     }
 
     @Override
     public boolean onSearchRequested() {
+        cancelAndFinish();
+        return true;
+    }
+
+    private void cancelAndFinish() {
         setResult(Activity.RESULT_CANCELED);
         finish();
-
-        return true;
     }
 
     private void openUrlAndFinish(String url) {
         Intent resultIntent = new Intent();
         resultIntent.putExtra(URL_KEY, url);
         resultIntent.putExtra(TYPE_KEY, mType);
 
         setResult(Activity.RESULT_OK, resultIntent);