diff options
author | yfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 19:00:50 +0000 |
---|---|---|
committer | yfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 19:00:50 +0000 |
commit | bba4e574bdda0e1b9c34d59a4f82aa862d7aa91a (patch) | |
tree | 3bd81d5dae54d68d43435d5d00cea17b8fb09f3b /content/shell | |
parent | 603af455b5641671b18d7d7d166630341d71b63f (diff) | |
download | chromium_src-bba4e574bdda0e1b9c34d59a4f82aa862d7aa91a.zip chromium_src-bba4e574bdda0e1b9c34d59a4f82aa862d7aa91a.tar.gz chromium_src-bba4e574bdda0e1b9c34d59a4f82aa862d7aa91a.tar.bz2 |
Remove all external references to ContentView from Tab/Shell/etc.
Cleanups:
- most places now directly use ContentViewCore instead of ContentView
- ContentView.getContentViewCore is removed (as you should be using
CVC directly and CVC.getContainerView())
- Tab.getContentView is removed. Use Tab.getView or
Tab.getContentViewCore().getContainerView(), with the latter being for
content rendered without android views.
BUG=360664
NOTRY=true
Review URL: https://codereview.chromium.org/275733002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270762 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r-- | content/shell/android/java/src/org/chromium/content_shell/Shell.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/content/shell/android/java/src/org/chromium/content_shell/Shell.java b/content/shell/android/java/src/org/chromium/content_shell/Shell.java index 99caca8..9e01a9d 100644 --- a/content/shell/android/java/src/org/chromium/content_shell/Shell.java +++ b/content/shell/android/java/src/org/chromium/content_shell/Shell.java @@ -44,7 +44,6 @@ public class Shell extends LinearLayout { } }; - private ContentView mContentView; private ContentViewCore mContentViewCore; private ContentViewClient mContentViewClient; private EditText mUrlTextView; @@ -150,7 +149,7 @@ public class Shell extends LinearLayout { } loadUrl(mUrlTextView.getText().toString()); setKeyboardVisibilityForUrl(false); - mContentView.requestFocus(); + mContentViewCore.getContainerView().requestFocus(); return true; } }); @@ -183,8 +182,8 @@ public class Shell extends LinearLayout { } mUrlTextView.clearFocus(); // TODO(aurimas): Remove this when crbug.com/174541 is fixed. - mContentView.clearFocus(); - mContentView.requestFocus(); + mContentViewCore.getContainerView().clearFocus(); + mContentViewCore.getContainerView().requestFocus(); } /** @@ -247,22 +246,24 @@ public class Shell extends LinearLayout { /** * Initializes the ContentView based on the native tab contents pointer passed in. - * @param nativeTabContents The pointer to the native tab contents object. + * @param nativeWebContents The pointer to the native tab contents object. */ @SuppressWarnings("unused") @CalledByNative - private void initFromNativeTabContents(long nativeTabContents) { - mContentView = ContentView.newInstance(getContext(), nativeTabContents, mWindow); - mContentViewCore = mContentView.getContentViewCore(); + private void initFromNativeTabContents(long nativeWebContents) { + Context context = getContext(); + mContentViewCore = new ContentViewCore(context); + ContentView cv = ContentView.newInstance(context, mContentViewCore); + mContentViewCore.initialize(cv, cv, nativeWebContents, mWindow); mContentViewCore.setContentViewClient(mContentViewClient); if (getParent() != null) mContentViewCore.onShow(); if (mContentViewCore.getUrl() != null) mUrlTextView.setText(mContentViewCore.getUrl()); - ((FrameLayout) findViewById(R.id.contentview_holder)).addView(mContentView, + ((FrameLayout) findViewById(R.id.contentview_holder)).addView(cv, new FrameLayout.LayoutParams( FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT)); - mContentView.requestFocus(); + cv.requestFocus(); mContentViewRenderView.setCurrentContentViewCore(mContentViewCore); } @@ -270,7 +271,7 @@ public class Shell extends LinearLayout { * @return The {@link ViewGroup} currently shown by this Shell. */ public ViewGroup getContentView() { - return mContentView; + return mContentViewCore.getContainerView(); } /** |