Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.blimp; | 5 package org.chromium.blimp; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Intent; | 8 import android.content.Intent; |
| 9 import android.os.Bundle; | 9 import android.os.Bundle; |
| 10 import android.text.TextUtils; | 10 import android.text.TextUtils; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 mWebInputBox.initialize(mBlimpClientSession); | 158 mWebInputBox.initialize(mBlimpClientSession); |
| 159 | 159 |
| 160 mTabControlFeature = new TabControlFeature(mBlimpClientSession, mBlimpVi ew); | 160 mTabControlFeature = new TabControlFeature(mBlimpClientSession, mBlimpVi ew); |
| 161 | 161 |
| 162 handleUrl(getUrlFromIntent(getIntent())); | 162 handleUrl(getUrlFromIntent(getIntent())); |
| 163 } | 163 } |
| 164 | 164 |
| 165 @Override | 165 @Override |
| 166 protected void onNewIntent(Intent intent) { | 166 protected void onNewIntent(Intent intent) { |
| 167 super.onNewIntent(intent); | 167 super.onNewIntent(intent); |
| 168 handleUrl(getUrlFromIntent(intent)); | 168 if (getUrlFromIntent(intent) != null) { |
|
Khushal
2016/04/29 04:37:30
This is making the code really hard to follow. Let
shaktisahu
2016/05/03 19:47:28
Done.
| |
| 169 handleUrl(getUrlFromIntent(intent)); | |
| 170 } | |
| 169 } | 171 } |
| 170 | 172 |
| 171 /** | 173 /** |
| 172 * Retrieve the URL from the Intent. | 174 * Retrieve the URL from the Intent. |
| 173 * @param intent Intent to examine. | 175 * @param intent Intent to examine. |
| 174 * @return URL from the Intent, or null if a valid URL couldn't be found. | 176 * @return URL from the Intent, or null if a valid URL couldn't be found. |
| 175 */ | 177 */ |
| 176 private String getUrlFromIntent(Intent intent) { | 178 private String getUrlFromIntent(Intent intent) { |
| 177 if (intent == null) return null; | 179 if (intent == null) return null; |
| 178 | 180 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 } | 232 } |
| 231 | 233 |
| 232 @Override | 234 @Override |
| 233 public void onDisconnected(String reason) { | 235 public void onDisconnected(String reason) { |
| 234 Toast.makeText(this, | 236 Toast.makeText(this, |
| 235 String.format(getResources().getString(R.string.network_dis connected), reason), | 237 String.format(getResources().getString(R.string.network_dis connected), reason), |
| 236 Toast.LENGTH_LONG) | 238 Toast.LENGTH_LONG) |
| 237 .show(); | 239 .show(); |
| 238 } | 240 } |
| 239 } | 241 } |
| OLD | NEW |