OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.content_shell; | 5 package org.chromium.content_shell; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.graphics.drawable.ClipDrawable; | 8 import android.graphics.drawable.ClipDrawable; |
9 import android.text.TextUtils; | 9 import android.text.TextUtils; |
10 import android.util.AttributeSet; | 10 import android.util.AttributeSet; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 private void setIsLoading(boolean loading) { | 205 private void setIsLoading(boolean loading) { |
206 mLoading = loading; | 206 mLoading = loading; |
207 } | 207 } |
208 | 208 |
209 /** | 209 /** |
210 * Initializes the ContentView based on the native tab contents pointer pass
ed in. | 210 * Initializes the ContentView based on the native tab contents pointer pass
ed in. |
211 * @param nativeTabContents The pointer to the native tab contents object. | 211 * @param nativeTabContents The pointer to the native tab contents object. |
212 */ | 212 */ |
213 @SuppressWarnings("unused") | 213 @SuppressWarnings("unused") |
214 @CalledByNative | 214 @CalledByNative |
215 private void initFromNativeTabContents(int nativeTabContents) { | 215 private void initFromNativeTabContents(int nativeTabContents) |
| 216 throws AndroidBrowserProcessInitException { |
216 mContentView = ContentView.newInstance( | 217 mContentView = ContentView.newInstance( |
217 getContext(), nativeTabContents, mWindow, ContentView.PERSONALIT
Y_CHROME); | 218 getContext(), nativeTabContents, mWindow, ContentView.PERSONALIT
Y_CHROME); |
218 if (mContentView.getUrl() != null) mUrlTextView.setText(mContentView.get
Url()); | 219 if (mContentView.getUrl() != null) mUrlTextView.setText(mContentView.get
Url()); |
219 ((FrameLayout) findViewById(R.id.contentview_holder)).addView(mContentVi
ew, | 220 ((FrameLayout) findViewById(R.id.contentview_holder)).addView(mContentVi
ew, |
220 new FrameLayout.LayoutParams( | 221 new FrameLayout.LayoutParams( |
221 FrameLayout.LayoutParams.MATCH_PARENT, | 222 FrameLayout.LayoutParams.MATCH_PARENT, |
222 FrameLayout.LayoutParams.MATCH_PARENT)); | 223 FrameLayout.LayoutParams.MATCH_PARENT)); |
223 mContentView.requestFocus(); | 224 mContentView.requestFocus(); |
224 mContentViewRenderView.setCurrentContentView(mContentView); | 225 mContentViewRenderView.setCurrentContentView(mContentView); |
225 } | 226 } |
226 | 227 |
227 /** | 228 /** |
228 * @return The {@link ContentView} currently shown by this Shell. | 229 * @return The {@link ContentView} currently shown by this Shell. |
229 */ | 230 */ |
230 public ContentView getContentView() { | 231 public ContentView getContentView() { |
231 return mContentView; | 232 return mContentView; |
232 } | 233 } |
233 | 234 |
234 private void setKeyboardVisibilityForUrl(boolean visible) { | 235 private void setKeyboardVisibilityForUrl(boolean visible) { |
235 InputMethodManager imm = (InputMethodManager) getContext().getSystemServ
ice( | 236 InputMethodManager imm = (InputMethodManager) getContext().getSystemServ
ice( |
236 Context.INPUT_METHOD_SERVICE); | 237 Context.INPUT_METHOD_SERVICE); |
237 if (visible) { | 238 if (visible) { |
238 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); | 239 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); |
239 } else { | 240 } else { |
240 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); | 241 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); |
241 } | 242 } |
242 } | 243 } |
243 } | 244 } |
OLD | NEW |