summaryrefslogtreecommitdiff
path: root/chromium/content/shell
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2013-12-11 21:33:03 +0100
committerAndras Becsi <andras.becsi@digia.com>2013-12-13 12:34:07 +0100
commitf2a33ff9cbc6d19943f1c7fbddd1f23d23975577 (patch)
tree0586a32aa390ade8557dfd6b4897f43a07449578 /chromium/content/shell
parent5362912cdb5eea702b68ebe23702468d17c3017a (diff)
downloadqtwebengine-chromium-f2a33ff9cbc6d19943f1c7fbddd1f23d23975577.tar.gz
Update Chromium to branch 1650 (31.0.1650.63)
Change-Id: I57d8c832eaec1eb2364e0a8e7352a6dd354db99f Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'chromium/content/shell')
-rw-r--r--chromium/content/shell/android/browsertests_apk/res/layout/test_activity.xml2
-rw-r--r--chromium/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java57
-rw-r--r--chromium/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsApplication.java29
-rw-r--r--chromium/content/shell/android/java/res/drawable/progress.xml13
-rw-r--r--chromium/content/shell/android/java/res/layout/shell_view.xml48
-rw-r--r--chromium/content/shell/android/java/src/org/chromium/content_shell/Shell.java245
-rw-r--r--chromium/content/shell/android/java/src/org/chromium/content_shell/ShellLayoutTestUtils.java25
-rw-r--r--chromium/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java123
-rw-r--r--chromium/content/shell/android/javatests/AndroidManifest.xml21
-rw-r--r--chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java25
-rw-r--r--chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java204
-rw-r--r--chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellUrlTest.java30
-rw-r--r--chromium/content/shell/android/shell_apk/AndroidManifest.xml3
-rw-r--r--chromium/content/shell/android/shell_apk/res/values/strings.xml (renamed from chromium/content/shell/android/java/res/values/strings.xml)4
-rw-r--r--chromium/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java266
-rw-r--r--chromium/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java33
-rw-r--r--chromium/content/shell/android/shell_jni_registrar.cc30
-rw-r--r--chromium/content/shell/android/shell_jni_registrar.h19
-rw-r--r--chromium/content/shell/android/shell_manager.cc6
-rw-r--r--chromium/content/shell/app/shell_main_delegate.cc14
-rw-r--r--chromium/content/shell/app/webkit_test_platform_support_win.cc2
-rw-r--r--chromium/content/shell/browser/minimal_shell.cc (renamed from chromium/content/shell/minimal_shell.cc)2
-rw-r--r--chromium/content/shell/browser/minimal_shell.h (renamed from chromium/content/shell/minimal_shell.h)6
-rw-r--r--chromium/content/shell/browser/notify_done_forwarder.cc (renamed from chromium/content/shell/notify_done_forwarder.cc)6
-rw-r--r--chromium/content/shell/browser/notify_done_forwarder.h (renamed from chromium/content/shell/notify_done_forwarder.h)8
-rw-r--r--chromium/content/shell/browser/shell.cc (renamed from chromium/content/shell/shell.cc)23
-rw-r--r--chromium/content/shell/browser/shell.h (renamed from chromium/content/shell/shell.h)8
-rw-r--r--chromium/content/shell/browser/shell_android.cc (renamed from chromium/content/shell/shell_android.cc)4
-rw-r--r--chromium/content/shell/browser/shell_application_mac.h (renamed from chromium/content/shell/shell_application_mac.h)8
-rw-r--r--chromium/content/shell/browser/shell_application_mac.mm (renamed from chromium/content/shell/shell_application_mac.mm)10
-rw-r--r--chromium/content/shell/browser/shell_aura.cc (renamed from chromium/content/shell/shell_aura.cc)24
-rw-r--r--chromium/content/shell/browser/shell_browser_context.cc (renamed from chromium/content/shell/shell_browser_context.cc)8
-rw-r--r--chromium/content/shell/browser/shell_browser_context.h (renamed from chromium/content/shell/shell_browser_context.h)8
-rw-r--r--chromium/content/shell/browser/shell_browser_main.cc (renamed from chromium/content/shell/shell_browser_main.cc)24
-rw-r--r--chromium/content/shell/browser/shell_browser_main.h (renamed from chromium/content/shell/shell_browser_main.h)8
-rw-r--r--chromium/content/shell/browser/shell_browser_main_parts.cc (renamed from chromium/content/shell/shell_browser_main_parts.cc)14
-rw-r--r--chromium/content/shell/browser/shell_browser_main_parts.h (renamed from chromium/content/shell/shell_browser_main_parts.h)8
-rw-r--r--chromium/content/shell/browser/shell_browser_main_parts_mac.mm (renamed from chromium/content/shell/shell_browser_main_parts_mac.mm)6
-rw-r--r--chromium/content/shell/browser/shell_content_browser_client.cc (renamed from chromium/content/shell/shell_content_browser_client.cc)31
-rw-r--r--chromium/content/shell/browser/shell_content_browser_client.h (renamed from chromium/content/shell/shell_content_browser_client.h)11
-rw-r--r--chromium/content/shell/browser/shell_devtools_delegate.cc (renamed from chromium/content/shell/shell_devtools_delegate.cc)10
-rw-r--r--chromium/content/shell/browser/shell_devtools_delegate.h (renamed from chromium/content/shell/shell_devtools_delegate.h)10
-rw-r--r--chromium/content/shell/browser/shell_devtools_frontend.cc (renamed from chromium/content/shell/shell_devtools_frontend.cc)14
-rw-r--r--chromium/content/shell/browser/shell_devtools_frontend.h (renamed from chromium/content/shell/shell_devtools_frontend.h)29
-rw-r--r--chromium/content/shell/browser/shell_download_manager_delegate.cc (renamed from chromium/content/shell/shell_download_manager_delegate.cc)6
-rw-r--r--chromium/content/shell/browser/shell_download_manager_delegate.h (renamed from chromium/content/shell/shell_download_manager_delegate.h)8
-rw-r--r--chromium/content/shell/browser/shell_gtk.cc (renamed from chromium/content/shell/shell_gtk.cc)8
-rw-r--r--chromium/content/shell/browser/shell_javascript_dialog.h (renamed from chromium/content/shell/shell_javascript_dialog.h)8
-rw-r--r--chromium/content/shell/browser/shell_javascript_dialog_gtk.cc (renamed from chromium/content/shell/shell_javascript_dialog_gtk.cc)8
-rw-r--r--chromium/content/shell/browser/shell_javascript_dialog_mac.mm (renamed from chromium/content/shell/shell_javascript_dialog_mac.mm)6
-rw-r--r--chromium/content/shell/browser/shell_javascript_dialog_manager.cc (renamed from chromium/content/shell/shell_javascript_dialog_manager.cc)8
-rw-r--r--chromium/content/shell/browser/shell_javascript_dialog_manager.h (renamed from chromium/content/shell/shell_javascript_dialog_manager.h)8
-rw-r--r--chromium/content/shell/browser/shell_javascript_dialog_win.cc (renamed from chromium/content/shell/shell_javascript_dialog_win.cc)8
-rw-r--r--chromium/content/shell/browser/shell_layout_tests_android.cc (renamed from chromium/content/shell/shell_layout_tests_android.cc)2
-rw-r--r--chromium/content/shell/browser/shell_layout_tests_android.h (renamed from chromium/content/shell/shell_layout_tests_android.h)6
-rw-r--r--chromium/content/shell/browser/shell_login_dialog.cc (renamed from chromium/content/shell/shell_login_dialog.cc)8
-rw-r--r--chromium/content/shell/browser/shell_login_dialog.h (renamed from chromium/content/shell/shell_login_dialog.h)8
-rw-r--r--chromium/content/shell/browser/shell_login_dialog_gtk.cc (renamed from chromium/content/shell/shell_login_dialog_gtk.cc)4
-rw-r--r--chromium/content/shell/browser/shell_login_dialog_mac.mm (renamed from chromium/content/shell/shell_login_dialog_mac.mm)4
-rw-r--r--chromium/content/shell/browser/shell_mac.mm (renamed from chromium/content/shell/shell_mac.mm)4
-rw-r--r--chromium/content/shell/browser/shell_message_filter.cc (renamed from chromium/content/shell/shell_message_filter.cc)12
-rw-r--r--chromium/content/shell/browser/shell_message_filter.h (renamed from chromium/content/shell/shell_message_filter.h)8
-rw-r--r--chromium/content/shell/browser/shell_net_log.cc (renamed from chromium/content/shell/shell_net_log.cc)2
-rw-r--r--chromium/content/shell/browser/shell_net_log.h (renamed from chromium/content/shell/shell_net_log.h)6
-rw-r--r--chromium/content/shell/browser/shell_network_delegate.cc (renamed from chromium/content/shell/shell_network_delegate.cc)4
-rw-r--r--chromium/content/shell/browser/shell_network_delegate.h (renamed from chromium/content/shell/shell_network_delegate.h)8
-rw-r--r--chromium/content/shell/browser/shell_plugin_service_filter.cc (renamed from chromium/content/shell/shell_plugin_service_filter.cc)4
-rw-r--r--chromium/content/shell/browser/shell_plugin_service_filter.h (renamed from chromium/content/shell/shell_plugin_service_filter.h)8
-rw-r--r--chromium/content/shell/browser/shell_quota_permission_context.cc (renamed from chromium/content/shell/shell_quota_permission_context.cc)4
-rw-r--r--chromium/content/shell/browser/shell_quota_permission_context.h (renamed from chromium/content/shell/shell_quota_permission_context.h)8
-rw-r--r--chromium/content/shell/browser/shell_resource_dispatcher_host_delegate.cc (renamed from chromium/content/shell/shell_resource_dispatcher_host_delegate.cc)6
-rw-r--r--chromium/content/shell/browser/shell_resource_dispatcher_host_delegate.h (renamed from chromium/content/shell/shell_resource_dispatcher_host_delegate.h)8
-rw-r--r--chromium/content/shell/browser/shell_speech_recognition_manager_delegate.cc33
-rw-r--r--chromium/content/shell/browser/shell_speech_recognition_manager_delegate.h38
-rw-r--r--chromium/content/shell/browser/shell_url_request_context_getter.cc (renamed from chromium/content/shell/shell_url_request_context_getter.cc)12
-rw-r--r--chromium/content/shell/browser/shell_url_request_context_getter.h (renamed from chromium/content/shell/shell_url_request_context_getter.h)8
-rw-r--r--chromium/content/shell/browser/shell_web_contents_view_delegate.h (renamed from chromium/content/shell/shell_web_contents_view_delegate.h)8
-rw-r--r--chromium/content/shell/browser/shell_web_contents_view_delegate_android.cc (renamed from chromium/content/shell/shell_web_contents_view_delegate_android.cc)6
-rw-r--r--chromium/content/shell/browser/shell_web_contents_view_delegate_creator.h (renamed from chromium/content/shell/shell_web_contents_view_delegate_creator.h)8
-rw-r--r--chromium/content/shell/browser/shell_web_contents_view_delegate_gtk.cc (renamed from chromium/content/shell/shell_web_contents_view_delegate_gtk.cc)16
-rw-r--r--chromium/content/shell/browser/shell_web_contents_view_delegate_mac.mm (renamed from chromium/content/shell/shell_web_contents_view_delegate_mac.mm)16
-rw-r--r--chromium/content/shell/browser/shell_web_contents_view_delegate_win.cc (renamed from chromium/content/shell/shell_web_contents_view_delegate_win.cc)16
-rw-r--r--chromium/content/shell/browser/shell_win.cc (renamed from chromium/content/shell/shell_win.cc)22
-rw-r--r--chromium/content/shell/browser/webkit_test_controller.cc (renamed from chromium/content/shell/webkit_test_controller.cc)19
-rw-r--r--chromium/content/shell/browser/webkit_test_controller.h (renamed from chromium/content/shell/webkit_test_controller.h)8
-rw-r--r--chromium/content/shell/common/shell_switches.cc6
-rw-r--r--chromium/content/shell/common/shell_switches.h1
-rw-r--r--chromium/content/shell/common/webkit_test_helpers.cc5
-rw-r--r--chromium/content/shell/geolocation/shell_access_token_store.cc2
-rw-r--r--chromium/content/shell/renderer/shell_content_renderer_client.cc2
-rw-r--r--chromium/content/shell/renderer/shell_render_process_observer.cc7
-rw-r--r--chromium/content/shell/renderer/webkit_test_runner.cc14
-rw-r--r--chromium/content/shell/renderer/webkit_test_runner.h3
93 files changed, 440 insertions, 1471 deletions
diff --git a/chromium/content/shell/android/browsertests_apk/res/layout/test_activity.xml b/chromium/content/shell/android/browsertests_apk/res/layout/test_activity.xml
index fbcb803faff..ab39d5a98b1 100644
--- a/chromium/content/shell/android/browsertests_apk/res/layout/test_activity.xml
+++ b/chromium/content/shell/android/browsertests_apk/res/layout/test_activity.xml
@@ -7,7 +7,7 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
+ android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical">
<org.chromium.content_shell.ShellManager
android:id="@+id/shell_container"
diff --git a/chromium/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java b/chromium/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java
deleted file mode 100644
index 3f25e68e273..00000000000
--- a/chromium/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content_browsertests_apk;
-
-import android.app.Activity;
-import android.content.Context;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.util.Log;
-
-import org.chromium.base.JNINamespace;
-import org.chromium.content.app.LibraryLoader;
-import org.chromium.content.browser.AndroidBrowserProcess;
-import org.chromium.content.common.ProcessInitException;
-import org.chromium.content_shell.ShellManager;
-import org.chromium.ui.WindowAndroid;
-
-@JNINamespace("content")
-public class ContentBrowserTestsActivity extends Activity {
- private static final String TAG = "ChromeBrowserTestsActivity";
-
- private ShellManager mShellManager;
- private WindowAndroid mWindowAndroid;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- try {
- LibraryLoader.ensureInitialized();
- } catch (ProcessInitException e) {
- Log.i(TAG, "Cannot load content_browsertests:" + e);
- }
- AndroidBrowserProcess.initChromiumBrowserProcessForTests(getApplicationContext());
-
- LayoutInflater inflater =
- (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View view = inflater.inflate(R.layout.test_activity, null);
- mShellManager = (ShellManager) view.findViewById(R.id.shell_container);
- mWindowAndroid = new WindowAndroid(this);
- mShellManager.setWindow(mWindowAndroid);
-
- Log.i(TAG, "Running tests");
- runTests();
- Log.i(TAG, "Tests finished.");
- finish();
- }
-
- private void runTests() {
- nativeRunTests(getFilesDir().getAbsolutePath(), getApplicationContext());
- }
-
- private native void nativeRunTests(String filesDir, Context appContext);
-}
diff --git a/chromium/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsApplication.java b/chromium/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsApplication.java
deleted file mode 100644
index c85063673de..00000000000
--- a/chromium/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsApplication.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content_browsertests_apk;
-
-import android.app.Application;
-
-import org.chromium.base.PathUtils;
-import org.chromium.content.app.LibraryLoader;
-import org.chromium.content.browser.ResourceExtractor;
-
-public class ContentBrowserTestsApplication extends Application {
-
- private static final String[] MANDATORY_PAK_FILES = new String[] {"content_shell.pak"};
- private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "content_shell";
-
- @Override
- public void onCreate() {
- super.onCreate();
- initializeApplicationParameters();
- }
-
- public static void initializeApplicationParameters() {
- ResourceExtractor.setMandatoryPaksToExtract(MANDATORY_PAK_FILES);
- PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
- }
-
-}
diff --git a/chromium/content/shell/android/java/res/drawable/progress.xml b/chromium/content/shell/android/java/res/drawable/progress.xml
deleted file mode 100644
index 93322b91b6d..00000000000
--- a/chromium/content/shell/android/java/res/drawable/progress.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<clip xmlns:android="http://schemas.android.com/apk/res/android">
- <shape>
- <solid android:color="@android:color/holo_blue_light" />
- </shape>
-</clip>
diff --git a/chromium/content/shell/android/java/res/layout/shell_view.xml b/chromium/content/shell/android/java/res/layout/shell_view.xml
deleted file mode 100644
index d6c15d6f91f..00000000000
--- a/chromium/content/shell/android/java/res/layout/shell_view.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
-
- Use of this source code is governed by a BSD-style license that can be
- found in the LICENSE file.
- -->
-
-<org.chromium.content_shell.Shell
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
- <LinearLayout android:id="@+id/toolbar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:background="@drawable/progress">
- <EditText android:id="@+id/url"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:gravity="bottom"
- android:textSize="18sp"
- android:autoText="true"
- android:capitalize="sentences"
- android:singleLine="true"
- android:selectAllOnFocus="true"
- android:hint="@string/url_hint"
- android:inputType="textUri"
- android:imeOptions="actionGo" />
- <ImageButton android:id="@+id/prev"
- android:layout_width="38dp"
- android:layout_height="38dp"
- android:src="@android:drawable/ic_media_previous"
- android:scaleType="center" />
- <ImageButton android:id="@+id/next"
- android:layout_width="38dp"
- android:layout_height="38dp"
- android:src="@android:drawable/ic_media_next"
- android:scaleType="center" />
- </LinearLayout>
- <FrameLayout android:id="@+id/contentview_holder"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
-</org.chromium.content_shell.Shell>
diff --git a/chromium/content/shell/android/java/src/org/chromium/content_shell/Shell.java b/chromium/content/shell/android/java/src/org/chromium/content_shell/Shell.java
deleted file mode 100644
index 1d177b6197b..00000000000
--- a/chromium/content/shell/android/java/src/org/chromium/content_shell/Shell.java
+++ /dev/null
@@ -1,245 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content_shell;
-
-import android.content.Context;
-import android.graphics.drawable.ClipDrawable;
-import android.text.TextUtils;
-import android.util.AttributeSet;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.EditText;
-import android.widget.FrameLayout;
-import android.widget.ImageButton;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-import android.widget.TextView.OnEditorActionListener;
-
-import org.chromium.base.CalledByNative;
-import org.chromium.base.JNINamespace;
-import org.chromium.content.browser.ContentView;
-import org.chromium.content.browser.ContentViewRenderView;
-import org.chromium.content.browser.LoadUrlParams;
-import org.chromium.ui.WindowAndroid;
-
-/**
- * Container for the various UI components that make up a shell window.
- */
-@JNINamespace("content")
-public class Shell extends LinearLayout {
-
- private static final long COMPLETED_PROGRESS_TIMEOUT_MS = 200;
-
- private Runnable mClearProgressRunnable = new Runnable() {
- @Override
- public void run() {
- mProgressDrawable.setLevel(0);
- }
- };
-
- // TODO(jrg): a mContentView.destroy() call is needed, both upstream and downstream.
- private ContentView mContentView;
- private EditText mUrlTextView;
- private ImageButton mPrevButton;
- private ImageButton mNextButton;
-
- private ClipDrawable mProgressDrawable;
-
- private ContentViewRenderView mContentViewRenderView;
- private WindowAndroid mWindow;
-
- private boolean mLoading = false;
-
- /**
- * Constructor for inflating via XML.
- */
- public Shell(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- /**
- * Set the SurfaceView being renderered to as soon as it is available.
- */
- public void setContentViewRenderView(ContentViewRenderView contentViewRenderView) {
- FrameLayout contentViewHolder = (FrameLayout) findViewById(R.id.contentview_holder);
- if (contentViewRenderView == null) {
- if (mContentViewRenderView != null) {
- contentViewHolder.removeView(mContentViewRenderView);
- }
- } else {
- contentViewHolder.addView(contentViewRenderView,
- new FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT,
- FrameLayout.LayoutParams.MATCH_PARENT));
- }
- mContentViewRenderView = contentViewRenderView;
- }
-
- /**
- * @param window The owning window for this shell.
- */
- public void setWindow(WindowAndroid window) {
- mWindow = window;
- }
-
- /**
- * @return Whether or not the Shell is loading content.
- */
- public boolean isLoading() {
- return mLoading;
- }
-
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
-
- mProgressDrawable = (ClipDrawable) findViewById(R.id.toolbar).getBackground();
- initializeUrlField();
- initializeNavigationButtons();
- }
-
- private void initializeUrlField() {
- mUrlTextView = (EditText) findViewById(R.id.url);
- mUrlTextView.setOnEditorActionListener(new OnEditorActionListener() {
- @Override
- public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
- if ((actionId != EditorInfo.IME_ACTION_GO) && (event == null ||
- event.getKeyCode() != KeyEvent.KEYCODE_ENTER ||
- event.getAction() != KeyEvent.ACTION_DOWN)) {
- return false;
- }
- loadUrl(mUrlTextView.getText().toString());
- setKeyboardVisibilityForUrl(false);
- mContentView.requestFocus();
- return true;
- }
- });
- mUrlTextView.setOnFocusChangeListener(new OnFocusChangeListener() {
- @Override
- public void onFocusChange(View v, boolean hasFocus) {
- setKeyboardVisibilityForUrl(hasFocus);
- mNextButton.setVisibility(hasFocus ? GONE : VISIBLE);
- mPrevButton.setVisibility(hasFocus ? GONE : VISIBLE);
- if (!hasFocus) {
- mUrlTextView.setText(mContentView.getUrl());
- }
- }
- });
- }
-
- /**
- * Loads an URL. This will perform minimal amounts of sanitizing of the URL to attempt to
- * make it valid.
- *
- * @param url The URL to be loaded by the shell.
- */
- public void loadUrl(String url) {
- if (url == null) return;
-
- if (TextUtils.equals(url, mContentView.getUrl())) {
- mContentView.reload();
- } else {
- mContentView.loadUrl(new LoadUrlParams(sanitizeUrl(url)));
- }
- mUrlTextView.clearFocus();
- // TODO(aurimas): Remove this when crbug.com/174541 is fixed.
- mContentView.clearFocus();
- mContentView.requestFocus();
- }
-
- /**
- * Given an URL, this performs minimal sanitizing to ensure it will be valid.
- * @param url The url to be sanitized.
- * @return The sanitized URL.
- */
- public static String sanitizeUrl(String url) {
- if (url == null) return url;
- if (url.startsWith("www.") || url.indexOf(":") == -1) url = "http://" + url;
- return url;
- }
-
- private void initializeNavigationButtons() {
- mPrevButton = (ImageButton) findViewById(R.id.prev);
- mPrevButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if (mContentView.canGoBack()) mContentView.goBack();
- }
- });
-
- mNextButton = (ImageButton) findViewById(R.id.next);
- mNextButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- if (mContentView.canGoForward()) mContentView.goForward();
- }
- });
- }
-
- @SuppressWarnings("unused")
- @CalledByNative
- private void onUpdateUrl(String url) {
- mUrlTextView.setText(url);
- }
-
- @SuppressWarnings("unused")
- @CalledByNative
- private void onLoadProgressChanged(double progress) {
- removeCallbacks(mClearProgressRunnable);
- mProgressDrawable.setLevel((int) (10000.0 * progress));
- if (progress == 1.0) postDelayed(mClearProgressRunnable, COMPLETED_PROGRESS_TIMEOUT_MS);
- }
-
- @CalledByNative
- private void toggleFullscreenModeForTab(boolean enterFullscreen) {
- }
-
- @CalledByNative
- private boolean isFullscreenForTabOrPending() {
- return false;
- }
-
- @SuppressWarnings("unused")
- @CalledByNative
- private void setIsLoading(boolean loading) {
- mLoading = loading;
- }
-
- /**
- * Initializes the ContentView based on the native tab contents pointer passed in.
- * @param nativeTabContents The pointer to the native tab contents object.
- */
- @SuppressWarnings("unused")
- @CalledByNative
- private void initFromNativeTabContents(int nativeTabContents) {
- mContentView = ContentView.newInstance(getContext(), nativeTabContents, mWindow);
- if (mContentView.getUrl() != null) mUrlTextView.setText(mContentView.getUrl());
- ((FrameLayout) findViewById(R.id.contentview_holder)).addView(mContentView,
- new FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT,
- FrameLayout.LayoutParams.MATCH_PARENT));
- mContentView.requestFocus();
- mContentViewRenderView.setCurrentContentView(mContentView);
- }
-
- /**
- * @return The {@link ContentView} currently shown by this Shell.
- */
- public ContentView getContentView() {
- return mContentView;
- }
-
- private void setKeyboardVisibilityForUrl(boolean visible) {
- InputMethodManager imm = (InputMethodManager) getContext().getSystemService(
- Context.INPUT_METHOD_SERVICE);
- if (visible) {
- imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT);
- } else {
- imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0);
- }
- }
-}
diff --git a/chromium/content/shell/android/java/src/org/chromium/content_shell/ShellLayoutTestUtils.java b/chromium/content/shell/android/java/src/org/chromium/content_shell/ShellLayoutTestUtils.java
deleted file mode 100644
index 5ea2f77a5c6..00000000000
--- a/chromium/content/shell/android/java/src/org/chromium/content_shell/ShellLayoutTestUtils.java
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content_shell;
-
-import android.content.Context;
-
-import org.chromium.base.CalledByNative;
-import org.chromium.base.JNINamespace;
-
-/**
- * Utility methods used by content_shell for running Blink's layout tests on Android.
- */
-@JNINamespace("content")
-class ShellLayoutTestUtils {
- /**
- * @return The directory in which the test files, for example FIFOs, can be stored.
- */
- @SuppressWarnings("unused")
- @CalledByNative
- private static String getApplicationFilesDirectory(Context appContext) {
- return appContext.getFilesDir().getAbsolutePath();
- }
-}
diff --git a/chromium/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java b/chromium/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
deleted file mode 100644
index 2791442689f..00000000000
--- a/chromium/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content_shell;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.LayoutInflater;
-import android.widget.FrameLayout;
-
-import org.chromium.base.CalledByNative;
-import org.chromium.base.JNINamespace;
-import org.chromium.content.browser.ContentView;
-import org.chromium.content.browser.ContentViewRenderView;
-import org.chromium.ui.WindowAndroid;
-
-/**
- * Container and generator of ShellViews.
- */
-@JNINamespace("content")
-public class ShellManager extends FrameLayout {
-
- public static final String DEFAULT_SHELL_URL = "http://www.google.com";
- private static boolean sStartup = true;
- private WindowAndroid mWindow;
- private Shell mActiveShell;
-
- private String mStartupUrl = DEFAULT_SHELL_URL;
-
- // The target for all content rendering.
- private ContentViewRenderView mContentViewRenderView;
-
- /**
- * Constructor for inflating via XML.
- */
- public ShellManager(Context context, AttributeSet attrs) {
- super(context, attrs);
- nativeInit(this);
- mContentViewRenderView = new ContentViewRenderView(context) {
- @Override
- protected void onReadyToRender() {
- if (sStartup) {
- mActiveShell.loadUrl(mStartupUrl);
- sStartup = false;
- }
- }
- };
- }
-
- /**
- * @param window The window used to generate all shells.
- */
- public void setWindow(WindowAndroid window) {
- mWindow = window;
- }
-
- /**
- * @return The window used to generate all shells.
- */
- public WindowAndroid getWindow() {
- return mWindow;
- }
-
- /**
- * Sets the startup URL for new shell windows.
- */
- public void setStartupUrl(String url) {
- mStartupUrl = url;
- }
-
- /**
- * @return The currently visible shell view or null if one is not showing.
- */
- public Shell getActiveShell() {
- return mActiveShell;
- }
-
- /**
- * Creates a new shell pointing to the specified URL.
- * @param url The URL the shell should load upon creation.
- */
- public void launchShell(String url) {
- nativeLaunchShell(url);
- }
-
- @SuppressWarnings("unused")
- @CalledByNative
- private Object createShell() {
- LayoutInflater inflater =
- (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null);
- shellView.setWindow(mWindow);
-
- if (mActiveShell != null) closeShell(mActiveShell);
-
- shellView.setContentViewRenderView(mContentViewRenderView);
- addView(shellView, new FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
- mActiveShell = shellView;
- ContentView contentView = mActiveShell.getContentView();
- if (contentView != null) {
- mContentViewRenderView.setCurrentContentView(contentView);
- contentView.onShow();
- }
-
- return shellView;
- }
-
- @SuppressWarnings("unused")
- @CalledByNative
- private void closeShell(Shell shellView) {
- if (shellView == mActiveShell) mActiveShell = null;
- ContentView contentView = shellView.getContentView();
- if (contentView != null) contentView.onHide();
- shellView.setContentViewRenderView(null);
- shellView.setWindow(null);
- removeView(shellView);
- }
-
- private static native void nativeInit(Object shellManagerInstance);
- private static native void nativeLaunchShell(String url);
-}
diff --git a/chromium/content/shell/android/javatests/AndroidManifest.xml b/chromium/content/shell/android/javatests/AndroidManifest.xml
deleted file mode 100644
index 3f27e60c81a..00000000000
--- a/chromium/content/shell/android/javatests/AndroidManifest.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
- <!-- Copyright (c) 2012 The Chromium Authors. All rights reserved. Use of
- this source code is governed by a BSD-style license that can be found
- in the LICENSE file. -->
- <!-- package name must be unique so suffix with "tests" so package loader
- doesn't ignore this. -->
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="org.chromium.content_shell_apk.tests">
- <!-- We add an application tag here just so that we can indicate that this
- package needs to link against the android.test library, which is
- needed when building test cases. -->
- <application>
- <uses-library android:name="android.test.runner" />
- </application>
- <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
- <instrumentation android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="org.chromium.content_shell_apk"
- android:label="Tests for org.chromium.content_shell_apk"/>
- <uses-permission android:name="android.permission.RUN_INSTRUMENTATION" />
- <uses-permission android:name="android.permission.INJECT_EVENTS" />
-</manifest>
diff --git a/chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java b/chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java
deleted file mode 100644
index 489f78135c8..00000000000
--- a/chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content_shell_apk;
-
-import android.content.Context;
-import android.os.PowerManager;
-import android.test.suitebuilder.annotation.Smoke;
-
-import org.chromium.base.test.util.Feature;
-
-/**
- * Test that verifies preconditions for tests to run.
- */
-public class ContentShellPreconditionsTest extends ContentShellTestBase {
- @Smoke
- @Feature({"TestInfrastructure"})
- public void testScreenIsOn() throws Exception {
- PowerManager pm = (PowerManager) getInstrumentation().getContext().getSystemService(
- Context.POWER_SERVICE);
-
- assertTrue("Many tests will fail if the screen is not on.", pm.isScreenOn());
- }
-}
diff --git a/chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java b/chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java
deleted file mode 100644
index 0ce8a7f67e3..00000000000
--- a/chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java
+++ /dev/null
@@ -1,204 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content_shell_apk;
-
-import android.content.ComponentName;
-import android.content.Intent;
-import android.net.Uri;
-import android.test.ActivityInstrumentationTestCase2;
-import android.text.TextUtils;
-
-import org.chromium.base.test.util.UrlUtils;
-import org.chromium.content.browser.ContentView;
-import org.chromium.content.browser.ContentViewCore;
-import org.chromium.content.browser.LoadUrlParams;
-import org.chromium.content.browser.test.util.CallbackHelper;
-import org.chromium.content.browser.test.util.Criteria;
-import org.chromium.content.browser.test.util.CriteriaHelper;
-import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
-import org.chromium.content_shell.Shell;
-
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * Base test class for all ContentShell based tests.
- */
-public class ContentShellTestBase extends ActivityInstrumentationTestCase2<ContentShellActivity> {
-
- /** The maximum time the waitForActiveShellToBeDoneLoading method will wait. */
- private static final long WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT = 10000;
-
- protected static final int WAIT_PAGE_LOADING_TIMEOUT_SECONDS = 15;
-
- public ContentShellTestBase() {
- super(ContentShellActivity.class);
- }
-
- /**
- * Starts the ContentShell activity and loads the given URL.
- * The URL can be null, in which case will default to ContentShellActivity.DEFAULT_SHELL_URL.
- */
- protected ContentShellActivity launchContentShellWithUrl(String url) {
- return launchContentShellWithUrlAndCommandLineArgs(url, null);
- }
-
- /**
- * Starts the ContentShell activity appending the provided command line arguments
- * and loads the given URL. The URL can be null, in which case will default to
- * ContentShellActivity.DEFAULT_SHELL_URL.
- */
- protected ContentShellActivity launchContentShellWithUrlAndCommandLineArgs(String url,
- String[] commandLineArgs) {
- Intent intent = new Intent(Intent.ACTION_MAIN);
- intent.addCategory(Intent.CATEGORY_LAUNCHER);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- if (url != null) intent.setData(Uri.parse(url));
- intent.setComponent(new ComponentName(getInstrumentation().getTargetContext(),
- ContentShellActivity.class));
- if (commandLineArgs != null) {
- intent.putExtra(ContentShellActivity.COMMAND_LINE_ARGS_KEY, commandLineArgs);
- }
- setActivityIntent(intent);
- return getActivity();
- }
-
- // TODO(cjhopman): These functions are inconsistent with launchContentShell***. Should be
- // startContentShell*** and should use the url exactly without the getTestFileUrl call. Possibly
- // these two ways of starting the activity (launch* and start*) should be merged into one.
- /**
- * Starts the content shell activity with the provided test url.
- * The url is synchronously loaded.
- * @param url Test url to load.
- */
- protected void startActivityWithTestUrl(String url) throws Throwable {
- launchContentShellWithUrl(UrlUtils.getTestFileUrl(url));
- assertNotNull(getActivity());
- assertTrue(waitForActiveShellToBeDoneLoading());
- assertEquals(UrlUtils.getTestFileUrl(url), getContentView().getUrl());
- }
-
- /**
- * Starts the content shell activity with the provided test url and optional command line
- * arguments to append.
- * The url is synchronously loaded.
- * @param url Test url to load.
- * @param commandLineArgs Optional command line args to append when launching the activity.
- */
- protected void startActivityWithTestUrlAndCommandLineArgs(
- String url, String[] commandLineArgs) throws Throwable {
- launchContentShellWithUrlAndCommandLineArgs(
- UrlUtils.getTestFileUrl(url), commandLineArgs);
- assertNotNull(getActivity());
- assertTrue(waitForActiveShellToBeDoneLoading());
- }
-
- /**
- * Returns the current ContentView.
- */
- protected ContentView getContentView() {
- return getActivity().getActiveShell().getContentView();
- }
-
- /**
- * Returns the current ContentViewCore or null if there is no ContentView.
- */
- protected ContentViewCore getContentViewCore() {
- return getContentView() == null ? null : getContentView().getContentViewCore();
- }
-
- /**
- * Waits for the Active shell to finish loading. This times out after
- * WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT milliseconds and it shouldn't be used for long
- * loading pages. Instead it should be used more for test initialization. The proper way
- * to wait is to use a TestCallbackHelperContainer after the initial load is completed.
- * @return Whether or not the Shell was actually finished loading.
- * @throws InterruptedException
- */
- protected boolean waitForActiveShellToBeDoneLoading() throws InterruptedException {
- final ContentShellActivity activity = getActivity();
-
- // Wait for the Content Shell to be initialized.
- return CriteriaHelper.pollForCriteria(new Criteria() {
- @Override
- public boolean isSatisfied() {
- try {
- final AtomicBoolean isLoaded = new AtomicBoolean(false);
- runTestOnUiThread(new Runnable() {
- @Override
- public void run() {
- Shell shell = activity.getActiveShell();
- if (shell != null) {
- // There are two cases here that need to be accounted for.
- // The first is that we've just created a Shell and it isn't
- // loading because it has no URL set yet. The second is that
- // we've set a URL and it actually is loading.
- isLoaded.set(!shell.isLoading()
- && !TextUtils.isEmpty(shell.getContentView().getUrl()));
- } else {
- isLoaded.set(false);
- }
- }
- });
-
- return isLoaded.get();
- } catch (Throwable e) {
- return false;
- }
- }
- }, WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT, CriteriaHelper.DEFAULT_POLLING_INTERVAL);
- }
-
- /**
- * Loads a URL in the specified content view.
- *
- * @param contentView The content view to load the URL in.
- * @param callbackHelperContainer The callback helper container used to monitor progress.
- * @param params The URL params to use.
- */
- protected void loadUrl(
- final ContentView contentView, TestCallbackHelperContainer callbackHelperContainer,
- final LoadUrlParams params) throws Throwable {
- handleBlockingCallbackAction(
- callbackHelperContainer.getOnPageFinishedHelper(),
- new Runnable() {
- @Override
- public void run() {
- contentView.loadUrl(params);
- }
- });
- }
-
- /**
- * Handles performing an action on the UI thread that will return when the specified callback
- * is incremented.
- *
- * @param callbackHelper The callback helper that will be blocked on.
- * @param action The action to be performed on the UI thread.
- */
- protected void handleBlockingCallbackAction(
- CallbackHelper callbackHelper, Runnable action) throws Throwable {
- int currentCallCount = callbackHelper.getCallCount();
- runTestOnUiThread(action);
- callbackHelper.waitForCallback(
- currentCallCount, 1, WAIT_PAGE_LOADING_TIMEOUT_SECONDS, TimeUnit.SECONDS);
- }
-
- // TODO(aelias): This method needs to be removed once http://crbug.com/179511 is fixed.
- // Meanwhile, we have to wait if the page has the <meta viewport> tag.
- /**
- * Waits till the ContentViewCore receives the expected page scale factor
- * from the compositor and asserts that this happens.
- */
- protected void assertWaitForPageScaleFactorMatch(final float expectedScale)
- throws InterruptedException {
- assertTrue(CriteriaHelper.pollForCriteria(new Criteria() {
- @Override
- public boolean isSatisfied() {
- return getContentViewCore().getScale() == expectedScale;
- }
- }));
- }
-}
diff --git a/chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellUrlTest.java b/chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellUrlTest.java
deleted file mode 100644
index c5b0089addb..00000000000
--- a/chromium/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellUrlTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content_shell_apk;
-
-import android.test.suitebuilder.annotation.SmallTest;
-
-import org.chromium.base.test.util.Feature;
-import org.chromium.content_shell_apk.ContentShellActivity;
-
-/**
- * Example test that just starts the content shell.
- */
-public class ContentShellUrlTest extends ContentShellTestBase {
- // URL used for base tests.
- private static final String URL = "data:text";
-
- @SmallTest
- @Feature({"Main"})
- public void testBaseStartup() throws Exception {
- ContentShellActivity activity = launchContentShellWithUrl(URL);
-
- // Make sure the activity was created as expected.
- assertNotNull(activity);
-
- // Make sure that the URL is set as expected.
- assertEquals(URL, activity.getActiveShell().getContentView().getUrl());
- }
-}
diff --git a/chromium/content/shell/android/shell_apk/AndroidManifest.xml b/chromium/content/shell/android/shell_apk/AndroidManifest.xml
index 68fac8fbede..383c7d027e9 100644
--- a/chromium/content/shell/android/shell_apk/AndroidManifest.xml
+++ b/chromium/content/shell/android/shell_apk/AndroidManifest.xml
@@ -13,7 +13,8 @@
android:protectionLevel="signature" />
<application android:name="ContentShellApplication"
- android:label="ContentShell">
+ android:icon="@mipmap/app_icon"
+ android:label="Content Shell">
<activity android:name="ContentShellActivity"
android:launchMode="singleTask"
android:theme="@android:style/Theme.Holo.Light.NoActionBar"
diff --git a/chromium/content/shell/android/java/res/values/strings.xml b/chromium/content/shell/android/shell_apk/res/values/strings.xml
index 6eaaaec2979..18f1c595f13 100644
--- a/chromium/content/shell/android/java/res/values/strings.xml
+++ b/chromium/content/shell/android/shell_apk/res/values/strings.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
+<!-- Copyright 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<resources>
- <string name="url_hint">Type URL Here</string>
+ <string name="browser_process_initialization_failed">Initialization failed.</string>
</resources>
diff --git a/chromium/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java b/chromium/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
deleted file mode 100644
index 3f7ceb08898..00000000000
--- a/chromium/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
+++ /dev/null
@@ -1,266 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content_shell_apk;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.os.Bundle;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.KeyEvent;
-
-import org.chromium.base.ChromiumActivity;
-import org.chromium.base.MemoryPressureListener;
-import org.chromium.content.app.LibraryLoader;
-import org.chromium.content.browser.ActivityContentVideoViewClient;
-import org.chromium.content.browser.AndroidBrowserProcess;
-import org.chromium.content.browser.BrowserStartupConfig;
-import org.chromium.content.browser.ContentVideoViewClient;
-import org.chromium.content.browser.ContentView;
-import org.chromium.content.browser.ContentViewClient;
-import org.chromium.content.browser.DeviceUtils;
-import org.chromium.content.browser.TracingIntentHandler;
-import org.chromium.content.common.CommandLine;
-import org.chromium.content.common.ProcessInitException;
-import org.chromium.content_shell.Shell;
-import org.chromium.content_shell.ShellManager;
-import org.chromium.ui.WindowAndroid;
-
-/**
- * Activity for managing the Content Shell.
- */
-public class ContentShellActivity extends ChromiumActivity {
-
- public static final String COMMAND_LINE_FILE = "/data/local/tmp/content-shell-command-line";
- private static final String TAG = "ContentShellActivity";
-
- private static final String ACTIVE_SHELL_URL_KEY = "activeUrl";
- private static final String ACTION_START_TRACE =
- "org.chromium.content_shell.action.PROFILE_START";
- private static final String ACTION_STOP_TRACE =
- "org.chromium.content_shell.action.PROFILE_STOP";
- public static final String COMMAND_LINE_ARGS_KEY = "commandLineArgs";
-
- /**
- * Sending an intent with this action will simulate a memory pressure signal
- * at a critical level.
- */
- private static final String ACTION_LOW_MEMORY =
- "org.chromium.content_shell.action.ACTION_LOW_MEMORY";
-
- /**
- * Sending an intent with this action will simulate a memory pressure signal
- * at a moderate level.
- */
- private static final String ACTION_TRIM_MEMORY_MODERATE =
- "org.chromium.content_shell.action.ACTION_TRIM_MEMORY_MODERATE";
-
-
- private ShellManager mShellManager;
- private WindowAndroid mWindowAndroid;
- private BroadcastReceiver mReceiver;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- // Initializing the command line must occur before loading the library.
- if (!CommandLine.isInitialized()) {
- CommandLine.initFromFile(COMMAND_LINE_FILE);
- String[] commandLineParams = getCommandLineParamsFromIntent(getIntent());
- if (commandLineParams != null) {
- CommandLine.getInstance().appendSwitchesAndArguments(commandLineParams);
- }
- }
- waitForDebuggerIfNeeded();
-
- DeviceUtils.addDeviceSpecificUserAgentSwitch(this);
- try {
- LibraryLoader.ensureInitialized();
-
- setContentView(R.layout.content_shell_activity);
- mShellManager = (ShellManager) findViewById(R.id.shell_container);
- mWindowAndroid = new WindowAndroid(this);
- mWindowAndroid.restoreInstanceState(savedInstanceState);
- mShellManager.setWindow(mWindowAndroid);
-
- String startupUrl = getUrlFromIntent(getIntent());
- if (!TextUtils.isEmpty(startupUrl)) {
- mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl));
- }
-
- if (!CommandLine.getInstance().hasSwitch(CommandLine.DUMP_RENDER_TREE)) {
- BrowserStartupConfig.setAsync(new BrowserStartupConfig.StartupCallback() {
-
- @Override
- public void run(int startupResult) {
- if (startupResult > 0) {
- // TODO: Show error message.
- Log.e(TAG, "ContentView initialization failed.");
- finish();
- } else {
- finishInitialization();
- }
- }
- });
- }
-
- if (!AndroidBrowserProcess.init(this, AndroidBrowserProcess.MAX_RENDERERS_LIMIT)) {
- String shellUrl = ShellManager.DEFAULT_SHELL_URL;
- if (savedInstanceState != null
- && savedInstanceState.containsKey(ACTIVE_SHELL_URL_KEY)) {
- shellUrl = savedInstanceState.getString(ACTIVE_SHELL_URL_KEY);
- }
- mShellManager.launchShell(shellUrl);
- finishInitialization();
- }
- } catch (ProcessInitException e) {
- Log.e(TAG, "ContentView initialization failed.", e);
- finish();
- }
- }
-
- private void finishInitialization() {
- getActiveContentView().setContentViewClient(new ContentViewClient() {
- @Override
- public ContentVideoViewClient getContentVideoViewClient() {
- return new ActivityContentVideoViewClient(ContentShellActivity.this);
- }
- });
- }
-
- @Override
- protected void onSaveInstanceState(Bundle outState) {
- super.onSaveInstanceState(outState);
- Shell activeShell = getActiveShell();
- if (activeShell != null) {
- outState.putString(ACTIVE_SHELL_URL_KEY, activeShell.getContentView().getUrl());
- }
-
- mWindowAndroid.saveInstanceState(outState);
- }
-
- private void waitForDebuggerIfNeeded() {
- if (CommandLine.getInstance().hasSwitch(CommandLine.WAIT_FOR_JAVA_DEBUGGER)) {
- Log.e(TAG, "Waiting for Java debugger to connect...");
- android.os.Debug.waitForDebugger();
- Log.e(TAG, "Java debugger connected. Resuming execution.");
- }
- }
-
- @Override
- public boolean onKeyUp(int keyCode, KeyEvent event) {
- if (keyCode != KeyEvent.KEYCODE_BACK) return super.onKeyUp(keyCode, event);
-
- Shell activeView = getActiveShell();
- if (activeView != null && activeView.getContentView().canGoBack()) {
- activeView.getContentView().goBack();
- return true;
- }
-
- return super.onKeyUp(keyCode, event);
- }
-
- @Override
- protected void onNewIntent(Intent intent) {
- if (getCommandLineParamsFromIntent(intent) != null) {
- Log.i(TAG, "Ignoring command line params: can only be set when creating the activity.");
- }
-
- if (ACTION_LOW_MEMORY.equals(intent.getAction())) {
- MemoryPressureListener.simulateMemoryPressureSignal(TRIM_MEMORY_COMPLETE);
- return;
- } else if (ACTION_TRIM_MEMORY_MODERATE.equals(intent.getAction())) {
- MemoryPressureListener.simulateMemoryPressureSignal(TRIM_MEMORY_MODERATE);
- return;
- }
-
- String url = getUrlFromIntent(intent);
- if (!TextUtils.isEmpty(url)) {
- Shell activeView = getActiveShell();
- if (activeView != null) {
- activeView.loadUrl(url);
- }
- }
- }
-
- @Override
- protected void onPause() {
- ContentView view = getActiveContentView();
- if (view != null) view.onActivityPause();
-
- super.onPause();
- unregisterReceiver(mReceiver);
- }
-
- @Override
- protected void onResume() {
- super.onResume();
-
- ContentView view = getActiveContentView();
- if (view != null) view.onActivityResume();
- IntentFilter intentFilter = new IntentFilter(ACTION_START_TRACE);
- intentFilter.addAction(ACTION_STOP_TRACE);
- mReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
- String extra = intent.getStringExtra("file");
- if (ACTION_START_TRACE.equals(action)) {
- if (extra.isEmpty()) {
- Log.e(TAG, "Can not start tracing without specifing saving location");
- } else {
- TracingIntentHandler.beginTracing(extra);
- Log.i(TAG, "start tracing");
- }
- } else if (ACTION_STOP_TRACE.equals(action)) {
- Log.i(TAG, "stop tracing");
- TracingIntentHandler.endTracing();
- }
- }
- };
- registerReceiver(mReceiver, intentFilter);
- }
-
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- mWindowAndroid.onActivityResult(requestCode, resultCode, data);
- }
-
- private static String getUrlFromIntent(Intent intent) {
- return intent != null ? intent.getDataString() : null;
- }
-
- private static String[] getCommandLineParamsFromIntent(Intent intent) {
- return intent != null ? intent.getStringArrayExtra(COMMAND_LINE_ARGS_KEY) : null;
- }
-
- /**
- * @return The {@link ShellManager} configured for the activity or null if it has not been
- * created yet.
- */
- public ShellManager getShellManager() {
- return mShellManager;
- }
-
- /**
- * @return The currently visible {@link Shell} or null if one is not showing.
- */
- public Shell getActiveShell() {
- return mShellManager != null ? mShellManager.getActiveShell() : null;
- }
-
- /**
- * @return The {@link ContentView} owned by the currently visible {@link Shell} or null if one
- * is not showing.
- */
- public ContentView getActiveContentView() {
- Shell shell = getActiveShell();
- return shell != null ? shell.getContentView() : null;
- }
-}
diff --git a/chromium/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java b/chromium/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java
deleted file mode 100644
index ddbe76f6966..00000000000
--- a/chromium/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content_shell_apk;
-
-import android.app.Application;
-
-import org.chromium.base.PathUtils;
-import org.chromium.content.app.LibraryLoader;
-import org.chromium.content.browser.ResourceExtractor;
-
-/**
- * Entry point for the content shell application. Handles initialization of information that needs
- * to be shared across the main activity and the child services created.
- */
-public class ContentShellApplication extends Application {
-
- private static final String[] MANDATORY_PAK_FILES = new String[] {"content_shell.pak"};
- private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "content_shell";
-
- @Override
- public void onCreate() {
- super.onCreate();
- initializeApplicationParameters();
- }
-
- public static void initializeApplicationParameters() {
- ResourceExtractor.setMandatoryPaksToExtract(MANDATORY_PAK_FILES);
- PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
- }
-
-}
diff --git a/chromium/content/shell/android/shell_jni_registrar.cc b/chromium/content/shell/android/shell_jni_registrar.cc
deleted file mode 100644
index 504eda713cc..00000000000
--- a/chromium/content/shell/android/shell_jni_registrar.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/shell/android/shell_jni_registrar.h"
-
-#include "base/android/jni_android.h"
-#include "base/android/jni_registrar.h"
-#include "content/shell/android/shell_manager.h"
-#include "content/shell/shell.h"
-
-namespace {
-
-static base::android::RegistrationMethod kShellRegistrationMethods[] = {
- { "Shell", content::Shell::Register },
- { "ShellManager", content::RegisterShellManager },
-};
-
-} // namespace
-
-namespace content {
-namespace android {
-
-bool RegisterShellJni(JNIEnv* env) {
- return RegisterNativeMethods(env, kShellRegistrationMethods,
- arraysize(kShellRegistrationMethods));
-}
-
-} // namespace android
-} // namespace content
diff --git a/chromium/content/shell/android/shell_jni_registrar.h b/chromium/content/shell/android/shell_jni_registrar.h
deleted file mode 100644
index f336c525519..00000000000
--- a/chromium/content/shell/android/shell_jni_registrar.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_SHELL_ANDROID_SHELL_JNI_REGISTRAR_H_
-#define CONTENT_SHELL_ANDROID_SHELL_JNI_REGISTRAR_H_
-
-#include <jni.h>
-
-namespace content {
-namespace android {
-
-// Register all JNI bindings necessary for content shell.
-bool RegisterShellJni(JNIEnv* env);
-
-} // namespace android
-} // namespace content
-
-#endif // CONTENT_SHELL_ANDROID_SHELL_JNI_REGISTRAR_H_
diff --git a/chromium/content/shell/android/shell_manager.cc b/chromium/content/shell/android/shell_manager.cc
index 08df6a4cd75..9dbd46df5df 100644
--- a/chromium/content/shell/android/shell_manager.cc
+++ b/chromium/content/shell/android/shell_manager.cc
@@ -10,9 +10,9 @@
#include "base/bind.h"
#include "base/lazy_instance.h"
#include "content/public/browser/web_contents.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_content_browser_client.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_content_browser_client.h"
#include "jni/ShellManager_jni.h"
#include "url/gurl.h"
diff --git a/chromium/content/shell/app/shell_main_delegate.cc b/chromium/content/shell/app/shell_main_delegate.cc
index b5adadb1769..b5fbb8eccb8 100644
--- a/chromium/content/shell/app/shell_main_delegate.cc
+++ b/chromium/content/shell/app/shell_main_delegate.cc
@@ -14,14 +14,15 @@
#include "content/public/common/url_constants.h"
#include "content/public/test/layouttest_support.h"
#include "content/shell/app/webkit_test_platform_support.h"
+#include "content/shell/browser/shell_browser_main.h"
+#include "content/shell/browser/shell_content_browser_client.h"
#include "content/shell/common/shell_switches.h"
#include "content/shell/renderer/shell_content_renderer_client.h"
-#include "content/shell/shell_browser_main.h"
-#include "content/shell/shell_content_browser_client.h"
#include "net/cookies/cookie_monster.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
+#include "ui/gfx/switches.h"
#include "ui/gl/gl_switches.h"
#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED.
@@ -124,9 +125,6 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
switches::kUseGL, gfx::kGLImplementationOSMesaName);
#endif
command_line.AppendSwitch(switches::kSkipGpuDataLoading);
- command_line.AppendSwitch(switches::kDisableGpuVsync);
- command_line.AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures);
- command_line.AppendSwitch(switches::kEnableCssShaders);
command_line.AppendSwitchASCII(switches::kTouchEvents,
switches::kTouchEventsEnabled);
command_line.AppendSwitch(switches::kEnableGestureTapHighlight);
@@ -139,6 +137,12 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
command_line.AppendSwitch(cc::switches::kDisableImplSidePainting);
#endif
+ if (!command_line.HasSwitch(switches::kStableReleaseMode)) {
+ command_line.AppendSwitch(
+ switches::kEnableExperimentalWebPlatformFeatures);
+ command_line.AppendSwitch(switches::kEnableCssShaders);
+ }
+
if (!command_line.HasSwitch(switches::kEnableThreadedCompositing))
command_line.AppendSwitch(cc::switches::kDisableThreadedAnimation);
diff --git a/chromium/content/shell/app/webkit_test_platform_support_win.cc b/chromium/content/shell/app/webkit_test_platform_support_win.cc
index 14d2a0e622b..59156fe891c 100644
--- a/chromium/content/shell/app/webkit_test_platform_support_win.cc
+++ b/chromium/content/shell/app/webkit_test_platform_support_win.cc
@@ -35,7 +35,7 @@ bool SetupFonts() {
base_path.Append(FILE_PATH_LITERAL("/AHEM____.TTF"));
std::string font_buffer;
- if (!file_util::ReadFileToString(font_path, &font_buffer)) {
+ if (!base::ReadFileToString(font_path, &font_buffer)) {
std::cerr << "Failed to load font " << WideToUTF8(font_path.value())
<< "\n";
return false;
diff --git a/chromium/content/shell/minimal_shell.cc b/chromium/content/shell/browser/minimal_shell.cc
index 2e9079ed83e..e7e88f8ab94 100644
--- a/chromium/content/shell/minimal_shell.cc
+++ b/chromium/content/shell/browser/minimal_shell.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/minimal_shell.h"
+#include "content/shell/browser/minimal_shell.h"
#include "ui/aura/client/default_capture_client.h"
#include "ui/aura/focus_manager.h"
diff --git a/chromium/content/shell/minimal_shell.h b/chromium/content/shell/browser/minimal_shell.h
index b2ab9eb931b..1388da964b3 100644
--- a/chromium/content/shell/minimal_shell.h
+++ b/chromium/content/shell/browser/minimal_shell.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_MINIMAL_SHELL_H_
-#define CONTENT_SHELL_MINIMAL_SHELL_H_
+#ifndef CONTENT_SHELL_BROWSER_MINIMAL_SHELL_H_
+#define CONTENT_SHELL_BROWSER_MINIMAL_SHELL_H_
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
@@ -64,4 +64,4 @@ class MinimalShell : public aura::client::StackingClient {
} // namespace content;
-#endif // CONTENT_SHELL_MINIMAL_SHELL_H_
+#endif // CONTENT_SHELL_BROWSER_MINIMAL_SHELL_H_
diff --git a/chromium/content/shell/notify_done_forwarder.cc b/chromium/content/shell/browser/notify_done_forwarder.cc
index 522138ebb8f..6d8f1041965 100644
--- a/chromium/content/shell/notify_done_forwarder.cc
+++ b/chromium/content/shell/browser/notify_done_forwarder.cc
@@ -1,11 +1,11 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/notify_done_forwarder.h"
+#include "content/shell/browser/notify_done_forwarder.h"
+#include "content/shell/browser/webkit_test_controller.h"
#include "content/shell/common/shell_messages.h"
-#include "content/shell/webkit_test_controller.h"
namespace content {
diff --git a/chromium/content/shell/notify_done_forwarder.h b/chromium/content/shell/browser/notify_done_forwarder.h
index 008371a55bb..e5a2f3f7800 100644
--- a/chromium/content/shell/notify_done_forwarder.h
+++ b/chromium/content/shell/browser/notify_done_forwarder.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_NOTIFY_DONE_FORWARDER_H_
-#define CONTENT_SHELL_NOTIFY_DONE_FORWARDER_H_
+#ifndef CONTENT_SHELL_BROWSER_NOTIFY_DONE_FORWARDER_H_
+#define CONTENT_SHELL_BROWSER_NOTIFY_DONE_FORWARDER_H_
#include "base/basictypes.h"
#include "content/public/browser/web_contents_observer.h"
@@ -31,4 +31,4 @@ class NotifyDoneForwarder : public WebContentsObserver,
} // namespace content
-#endif // CONTENT_SHELL_NOTIFY_DONE_FORWARDER_H_
+#endif // CONTENT_SHELL_BROWSER_NOTIFY_DONE_FORWARDER_H_
diff --git a/chromium/content/shell/shell.cc b/chromium/content/shell/browser/shell.cc
index 0fadcf8d416..df096555b42 100644
--- a/chromium/content/shell/shell.cc
+++ b/chromium/content/shell/browser/shell.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell.h"
+#include "content/shell/browser/shell.h"
#include "base/auto_reset.h"
#include "base/command_line.h"
@@ -23,14 +23,14 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/renderer_preferences.h"
+#include "content/shell/browser/notify_done_forwarder.h"
+#include "content/shell/browser/shell_browser_main_parts.h"
+#include "content/shell/browser/shell_content_browser_client.h"
+#include "content/shell/browser/shell_devtools_frontend.h"
+#include "content/shell/browser/shell_javascript_dialog_manager.h"
+#include "content/shell/browser/webkit_test_controller.h"
#include "content/shell/common/shell_messages.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/notify_done_forwarder.h"
-#include "content/shell/shell_browser_main_parts.h"
-#include "content/shell/shell_content_browser_client.h"
-#include "content/shell/shell_devtools_frontend.h"
-#include "content/shell/shell_javascript_dialog_manager.h"
-#include "content/shell/webkit_test_controller.h"
namespace content {
@@ -230,8 +230,9 @@ gfx::NativeView Shell::GetContentView() {
WebContents* Shell::OpenURLFromTab(WebContents* source,
const OpenURLParams& params) {
- // The only one we implement for now.
- DCHECK(params.disposition == CURRENT_TAB);
+ // CURRENT_TAB is the only one we implement for now.
+ if (params.disposition != CURRENT_TAB)
+ return NULL;
NavigationController::LoadURLParams load_url_params(params.url);
load_url_params.referrer = params.referrer;
load_url_params.transition_type = params.transition;
@@ -306,7 +307,7 @@ void Shell::WebContentsCreated(WebContents* source_contents,
}
void Shell::DidNavigateMainFramePostCommit(WebContents* web_contents) {
- PlatformSetAddressBarURL(web_contents->GetURL());
+ PlatformSetAddressBarURL(web_contents->GetLastCommittedURL());
}
JavaScriptDialogManager* Shell::GetJavaScriptDialogManager() {
diff --git a/chromium/content/shell/shell.h b/chromium/content/shell/browser/shell.h
index 8666aec64d5..24c58c81a17 100644
--- a/chromium/content/shell/shell.h
+++ b/chromium/content/shell/browser/shell.h
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_H_
-#define CONTENT_SHELL_SHELL_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_H_
+#define CONTENT_SHELL_BROWSER_SHELL_H_
#include <vector>
@@ -283,4 +283,4 @@ class Shell : public WebContentsDelegate,
} // namespace content
-#endif // CONTENT_SHELL_SHELL_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_H_
diff --git a/chromium/content/shell/shell_android.cc b/chromium/content/shell/browser/shell_android.cc
index d12d0d7a09e..d827e96b07e 100644
--- a/chromium/content/shell/shell_android.cc
+++ b/chromium/content/shell/browser/shell_android.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell.h"
+#include "content/shell/browser/shell.h"
#include <jni.h>
diff --git a/chromium/content/shell/shell_application_mac.h b/chromium/content/shell/browser/shell_application_mac.h
index 26718ac6174..bcba5a5ae67 100644
--- a/chromium/content/shell/shell_application_mac.h
+++ b/chromium/content/shell/browser/shell_application_mac.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_APPLICATION_MAC_H_
-#define CONTENT_SHELL_SHELL_APPLICATION_MAC_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_APPLICATION_MAC_H_
+#define CONTENT_SHELL_BROWSER_SHELL_APPLICATION_MAC_H_
#include "base/mac/scoped_sending_event.h"
#include "base/message_loop/message_pump_mac.h"
@@ -24,4 +24,4 @@
@end
-#endif // CONTENT_SHELL_SHELL_APPLICATION_MAC_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_APPLICATION_MAC_H_
diff --git a/chromium/content/shell/shell_application_mac.mm b/chromium/content/shell/browser/shell_application_mac.mm
index 8300ebf33c0..e18df5b67cf 100644
--- a/chromium/content/shell/shell_application_mac.mm
+++ b/chromium/content/shell/browser/shell_application_mac.mm
@@ -1,14 +1,14 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_application_mac.h"
+#include "content/shell/browser/shell_application_mac.h"
#include "base/auto_reset.h"
#include "content/public/common/url_constants.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_content_browser_client.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_content_browser_client.h"
#include "url/gurl.h"
@implementation ShellCrApplication
diff --git a/chromium/content/shell/shell_aura.cc b/chromium/content/shell/browser/shell_aura.cc
index b7bf5d050d4..da8460edd05 100644
--- a/chromium/content/shell/shell_aura.cc
+++ b/chromium/content/shell/browser/shell_aura.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell.h"
+#include "content/shell/browser/shell.h"
#include "base/command_line.h"
#include "base/strings/utf_string_conversions.h"
@@ -13,8 +13,8 @@
#include "ui/aura/window.h"
#include "ui/base/accessibility/accessibility_types.h"
#include "ui/base/clipboard/clipboard.h"
-#include "ui/base/events/event.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/events/event.h"
#include "ui/gfx/screen.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/textfield/textfield.h"
@@ -30,10 +30,15 @@
#if defined(OS_CHROMEOS)
#include "chromeos/dbus/dbus_thread_manager.h"
-#include "content/shell/minimal_shell.h"
+#include "content/shell/browser/minimal_shell.h"
#include "ui/aura/test/test_screen.h"
#endif
+#if defined(OS_WIN)
+#include <fcntl.h>
+#include <io.h>
+#endif
+
namespace content {
namespace {
@@ -279,6 +284,10 @@ views::ViewsDelegate* Shell::views_delegate_ = NULL;
// static
void Shell::PlatformInitialize(const gfx::Size& default_window_size) {
+#if defined(OS_WIN)
+ _setmode(_fileno(stdout), _O_BINARY);
+ _setmode(_fileno(stderr), _O_BINARY);
+#endif
#if defined(OS_CHROMEOS)
chromeos::DBusThreadManager::Initialize();
gfx::Screen::SetScreenInstance(
@@ -292,6 +301,11 @@ void Shell::PlatformInitialize(const gfx::Size& default_window_size) {
}
void Shell::PlatformExit() {
+ std::vector<Shell*> windows = windows_;
+ for (std::vector<Shell*>::iterator it = windows.begin();
+ it != windows.end(); ++it) {
+ (*it)->window_widget_->Close();
+ }
#if defined(OS_CHROMEOS)
if (minimal_shell_)
delete minimal_shell_;
@@ -361,7 +375,7 @@ void Shell::PlatformResizeSubViews() {
}
void Shell::Close() {
- window_widget_->Close();
+ window_widget_->CloseNow();
}
void Shell::PlatformSetTitle(const string16& title) {
diff --git a/chromium/content/shell/shell_browser_context.cc b/chromium/content/shell/browser/shell_browser_context.cc
index 1c8935507bf..c6dbb9940cb 100644
--- a/chromium/content/shell/shell_browser_context.cc
+++ b/chromium/content/shell/browser/shell_browser_context.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_browser_context.h"
+#include "content/shell/browser/shell_browser_context.h"
#include "base/bind.h"
#include "base/command_line.h"
@@ -15,9 +15,9 @@
#include "content/public/browser/resource_context.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_switches.h"
+#include "content/shell/browser/shell_download_manager_delegate.h"
+#include "content/shell/browser/shell_url_request_context_getter.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/shell_download_manager_delegate.h"
-#include "content/shell/shell_url_request_context_getter.h"
#if defined(OS_WIN)
#include "base/base_paths_win.h"
diff --git a/chromium/content/shell/shell_browser_context.h b/chromium/content/shell/browser/shell_browser_context.h
index 640f2374256..ec7159166df 100644
--- a/chromium/content/shell/shell_browser_context.h
+++ b/chromium/content/shell/browser/shell_browser_context.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_
-#define CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_
+#define CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
@@ -80,4 +80,4 @@ class ShellBrowserContext : public BrowserContext {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_
diff --git a/chromium/content/shell/shell_browser_main.cc b/chromium/content/shell/browser/shell_browser_main.cc
index d4d65a33d6c..8e61f6a6b7c 100644
--- a/chromium/content/shell/shell_browser_main.cc
+++ b/chromium/content/shell/browser/shell_browser_main.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_browser_main.h"
+#include "content/shell/browser/shell_browser_main.h"
#include <iostream>
@@ -17,16 +17,16 @@
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/browser_main_runner.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/webkit_test_controller.h"
#include "content/shell/common/shell_switches.h"
#include "content/shell/common/webkit_test_helpers.h"
-#include "content/shell/shell.h"
-#include "content/shell/webkit_test_controller.h"
+#include "content/test/webkit_support.h"
#include "net/base/net_util.h"
-#include "webkit/support/webkit_support.h"
#if defined(OS_ANDROID)
#include "base/run_loop.h"
-#include "content/shell/shell_layout_tests_android.h"
+#include "content/shell/browser/shell_layout_tests_android.h"
#endif
namespace {
@@ -194,12 +194,24 @@ int ShellBrowserMain(
if (!content::WebKitTestController::Get()->ResetAfterLayoutTest())
break;
+
+#if defined(OS_ANDROID)
+ // There will be left-over tasks in the queue for Android because the
+ // main window is being destroyed. Run them before starting the next test.
+ base::MessageLoop::current()->RunUntilIdle();
+#endif
}
if (!ran_at_least_once) {
base::MessageLoop::current()->PostTask(FROM_HERE,
base::MessageLoop::QuitClosure());
main_runner->Run();
}
+
+#if defined(OS_ANDROID)
+ // Android should only execute Shutdown() here when running layout tests.
+ main_runner->Shutdown();
+#endif
+
exit_code = 0;
}
diff --git a/chromium/content/shell/shell_browser_main.h b/chromium/content/shell/browser/shell_browser_main.h
index 7fe5908e591..d361fa3e4de 100644
--- a/chromium/content/shell/shell_browser_main.h
+++ b/chromium/content/shell/browser/shell_browser_main.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_BROWSER_MAIN_H_
-#define CONTENT_SHELL_SHELL_BROWSER_MAIN_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_BROWSER_MAIN_H_
+#define CONTENT_SHELL_BROWSER_SHELL_BROWSER_MAIN_H_
#include "base/memory/scoped_ptr.h"
@@ -16,4 +16,4 @@ int ShellBrowserMain(
const content::MainFunctionParams& parameters,
const scoped_ptr<content::BrowserMainRunner>& main_runner);
-#endif // CONTENT_SHELL_SHELL_BROWSER_MAIN_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_BROWSER_MAIN_H_
diff --git a/chromium/content/shell/shell_browser_main_parts.cc b/chromium/content/shell/browser/shell_browser_main_parts.cc
index bf7233a41cd..6f7da003583 100644
--- a/chromium/content/shell/shell_browser_main_parts.cc
+++ b/chromium/content/shell/browser/shell_browser_main_parts.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_browser_main_parts.h"
+#include "content/shell/browser/shell_browser_main_parts.h"
#include "base/bind.h"
#include "base/command_line.h"
@@ -16,11 +16,11 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/public/common/url_constants.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_devtools_delegate.h"
+#include "content/shell/browser/shell_net_log.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_devtools_delegate.h"
-#include "content/shell/shell_net_log.h"
#include "grit/net_resources.h"
#include "net/base/net_module.h"
#include "net/base/net_util.h"
@@ -30,7 +30,7 @@
#if defined(ENABLE_PLUGINS)
#include "content/public/browser/plugin_service.h"
-#include "content/shell/shell_plugin_service_filter.h"
+#include "content/shell/browser/shell_plugin_service_filter.h"
#endif
#if defined(OS_ANDROID)
diff --git a/chromium/content/shell/shell_browser_main_parts.h b/chromium/content/shell/browser/shell_browser_main_parts.h
index 25a4449ef8a..990e1c59a9d 100644
--- a/chromium/content/shell/shell_browser_main_parts.h
+++ b/chromium/content/shell/browser/shell_browser_main_parts.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_BROWSER_MAIN_PARTS_H_
-#define CONTENT_SHELL_SHELL_BROWSER_MAIN_PARTS_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_
+#define CONTENT_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
@@ -67,4 +67,4 @@ class ShellBrowserMainParts : public BrowserMainParts {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_BROWSER_MAIN_PARTS_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_
diff --git a/chromium/content/shell/shell_browser_main_parts_mac.mm b/chromium/content/shell/browser/shell_browser_main_parts_mac.mm
index b2b84b746f5..a933705bf16 100644
--- a/chromium/content/shell/shell_browser_main_parts_mac.mm
+++ b/chromium/content/shell/browser/shell_browser_main_parts_mac.mm
@@ -1,14 +1,14 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_browser_main_parts.h"
+#include "content/shell/browser/shell_browser_main_parts.h"
#import <Cocoa/Cocoa.h>
#include "base/mac/bundle_locations.h"
#include "base/mac/scoped_nsobject.h"
-#include "content/shell/shell_application_mac.h"
+#include "content/shell/browser/shell_application_mac.h"
namespace content {
diff --git a/chromium/content/shell/shell_content_browser_client.cc b/chromium/content/shell/browser/shell_content_browser_client.cc
index ac3795481de..040fce8a367 100644
--- a/chromium/content/shell/shell_content_browser_client.cc
+++ b/chromium/content/shell/browser/shell_content_browser_client.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_content_browser_client.h"
+#include "content/shell/browser/shell_content_browser_client.h"
#include "base/command_line.h"
#include "base/file_util.h"
@@ -14,20 +14,20 @@
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_browser_main_parts.h"
+#include "content/shell/browser/shell_devtools_delegate.h"
+#include "content/shell/browser/shell_message_filter.h"
+#include "content/shell/browser/shell_net_log.h"
+#include "content/shell/browser/shell_quota_permission_context.h"
+#include "content/shell/browser/shell_resource_dispatcher_host_delegate.h"
+#include "content/shell/browser/shell_web_contents_view_delegate_creator.h"
+#include "content/shell/browser/webkit_test_controller.h"
#include "content/shell/common/shell_messages.h"
#include "content/shell/common/shell_switches.h"
#include "content/shell/common/webkit_test_helpers.h"
#include "content/shell/geolocation/shell_access_token_store.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_browser_main_parts.h"
-#include "content/shell/shell_devtools_delegate.h"
-#include "content/shell/shell_message_filter.h"
-#include "content/shell/shell_net_log.h"
-#include "content/shell/shell_quota_permission_context.h"
-#include "content/shell/shell_resource_dispatcher_host_delegate.h"
-#include "content/shell/shell_web_contents_view_delegate_creator.h"
-#include "content/shell/webkit_test_controller.h"
#include "net/url_request/url_request_context_getter.h"
#include "url/gurl.h"
#include "webkit/common/webpreferences.h"
@@ -144,6 +144,8 @@ void ShellContentBrowserClient::AppendExtraCommandLineSwitches(
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kExposeInternalsForTesting))
command_line->AppendSwitch(switches::kExposeInternalsForTesting);
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kStableReleaseMode))
+ command_line->AppendSwitch(switches::kStableReleaseMode);
}
void ShellContentBrowserClient::OverrideWebkitPrefs(
@@ -186,6 +188,11 @@ ShellContentBrowserClient::CreateQuotaPermissionContext() {
return new ShellQuotaPermissionContext();
}
+SpeechRecognitionManagerDelegate*
+ ShellContentBrowserClient::GetSpeechRecognitionManagerDelegate() {
+ return new ShellSpeechRecognitionManagerDelegate();
+}
+
net::NetLog* ShellContentBrowserClient::GetNetLog() {
return shell_browser_main_parts_->net_log();
}
diff --git a/chromium/content/shell/shell_content_browser_client.h b/chromium/content/shell/browser/shell_content_browser_client.h
index 917a95516fe..b96b4819f60 100644
--- a/chromium/content/shell/shell_content_browser_client.h
+++ b/chromium/content/shell/browser/shell_content_browser_client.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_
-#define CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
+#define CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
#include <string>
@@ -14,6 +14,7 @@
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/shell/browser/shell_speech_recognition_manager_delegate.h"
namespace content {
@@ -58,6 +59,8 @@ class ShellContentBrowserClient : public ContentBrowserClient,
virtual WebContentsViewDelegate* GetWebContentsViewDelegate(
WebContents* web_contents) OVERRIDE;
virtual QuotaPermissionContext* CreateQuotaPermissionContext() OVERRIDE;
+ virtual SpeechRecognitionManagerDelegate*
+ GetSpeechRecognitionManagerDelegate() OVERRIDE;
virtual net::NetLog* GetNetLog() OVERRIDE;
virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context,
const GURL& current_url,
@@ -100,4 +103,4 @@ class ShellContentBrowserClient : public ContentBrowserClient,
} // namespace content
-#endif // CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
diff --git a/chromium/content/shell/shell_devtools_delegate.cc b/chromium/content/shell/browser/shell_devtools_delegate.cc
index d6fe39cc643..c8d256f6125 100644
--- a/chromium/content/shell/shell_devtools_delegate.cc
+++ b/chromium/content/shell/browser/shell_devtools_delegate.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_devtools_delegate.h"
+#include "content/shell/browser/shell_devtools_delegate.h"
#include <vector>
@@ -13,7 +13,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
-#include "content/shell/shell.h"
+#include "content/shell/browser/shell.h"
#include "grit/shell_resources.h"
#include "net/socket/tcp_listen_socket.h"
#include "ui/base/resource/resource_bundle.h"
@@ -109,11 +109,11 @@ std::string ShellDevToolsDelegate::GetViewDescription(
return std::string();
}
-scoped_refptr<net::StreamListenSocket>
+scoped_ptr<net::StreamListenSocket>
ShellDevToolsDelegate::CreateSocketForTethering(
net::StreamListenSocket::Delegate* delegate,
std::string* name) {
- return NULL;
+ return scoped_ptr<net::StreamListenSocket>();
}
} // namespace content
diff --git a/chromium/content/shell/shell_devtools_delegate.h b/chromium/content/shell/browser/shell_devtools_delegate.h
index dd4e762eac3..ad694c515e0 100644
--- a/chromium/content/shell/shell_devtools_delegate.h
+++ b/chromium/content/shell/browser/shell_devtools_delegate.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_DEVTOOLS_DELEGATE_H_
-#define CONTENT_SHELL_SHELL_DEVTOOLS_DELEGATE_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_DELEGATE_H_
+#define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_DELEGATE_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -30,7 +30,7 @@ class ShellDevToolsDelegate : public DevToolsHttpHandlerDelegate {
virtual RenderViewHost* CreateNewTarget() OVERRIDE;
virtual TargetType GetTargetType(RenderViewHost*) OVERRIDE;
virtual std::string GetViewDescription(content::RenderViewHost*) OVERRIDE;
- virtual scoped_refptr<net::StreamListenSocket> CreateSocketForTethering(
+ virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering(
net::StreamListenSocket::Delegate* delegate,
std::string* name) OVERRIDE;
@@ -47,4 +47,4 @@ class ShellDevToolsDelegate : public DevToolsHttpHandlerDelegate {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_DEVTOOLS_DELEGATE_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_DELEGATE_H_
diff --git a/chromium/content/shell/shell_devtools_frontend.cc b/chromium/content/shell/browser/shell_devtools_frontend.cc
index d102eaa3ae8..8c3f74b8bb1 100644
--- a/chromium/content/shell/shell_devtools_frontend.cc
+++ b/chromium/content/shell/browser/shell_devtools_frontend.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_devtools_frontend.h"
+#include "content/shell/browser/shell_devtools_frontend.h"
#include "base/command_line.h"
#include "base/path_service.h"
@@ -11,12 +11,12 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/content_client.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_browser_main_parts.h"
+#include "content/shell/browser/shell_content_browser_client.h"
+#include "content/shell/browser/shell_devtools_delegate.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_browser_main_parts.h"
-#include "content/shell/shell_content_browser_client.h"
-#include "content/shell/shell_devtools_delegate.h"
#include "net/base/net_util.h"
namespace content {
diff --git a/chromium/content/shell/shell_devtools_frontend.h b/chromium/content/shell/browser/shell_devtools_frontend.h
index a76cbc3b993..4d3066634f2 100644
--- a/chromium/content/shell/shell_devtools_frontend.h
+++ b/chromium/content/shell/browser/shell_devtools_frontend.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_DEVTOOLS_FRONTEND_H_
-#define CONTENT_SHELL_SHELL_DEVTOOLS_FRONTEND_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_
+#define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -38,26 +38,7 @@ class ShellDevToolsFrontend : public WebContentsObserver,
virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
// DevToolsFrontendHostDelegate implementation
- virtual void ActivateWindow() OVERRIDE {}
- virtual void ChangeAttachedWindowHeight(unsigned height) OVERRIDE {}
- virtual void CloseWindow() OVERRIDE {}
- virtual void MoveWindow(int x, int y) OVERRIDE {}
- virtual void SetDockSide(const std::string& side) OVERRIDE {}
- virtual void OpenInNewTab(const std::string& url) OVERRIDE {}
- virtual void SaveToFile(const std::string& url,
- const std::string& content,
- bool save_as) OVERRIDE {}
- virtual void AppendToFile(const std::string& url,
- const std::string& content) OVERRIDE {}
- virtual void RequestFileSystems() OVERRIDE {}
- virtual void AddFileSystem() OVERRIDE {}
- virtual void RemoveFileSystem(const std::string& file_system_path) OVERRIDE {}
- virtual void IndexPath(int request_id,
- const std::string& file_system_path) OVERRIDE {}
- virtual void StopIndexing(int request_id) OVERRIDE {}
- virtual void SearchInPath(int request_id,
- const std::string& file_system_path,
- const std::string& query) OVERRIDE {}
+ virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE {}
virtual void InspectedContentsClosing() OVERRIDE;
@@ -70,4 +51,4 @@ class ShellDevToolsFrontend : public WebContentsObserver,
} // namespace content
-#endif // CONTENT_SHELL_SHELL_DEVTOOLS_FRONTEND_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_
diff --git a/chromium/content/shell/shell_download_manager_delegate.cc b/chromium/content/shell/browser/shell_download_manager_delegate.cc
index 624ece58492..1dbbea7626b 100644
--- a/chromium/content/shell/shell_download_manager_delegate.cc
+++ b/chromium/content/shell/browser/shell_download_manager_delegate.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_download_manager_delegate.h"
+#include "content/shell/browser/shell_download_manager_delegate.h"
#if defined(TOOLKIT_GTK)
#include <gtk/gtk.h>
@@ -24,8 +24,8 @@
#include "content/public/browser/download_manager.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
+#include "content/shell/browser/webkit_test_controller.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/webkit_test_controller.h"
#include "net/base/net_util.h"
namespace content {
diff --git a/chromium/content/shell/shell_download_manager_delegate.h b/chromium/content/shell/browser/shell_download_manager_delegate.h
index 3c699c57255..afd57e7fef0 100644
--- a/chromium/content/shell/shell_download_manager_delegate.h
+++ b/chromium/content/shell/browser/shell_download_manager_delegate.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_
-#define CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_
+#define CONTENT_SHELL_BROWSER_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
@@ -62,4 +62,4 @@ class ShellDownloadManagerDelegate
} // namespace content
-#endif // CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_
diff --git a/chromium/content/shell/shell_gtk.cc b/chromium/content/shell/browser/shell_gtk.cc
index ee774735de0..a06a6a036f8 100644
--- a/chromium/content/shell/shell_gtk.cc
+++ b/chromium/content/shell/browser/shell_gtk.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell.h"
+#include "content/shell/browser/shell.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
@@ -15,8 +15,8 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/renderer_preferences.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_content_browser_client.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_content_browser_client.h"
namespace content {
diff --git a/chromium/content/shell/shell_javascript_dialog.h b/chromium/content/shell/browser/shell_javascript_dialog.h
index b819f3bd9e9..4001334c788 100644
--- a/chromium/content/shell/shell_javascript_dialog.h
+++ b/chromium/content/shell/browser/shell_javascript_dialog.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_
-#define CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_H_
+#define CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_H_
#include "content/public/browser/javascript_dialog_manager.h"
@@ -61,4 +61,4 @@ class ShellJavaScriptDialog {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_H_
diff --git a/chromium/content/shell/shell_javascript_dialog_gtk.cc b/chromium/content/shell/browser/shell_javascript_dialog_gtk.cc
index 9ba05fc3d7d..87bd6f3124b 100644
--- a/chromium/content/shell/shell_javascript_dialog_gtk.cc
+++ b/chromium/content/shell/browser/shell_javascript_dialog_gtk.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_javascript_dialog.h"
+#include "content/shell/browser/shell_javascript_dialog.h"
#include <gtk/gtk.h>
@@ -10,8 +10,8 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "content/shell/app/resource.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_javascript_dialog_manager.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_javascript_dialog_manager.h"
namespace {
diff --git a/chromium/content/shell/shell_javascript_dialog_mac.mm b/chromium/content/shell/browser/shell_javascript_dialog_mac.mm
index 0a89a8998ff..fe9de98d355 100644
--- a/chromium/content/shell/shell_javascript_dialog_mac.mm
+++ b/chromium/content/shell/browser/shell_javascript_dialog_mac.mm
@@ -1,14 +1,14 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_javascript_dialog.h"
+#include "content/shell/browser/shell_javascript_dialog.h"
#import <Cocoa/Cocoa.h>
#import "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
-#include "content/shell/shell_javascript_dialog_manager.h"
+#include "content/shell/browser/shell_javascript_dialog_manager.h"
// Helper object that receives the notification that the dialog/sheet is
// going away. Is responsible for cleaning itself up.
diff --git a/chromium/content/shell/shell_javascript_dialog_manager.cc b/chromium/content/shell/browser/shell_javascript_dialog_manager.cc
index 92484839cf6..1476f7c2475 100644
--- a/chromium/content/shell/shell_javascript_dialog_manager.cc
+++ b/chromium/content/shell/browser/shell_javascript_dialog_manager.cc
@@ -1,17 +1,17 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_javascript_dialog_manager.h"
+#include "content/shell/browser/shell_javascript_dialog_manager.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
+#include "content/shell/browser/shell_javascript_dialog.h"
+#include "content/shell/browser/webkit_test_controller.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/shell_javascript_dialog.h"
-#include "content/shell/webkit_test_controller.h"
#include "net/base/net_util.h"
namespace content {
diff --git a/chromium/content/shell/shell_javascript_dialog_manager.h b/chromium/content/shell/browser/shell_javascript_dialog_manager.h
index 1327ab7adae..763736f58a7 100644
--- a/chromium/content/shell/shell_javascript_dialog_manager.h
+++ b/chromium/content/shell/browser/shell_javascript_dialog_manager.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_
-#define CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_
+#define CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_
#include "base/callback_forward.h"
#include "base/compiler_specific.h"
@@ -64,4 +64,4 @@ class ShellJavaScriptDialogManager : public JavaScriptDialogManager {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_JAVASCRIPT_DIALOG_MANAGER_H_
diff --git a/chromium/content/shell/shell_javascript_dialog_win.cc b/chromium/content/shell/browser/shell_javascript_dialog_win.cc
index c39b2d7d279..a59639e9d4e 100644
--- a/chromium/content/shell/shell_javascript_dialog_win.cc
+++ b/chromium/content/shell/browser/shell_javascript_dialog_win.cc
@@ -1,13 +1,13 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_javascript_dialog.h"
+#include "content/shell/browser/shell_javascript_dialog.h"
#include "base/strings/string_util.h"
#include "content/shell/app/resource.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_javascript_dialog_manager.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_javascript_dialog_manager.h"
namespace content {
diff --git a/chromium/content/shell/shell_layout_tests_android.cc b/chromium/content/shell/browser/shell_layout_tests_android.cc
index 68e8001bc5a..de94b8ccf68 100644
--- a/chromium/content/shell/shell_layout_tests_android.cc
+++ b/chromium/content/shell/browser/shell_layout_tests_android.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_layout_tests_android.h"
+#include "content/shell/browser/shell_layout_tests_android.h"
#include "base/android/fifo_utils.h"
#include "base/android/jni_android.h"
diff --git a/chromium/content/shell/shell_layout_tests_android.h b/chromium/content/shell/browser/shell_layout_tests_android.h
index 9a3c4231098..7410954b067 100644
--- a/chromium/content/shell/shell_layout_tests_android.h
+++ b/chromium/content/shell/browser/shell_layout_tests_android.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_LAYOUT_TESTS_ANDROID_H_
-#define CONTENT_SHELL_SHELL_LAYOUT_TESTS_ANDROID_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_LAYOUT_TESTS_ANDROID_H_
+#define CONTENT_SHELL_BROWSER_SHELL_LAYOUT_TESTS_ANDROID_H_
#include <string>
@@ -22,4 +22,4 @@ void EnsureInitializeForAndroidLayoutTests();
} // namespace content
-#endif // CONTENT_SHELL_SHELL_LAYOUT_TESTS_ANDROID_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_LAYOUT_TESTS_ANDROID_H_
diff --git a/chromium/content/shell/shell_login_dialog.cc b/chromium/content/shell/browser/shell_login_dialog.cc
index f32c4277339..607fd66ac5a 100644
--- a/chromium/content/shell/shell_login_dialog.cc
+++ b/chromium/content/shell/browser/shell_login_dialog.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_login_dialog.h"
+#include "content/shell/browser/shell_login_dialog.h"
#include "base/bind.h"
#include "base/logging.h"
@@ -11,7 +11,7 @@
#include "content/public/browser/resource_dispatcher_host.h"
#include "net/base/auth.h"
#include "net/url_request/url_request.h"
-#include "ui/base/text/text_elider.h"
+#include "ui/gfx/text_elider.h"
namespace content {
@@ -74,7 +74,7 @@ void ShellLoginDialog::PrepDialog(const string16& host,
// The realm is controlled by the remote server, so there is no reason to
// believe it is of a reasonable length.
string16 elided_realm;
- ui::ElideString(realm, 120, &elided_realm);
+ gfx::ElideString(realm, 120, &elided_realm);
string16 explanation =
ASCIIToUTF16("The server ") + host +
diff --git a/chromium/content/shell/shell_login_dialog.h b/chromium/content/shell/browser/shell_login_dialog.h
index 22abab461db..d9b0504072d 100644
--- a/chromium/content/shell/shell_login_dialog.h
+++ b/chromium/content/shell/browser/shell_login_dialog.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_LOGIN_DIALOG_H_
-#define CONTENT_SHELL_SHELL_LOGIN_DIALOG_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_LOGIN_DIALOG_H_
+#define CONTENT_SHELL_BROWSER_SHELL_LOGIN_DIALOG_H_
#include "base/compiler_specific.h"
#include "base/strings/string16.h"
@@ -94,4 +94,4 @@ class ShellLoginDialog : public ResourceDispatcherHostLoginDelegate {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_LOGIN_DIALOG_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_LOGIN_DIALOG_H_
diff --git a/chromium/content/shell/shell_login_dialog_gtk.cc b/chromium/content/shell/browser/shell_login_dialog_gtk.cc
index 1be48d3068b..b08b449ad91 100644
--- a/chromium/content/shell/shell_login_dialog_gtk.cc
+++ b/chromium/content/shell/browser/shell_login_dialog_gtk.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_login_dialog.h"
+#include "content/shell/browser/shell_login_dialog.h"
#include <gtk/gtk.h>
diff --git a/chromium/content/shell/shell_login_dialog_mac.mm b/chromium/content/shell/browser/shell_login_dialog_mac.mm
index b7d694715cc..447aa586e11 100644
--- a/chromium/content/shell/shell_login_dialog_mac.mm
+++ b/chromium/content/shell/browser/shell_login_dialog_mac.mm
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_login_dialog.h"
+#include "content/shell/browser/shell_login_dialog.h"
#import <Cocoa/Cocoa.h>
diff --git a/chromium/content/shell/shell_mac.mm b/chromium/content/shell/browser/shell_mac.mm
index 370a64debba..ca6a0ff7f33 100644
--- a/chromium/content/shell/shell_mac.mm
+++ b/chromium/content/shell/browser/shell_mac.mm
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell.h"
+#include "content/shell/browser/shell.h"
#include <algorithm>
diff --git a/chromium/content/shell/shell_message_filter.cc b/chromium/content/shell/browser/shell_message_filter.cc
index 7bfe82671be..fcbde2f80a9 100644
--- a/chromium/content/shell/shell_message_filter.cc
+++ b/chromium/content/shell/browser/shell_message_filter.cc
@@ -1,16 +1,16 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_message_filter.h"
+#include "content/shell/browser/shell_message_filter.h"
#include "base/file_util.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/child_process_security_policy.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_content_browser_client.h"
+#include "content/shell/browser/shell_network_delegate.h"
#include "content/shell/common/shell_messages.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_content_browser_client.h"
-#include "content/shell/shell_network_delegate.h"
#include "net/base/net_errors.h"
#include "net/cookies/cookie_monster.h"
#include "net/url_request/url_request_context.h"
@@ -61,7 +61,7 @@ bool ShellMessageFilter::OnMessageReceived(const IPC::Message& message,
void ShellMessageFilter::OnReadFileToString(const base::FilePath& local_file,
std::string* contents) {
base::ThreadRestrictions::ScopedAllowIO allow_io;
- file_util::ReadFileToString(local_file, contents);
+ base::ReadFileToString(local_file, contents);
}
void ShellMessageFilter::OnRegisterIsolatedFileSystem(
diff --git a/chromium/content/shell/shell_message_filter.h b/chromium/content/shell/browser/shell_message_filter.h
index b53908ed011..135a915991f 100644
--- a/chromium/content/shell/shell_message_filter.h
+++ b/chromium/content/shell/browser/shell_message_filter.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_MESSAGE_FILTER_H_
-#define CONTENT_SHELL_SHELL_MESSAGE_FILTER_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_MESSAGE_FILTER_H_
+#define CONTENT_SHELL_BROWSER_SHELL_MESSAGE_FILTER_H_
#include <string>
#include <vector>
@@ -63,4 +63,4 @@ class ShellMessageFilter : public BrowserMessageFilter {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_MESSAGE_FILTER_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_MESSAGE_FILTER_H_
diff --git a/chromium/content/shell/shell_net_log.cc b/chromium/content/shell/browser/shell_net_log.cc
index 03443d2e3ae..97276d67300 100644
--- a/chromium/content/shell/shell_net_log.cc
+++ b/chromium/content/shell/browser/shell_net_log.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_net_log.h"
+#include "content/shell/browser/shell_net_log.h"
#include <stdio.h>
diff --git a/chromium/content/shell/shell_net_log.h b/chromium/content/shell/browser/shell_net_log.h
index ead9108dd18..9846917aed1 100644
--- a/chromium/content/shell/shell_net_log.h
+++ b/chromium/content/shell/browser/shell_net_log.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_
-#define CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_NET_LOG_H_
+#define CONTENT_SHELL_BROWSER_SHELL_NET_LOG_H_
#include <string>
@@ -25,4 +25,4 @@ class ShellNetLog : public net::NetLog {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_NET_LOG_H_
diff --git a/chromium/content/shell/shell_network_delegate.cc b/chromium/content/shell/browser/shell_network_delegate.cc
index e633686e54f..560426f8979 100644
--- a/chromium/content/shell/shell_network_delegate.cc
+++ b/chromium/content/shell/browser/shell_network_delegate.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_network_delegate.h"
+#include "content/shell/browser/shell_network_delegate.h"
#include "net/base/net_errors.h"
#include "net/base/static_cookie_policy.h"
diff --git a/chromium/content/shell/shell_network_delegate.h b/chromium/content/shell/browser/shell_network_delegate.h
index c2f5e8e90d2..a3ce0a249fd 100644
--- a/chromium/content/shell/shell_network_delegate.h
+++ b/chromium/content/shell/browser/shell_network_delegate.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_NETWORK_DELEGATE_H_
-#define CONTENT_SHELL_SHELL_NETWORK_DELEGATE_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_
+#define CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -68,4 +68,4 @@ class ShellNetworkDelegate : public net::NetworkDelegate {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_NETWORK_DELEGATE_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_NETWORK_DELEGATE_H_
diff --git a/chromium/content/shell/shell_plugin_service_filter.cc b/chromium/content/shell/browser/shell_plugin_service_filter.cc
index f1646377cbc..d41b9bd7de0 100644
--- a/chromium/content/shell/shell_plugin_service_filter.cc
+++ b/chromium/content/shell/browser/shell_plugin_service_filter.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_plugin_service_filter.h"
+#include "content/shell/browser/shell_plugin_service_filter.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/common/webplugininfo.h"
diff --git a/chromium/content/shell/shell_plugin_service_filter.h b/chromium/content/shell/browser/shell_plugin_service_filter.h
index a489aff34b1..3e9cb5d9875 100644
--- a/chromium/content/shell/shell_plugin_service_filter.h
+++ b/chromium/content/shell/browser/shell_plugin_service_filter.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_PLUGIN_SERVICE_FILTER_H_
-#define CONTENT_SHELL_SHELL_PLUGIN_SERVICE_FILTER_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_PLUGIN_SERVICE_FILTER_H_
+#define CONTENT_SHELL_BROWSER_SHELL_PLUGIN_SERVICE_FILTER_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -34,4 +34,4 @@ class ShellPluginServiceFilter : public PluginServiceFilter {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_PLUGIN_SERVICE_FILTER_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_PLUGIN_SERVICE_FILTER_H_
diff --git a/chromium/content/shell/shell_quota_permission_context.cc b/chromium/content/shell/browser/shell_quota_permission_context.cc
index fe0df90f003..064322ffa0d 100644
--- a/chromium/content/shell/shell_quota_permission_context.cc
+++ b/chromium/content/shell/browser/shell_quota_permission_context.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_quota_permission_context.h"
+#include "content/shell/browser/shell_quota_permission_context.h"
#include "webkit/common/quota/quota_types.h"
diff --git a/chromium/content/shell/shell_quota_permission_context.h b/chromium/content/shell/browser/shell_quota_permission_context.h
index af7f62fbffe..381338dcfe8 100644
--- a/chromium/content/shell/shell_quota_permission_context.h
+++ b/chromium/content/shell/browser/shell_quota_permission_context.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_QUOTA_PERMISSION_CONTEXT_H_
-#define CONTENT_SHELL_SHELL_QUOTA_PERMISSION_CONTEXT_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_QUOTA_PERMISSION_CONTEXT_H_
+#define CONTENT_SHELL_BROWSER_SHELL_QUOTA_PERMISSION_CONTEXT_H_
#include "base/compiler_specific.h"
#include "content/public/browser/quota_permission_context.h"
@@ -31,4 +31,4 @@ class ShellQuotaPermissionContext : public QuotaPermissionContext {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_QUOTA_PERMISSION_CONTEXT_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_QUOTA_PERMISSION_CONTEXT_H_
diff --git a/chromium/content/shell/shell_resource_dispatcher_host_delegate.cc b/chromium/content/shell/browser/shell_resource_dispatcher_host_delegate.cc
index 1637eddef4a..d0994b1d466 100644
--- a/chromium/content/shell/shell_resource_dispatcher_host_delegate.cc
+++ b/chromium/content/shell/browser/shell_resource_dispatcher_host_delegate.cc
@@ -1,12 +1,12 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_resource_dispatcher_host_delegate.h"
+#include "content/shell/browser/shell_resource_dispatcher_host_delegate.h"
#include "base/command_line.h"
+#include "content/shell/browser/shell_login_dialog.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/shell_login_dialog.h"
namespace content {
diff --git a/chromium/content/shell/shell_resource_dispatcher_host_delegate.h b/chromium/content/shell/browser/shell_resource_dispatcher_host_delegate.h
index ff78e4832ac..90e6d4cec47 100644
--- a/chromium/content/shell/shell_resource_dispatcher_host_delegate.h
+++ b/chromium/content/shell/browser/shell_resource_dispatcher_host_delegate.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
-#define CONTENT_SHELL_SHELL_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
+#define CONTENT_SHELL_BROWSER_SHELL_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
#include "base/callback.h"
#include "base/compiler_specific.h"
@@ -37,4 +37,4 @@ class ShellResourceDispatcherHostDelegate
} // namespace content
-#endif // CONTENT_SHELL_SHELL_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
diff --git a/chromium/content/shell/browser/shell_speech_recognition_manager_delegate.cc b/chromium/content/shell/browser/shell_speech_recognition_manager_delegate.cc
new file mode 100644
index 00000000000..0b0778d0f71
--- /dev/null
+++ b/chromium/content/shell/browser/shell_speech_recognition_manager_delegate.cc
@@ -0,0 +1,33 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/shell/browser/shell_speech_recognition_manager_delegate.h"
+
+#include "content/public/browser/browser_thread.h"
+
+using base::Callback;
+
+namespace content {
+
+void ShellSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
+ int session_id, Callback<void(bool ask_user, bool is_allowed)> callback) {
+ // In content_shell, we expect speech recognition to happen when requested.
+ // Therefore we simply authorize it by calling back with is_allowed=true. The
+ // first parameter, ask_user, is set to false because we don't want to prompt
+ // the user for permission with an infobar.
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE, base::Bind(callback, false, true));
+}
+
+SpeechRecognitionEventListener*
+ ShellSpeechRecognitionManagerDelegate::GetEventListener() {
+ return NULL;
+}
+
+bool ShellSpeechRecognitionManagerDelegate::FilterProfanities(
+ int render_process_id) {
+ return false;
+}
+
+} // namespace content
diff --git a/chromium/content/shell/browser/shell_speech_recognition_manager_delegate.h b/chromium/content/shell/browser/shell_speech_recognition_manager_delegate.h
new file mode 100644
index 00000000000..41ad2e55a80
--- /dev/null
+++ b/chromium/content/shell/browser/shell_speech_recognition_manager_delegate.h
@@ -0,0 +1,38 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_SHELL_BROWSER_SHELL_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
+#define CONTENT_SHELL_BROWSER_SHELL_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
+
+#include "base/bind.h"
+#include "base/compiler_specific.h"
+#include "content/public/browser/speech_recognition_event_listener.h"
+#include "content/public/browser/speech_recognition_manager_delegate.h"
+
+namespace content {
+
+// This is content_shell's delegate used by the speech recognition manager to
+// check for permission to record audio. For content_shell, we always authorize
+// speech recognition (see crbug.com/237119).
+class ShellSpeechRecognitionManagerDelegate
+ : public SpeechRecognitionManagerDelegate {
+ public:
+ ShellSpeechRecognitionManagerDelegate() {}
+ virtual ~ShellSpeechRecognitionManagerDelegate() {}
+
+ // SpeechRecognitionManagerDelegate methods.
+ virtual void GetDiagnosticInformation(
+ bool* can_report_metrics, std::string* hardware_info) OVERRIDE {}
+ virtual void CheckRecognitionIsAllowed(int session_id,
+ base::Callback<void(bool ask_user, bool is_allowed)> callback) OVERRIDE;
+ virtual SpeechRecognitionEventListener* GetEventListener() OVERRIDE;
+ virtual bool FilterProfanities(int render_process_id) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShellSpeechRecognitionManagerDelegate);
+};
+
+} // namespace content
+
+#endif // CONTENT_SHELL_BROWSER_SHELL_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
diff --git a/chromium/content/shell/shell_url_request_context_getter.cc b/chromium/content/shell/browser/shell_url_request_context_getter.cc
index dd74b9fa47a..dfdb85275d7 100644
--- a/chromium/content/shell/shell_url_request_context_getter.cc
+++ b/chromium/content/shell/browser/shell_url_request_context_getter.cc
@@ -1,20 +1,21 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_url_request_context_getter.h"
+#include "content/shell/browser/shell_url_request_context_getter.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
+#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/worker_pool.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
+#include "content/shell/browser/shell_network_delegate.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/shell_network_delegate.h"
#include "net/base/cache_type.h"
#include "net/cert/cert_verifier.h"
#include "net/cookies/cookie_monster.h"
@@ -207,7 +208,10 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
DCHECK(set_protocol);
set_protocol = job_factory->SetProtocolHandler(
chrome::kFileScheme,
- new net::FileProtocolHandler);
+ new net::FileProtocolHandler(
+ content::BrowserThread::GetBlockingPool()->
+ GetTaskRunnerWithShutdownBehavior(
+ base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
DCHECK(set_protocol);
storage_->set_job_factory(job_factory.release());
}
diff --git a/chromium/content/shell/shell_url_request_context_getter.h b/chromium/content/shell/browser/shell_url_request_context_getter.h
index d1afb6fc454..b18c0a94f0e 100644
--- a/chromium/content/shell/shell_url_request_context_getter.h
+++ b/chromium/content/shell/browser/shell_url_request_context_getter.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_
-#define CONTENT_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_
+#define CONTENT_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
@@ -66,4 +66,4 @@ class ShellURLRequestContextGetter : public net::URLRequestContextGetter {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_
diff --git a/chromium/content/shell/shell_web_contents_view_delegate.h b/chromium/content/shell/browser/shell_web_contents_view_delegate.h
index f9292a8e8d9..86d97b407b0 100644
--- a/chromium/content/shell/shell_web_contents_view_delegate.h
+++ b/chromium/content/shell/browser/shell_web_contents_view_delegate.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_
-#define CONTENT_SHELL_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_
+#define CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view_delegate.h"
@@ -80,4 +80,4 @@ class ShellWebContentsViewDelegate : public WebContentsViewDelegate {
} // namespace content
-#endif // CONTENT_SHELL_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_
+#endif // CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_H_
diff --git a/chromium/content/shell/shell_web_contents_view_delegate_android.cc b/chromium/content/shell/browser/shell_web_contents_view_delegate_android.cc
index a5b4c824065..3da54755c85 100644
--- a/chromium/content/shell/shell_web_contents_view_delegate_android.cc
+++ b/chromium/content/shell/browser/shell_web_contents_view_delegate_android.cc
@@ -1,15 +1,15 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_web_contents_view_delegate.h"
+#include "content/shell/browser/shell_web_contents_view_delegate.h"
#include "base/command_line.h"
#include "content/public/browser/android/content_view_core.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/context_menu_params.h"
-#include "content/shell/shell_web_contents_view_delegate_creator.h"
+#include "content/shell/browser/shell_web_contents_view_delegate_creator.h"
namespace content {
diff --git a/chromium/content/shell/shell_web_contents_view_delegate_creator.h b/chromium/content/shell/browser/shell_web_contents_view_delegate_creator.h
index 707bbd96793..819ce1e9cd9 100644
--- a/chromium/content/shell/shell_web_contents_view_delegate_creator.h
+++ b/chromium/content/shell/browser/shell_web_contents_view_delegate_creator.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_SHELL_WEB_CONTENTS_VIEW_DELEGATE_CREATOR_H_
-#define CONTENT_SHELL_SHELL_WEB_CONTENTS_VIEW_DELEGATE_CREATOR_H_
+#ifndef CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_CREATOR_H_
+#define CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_CREATOR_H_
namespace content {
@@ -15,4 +15,4 @@ WebContentsViewDelegate* CreateShellWebContentsViewDelegate(
} // namespace content
-#endif //CONTENT_SHELL_SHELL_WEB_CONTENTS_VIEW_DELEGATE_CREATOR_H_
+#endif //CONTENT_SHELL_BROWSER_SHELL_WEB_CONTENTS_VIEW_DELEGATE_CREATOR_H_
diff --git a/chromium/content/shell/shell_web_contents_view_delegate_gtk.cc b/chromium/content/shell/browser/shell_web_contents_view_delegate_gtk.cc
index 9f1318b2822..4c982573298 100644
--- a/chromium/content/shell/shell_web_contents_view_delegate_gtk.cc
+++ b/chromium/content/shell/browser/shell_web_contents_view_delegate_gtk.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_web_contents_view_delegate.h"
+#include "content/shell/browser/shell_web_contents_view_delegate.h"
#include "base/command_line.h"
#include "content/public/browser/render_process_host.h"
@@ -11,13 +11,13 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/context_menu_params.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_browser_main_parts.h"
+#include "content/shell/browser/shell_content_browser_client.h"
+#include "content/shell/browser/shell_devtools_frontend.h"
+#include "content/shell/browser/shell_web_contents_view_delegate_creator.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_browser_main_parts.h"
-#include "content/shell/shell_content_browser_client.h"
-#include "content/shell/shell_devtools_frontend.h"
-#include "content/shell/shell_web_contents_view_delegate_creator.h"
#include "third_party/WebKit/public/web/WebContextMenuData.h"
#include "ui/base/gtk/focus_store_gtk.h"
#include "ui/base/gtk/gtk_floating_container.h"
diff --git a/chromium/content/shell/shell_web_contents_view_delegate_mac.mm b/chromium/content/shell/browser/shell_web_contents_view_delegate_mac.mm
index 606a826c0b9..00196af0348 100644
--- a/chromium/content/shell/shell_web_contents_view_delegate_mac.mm
+++ b/chromium/content/shell/browser/shell_web_contents_view_delegate_mac.mm
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_web_contents_view_delegate.h"
+#include "content/shell/browser/shell_web_contents_view_delegate.h"
#import <Cocoa/Cocoa.h>
@@ -13,13 +13,13 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/context_menu_params.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_browser_main_parts.h"
+#include "content/shell/browser/shell_content_browser_client.h"
+#include "content/shell/browser/shell_devtools_frontend.h"
+#include "content/shell/browser/shell_web_contents_view_delegate_creator.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_browser_main_parts.h"
-#include "content/shell/shell_content_browser_client.h"
-#include "content/shell/shell_devtools_frontend.h"
-#include "content/shell/shell_web_contents_view_delegate_creator.h"
#include "third_party/WebKit/public/web/WebContextMenuData.h"
using WebKit::WebContextMenuData;
diff --git a/chromium/content/shell/shell_web_contents_view_delegate_win.cc b/chromium/content/shell/browser/shell_web_contents_view_delegate_win.cc
index a062deae6f1..cd387f054ac 100644
--- a/chromium/content/shell/shell_web_contents_view_delegate_win.cc
+++ b/chromium/content/shell/browser/shell_web_contents_view_delegate_win.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell_web_contents_view_delegate.h"
+#include "content/shell/browser/shell_web_contents_view_delegate.h"
#include "base/command_line.h"
#include "content/public/browser/render_process_host.h"
@@ -11,13 +11,13 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/context_menu_params.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_browser_main_parts.h"
+#include "content/shell/browser/shell_content_browser_client.h"
+#include "content/shell/browser/shell_devtools_frontend.h"
+#include "content/shell/browser/shell_web_contents_view_delegate_creator.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_browser_main_parts.h"
-#include "content/shell/shell_content_browser_client.h"
-#include "content/shell/shell_devtools_frontend.h"
-#include "content/shell/shell_web_contents_view_delegate_creator.h"
#include "third_party/WebKit/public/web/WebContextMenuData.h"
using WebKit::WebContextMenuData;
diff --git a/chromium/content/shell/shell_win.cc b/chromium/content/shell/browser/shell_win.cc
index d6d94973257..2854e5c5c7d 100644
--- a/chromium/content/shell/shell_win.cc
+++ b/chromium/content/shell/browser/shell_win.cc
@@ -1,20 +1,20 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/shell.h"
+#include "content/shell/browser/shell.h"
+#include <windows.h>
#include <commctrl.h>
#include <fcntl.h>
#include <io.h>
-#include <windows.h>
#include "base/strings/utf_string_conversions.h"
#include "base/win/wrapped_window_proc.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/shell/app/resource.h"
-#include "ui/base/win/hwnd_util.h"
+#include "ui/gfx/win/hwnd_util.h"
namespace {
@@ -52,8 +52,8 @@ void Shell::PlatformExit() {
void Shell::PlatformCleanUp() {
// When the window is destroyed, tell the Edit field to forget about us,
// otherwise we will crash.
- ui::SetWindowProc(url_edit_view_, default_edit_wnd_proc_);
- ui::SetWindowUserData(url_edit_view_, NULL);
+ gfx::SetWindowProc(url_edit_view_, default_edit_wnd_proc_);
+ gfx::SetWindowUserData(url_edit_view_, NULL);
}
void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) {
@@ -89,7 +89,7 @@ void Shell::PlatformCreateWindow(int width, int height) {
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
NULL, NULL, instance_handle_, NULL);
- ui::SetWindowUserData(window_, this);
+ gfx::SetWindowUserData(window_, this);
HWND hwnd;
int x = 0;
@@ -124,9 +124,9 @@ void Shell::PlatformCreateWindow(int width, int height) {
ES_AUTOVSCROLL | ES_AUTOHSCROLL,
x, 0, 0, 0, window_, 0, instance_handle_, 0);
- default_edit_wnd_proc_ = ui::SetWindowProc(url_edit_view_,
+ default_edit_wnd_proc_ = gfx::SetWindowProc(url_edit_view_,
Shell::EditWndProc);
- ui::SetWindowUserData(url_edit_view_, this);
+ gfx::SetWindowUserData(url_edit_view_, this);
ShowWindow(window_, SW_SHOW);
@@ -192,7 +192,7 @@ ATOM Shell::RegisterWindowClass() {
LRESULT CALLBACK Shell::WndProc(HWND hwnd, UINT message, WPARAM wParam,
LPARAM lParam) {
- Shell* shell = static_cast<Shell*>(ui::GetWindowUserData(hwnd));
+ Shell* shell = static_cast<Shell*>(gfx::GetWindowUserData(hwnd));
switch (message) {
case WM_COMMAND: {
@@ -254,7 +254,7 @@ LRESULT CALLBACK Shell::WndProc(HWND hwnd, UINT message, WPARAM wParam,
LRESULT CALLBACK Shell::EditWndProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam) {
- Shell* shell = static_cast<Shell*>(ui::GetWindowUserData(hwnd));
+ Shell* shell = static_cast<Shell*>(gfx::GetWindowUserData(hwnd));
switch (message) {
case WM_CHAR:
diff --git a/chromium/content/shell/webkit_test_controller.cc b/chromium/content/shell/browser/webkit_test_controller.cc
index 147367e4787..6c2a6034f2b 100644
--- a/chromium/content/shell/webkit_test_controller.cc
+++ b/chromium/content/shell/browser/webkit_test_controller.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/shell/webkit_test_controller.h"
+#include "content/shell/browser/webkit_test_controller.h"
#include <iostream>
@@ -24,12 +24,12 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/content_switches.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_content_browser_client.h"
#include "content/shell/common/shell_messages.h"
#include "content/shell/common/shell_switches.h"
#include "content/shell/common/webkit_test_helpers.h"
-#include "content/shell/shell.h"
-#include "content/shell/shell_browser_context.h"
-#include "content/shell/shell_content_browser_client.h"
#include "ui/gfx/codec/png_codec.h"
namespace content {
@@ -287,6 +287,12 @@ bool WebKitTestController::ResetAfterLayoutTest() {
test_url_ = GURL();
prefs_ = WebPreferences();
should_override_prefs_ = false;
+
+#if defined(OS_ANDROID)
+ // Re-using the shell's main window on Android causes issues with networking
+ // requests never succeeding. See http://crbug.com/277652.
+ DiscardMainWindow();
+#endif
return true;
}
@@ -511,6 +517,9 @@ void WebKitTestController::OnImageDump(
#else
bool discard_transparency = true;
#endif
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableOverlayFullscreenVideo))
+ discard_transparency = false;
std::vector<gfx::PNGCodec::Comment> comments;
comments.push_back(gfx::PNGCodec::Comment("checksum", actual_pixel_hash));
diff --git a/chromium/content/shell/webkit_test_controller.h b/chromium/content/shell/browser/webkit_test_controller.h
index aa181df7597..58d1fa9b0c4 100644
--- a/chromium/content/shell/webkit_test_controller.h
+++ b/chromium/content/shell/browser/webkit_test_controller.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_SHELL_WEBKIT_TEST_CONTROLLER_H_
-#define CONTENT_SHELL_WEBKIT_TEST_CONTROLLER_H_
+#ifndef CONTENT_SHELL_BROWSER_WEBKIT_TEST_CONTROLLER_H_
+#define CONTENT_SHELL_BROWSER_WEBKIT_TEST_CONTROLLER_H_
#include <ostream>
#include <string>
@@ -216,4 +216,4 @@ class WebKitTestController : public base::NonThreadSafe,
} // namespace content
-#endif // CONTENT_SHELL_WEBKIT_TEST_CONTROLLER_H_
+#endif // CONTENT_SHELL_BROWSER_WEBKIT_TEST_CONTROLLER_H_
diff --git a/chromium/content/shell/common/shell_switches.cc b/chromium/content/shell/common/shell_switches.cc
index 81a4a6844ad..a00af456972 100644
--- a/chromium/content/shell/common/shell_switches.cc
+++ b/chromium/content/shell/common/shell_switches.cc
@@ -34,4 +34,10 @@ const char kExposeInternalsForTesting[] = "expose-internals-for-testing";
// Save results when layout-as-browser tests fail.
const char kOutputLayoutTestDifferences[] = "output-layout-test-differences";
+// This makes us disable some web-platform runtime features so that we test
+// content_shell as if it was a stable release. It is only followed when
+// kDumpRenderTree is set. For the features' level, see
+// http://dev.chromium.org/blink/runtime-enabled-features.
+const char kStableReleaseMode[] = "stable-release-mode";
+
} // namespace switches
diff --git a/chromium/content/shell/common/shell_switches.h b/chromium/content/shell/common/shell_switches.h
index 36474a7d218..d6b936a5a57 100644
--- a/chromium/content/shell/common/shell_switches.h
+++ b/chromium/content/shell/common/shell_switches.h
@@ -18,6 +18,7 @@ extern const char kEnableAccelerated2DCanvas[];
extern const char kEncodeBinary[];
extern const char kExposeInternalsForTesting[];
extern const char kOutputLayoutTestDifferences[];
+extern const char kStableReleaseMode[];
} // namespace switches
diff --git a/chromium/content/shell/common/webkit_test_helpers.cc b/chromium/content/shell/common/webkit_test_helpers.cc
index 320eb4bfda0..b0d4fc026c4 100644
--- a/chromium/content/shell/common/webkit_test_helpers.cc
+++ b/chromium/content/shell/common/webkit_test_helpers.cc
@@ -8,6 +8,7 @@
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/strings/utf_string_conversions.h"
+#include "content/public/common/content_switches.h"
#include "content/shell/common/shell_switches.h"
#include "third_party/WebKit/public/testing/WebPreferences.h"
#include "webkit/common/webpreferences.h"
@@ -55,7 +56,7 @@ void ExportLayoutTestSpecificPreferences(
// of the defaults are controlled via command line flags which are
// automatically set for layout tests.
void ApplyLayoutTestDefaultPreferences(WebPreferences* prefs) {
- CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
prefs->allow_universal_access_from_file_urls = true;
prefs->dom_paste_enabled = true;
prefs->javascript_can_access_clipboard = true;
@@ -100,6 +101,8 @@ void ApplyLayoutTestDefaultPreferences(WebPreferences* prefs) {
prefs->threaded_html_parser = true;
prefs->accelerated_2d_canvas_enabled =
command_line.HasSwitch(switches::kEnableAccelerated2DCanvas);
+ prefs->force_compositing_mode =
+ command_line.HasSwitch(switches::kForceCompositingMode);
prefs->accelerated_compositing_for_video_enabled = false;
prefs->mock_scrollbars_enabled = false;
prefs->fixed_position_creates_stacking_context = false;
diff --git a/chromium/content/shell/geolocation/shell_access_token_store.cc b/chromium/content/shell/geolocation/shell_access_token_store.cc
index fa889bd2d7d..ceae3d60f6e 100644
--- a/chromium/content/shell/geolocation/shell_access_token_store.cc
+++ b/chromium/content/shell/geolocation/shell_access_token_store.cc
@@ -8,7 +8,7 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_thread.h"
-#include "content/shell/shell_browser_context.h"
+#include "content/shell/browser/shell_browser_context.h"
namespace content {
diff --git a/chromium/content/shell/renderer/shell_content_renderer_client.cc b/chromium/content/shell/renderer/shell_content_renderer_client.cc
index 433b368a296..8569a09a712 100644
--- a/chromium/content/shell/renderer/shell_content_renderer_client.cc
+++ b/chromium/content/shell/renderer/shell_content_renderer_client.cc
@@ -15,6 +15,7 @@
#include "content/shell/renderer/shell_render_process_observer.h"
#include "content/shell/renderer/shell_render_view_observer.h"
#include "content/shell/renderer/webkit_test_runner.h"
+#include "content/test/mock_webclipboard_impl.h"
#include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
#include "third_party/WebKit/public/testing/WebTestInterfaces.h"
#include "third_party/WebKit/public/testing/WebTestProxy.h"
@@ -22,7 +23,6 @@
#include "third_party/WebKit/public/web/WebPluginParams.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "v8/include/v8.h"
-#include "webkit/support/mock_webclipboard_impl.h"
using WebKit::WebAudioDevice;
using WebKit::WebClipboard;
diff --git a/chromium/content/shell/renderer/shell_render_process_observer.cc b/chromium/content/shell/renderer/shell_render_process_observer.cc
index 6c445fa8030..2694993e8c7 100644
--- a/chromium/content/shell/renderer/shell_render_process_observer.cc
+++ b/chromium/content/shell/renderer/shell_render_process_observer.cc
@@ -15,10 +15,12 @@
#include "content/shell/renderer/shell_content_renderer_client.h"
#include "content/shell/renderer/webkit_test_runner.h"
#include "third_party/WebKit/public/testing/WebTestInterfaces.h"
+#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "webkit/glue/webkit_glue.h"
using WebKit::WebFrame;
+using WebKit::WebRuntimeFeatures;
using WebTestRunner::WebTestDelegate;
using WebTestRunner::WebTestInterfaces;
@@ -68,6 +70,11 @@ void ShellRenderProcessObserver::WebKitInitialized() {
webkit_glue::SetJavaScriptFlags(" --expose-gc");
RenderThread::Get()->RegisterExtension(extensions_v8::GCExtension::Get());
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kStableReleaseMode)) {
+ WebRuntimeFeatures::enableTestOnlyFeatures(true);
+ }
+
test_interfaces_.reset(new WebTestInterfaces);
test_interfaces_->resetAll();
}
diff --git a/chromium/content/shell/renderer/webkit_test_runner.cc b/chromium/content/shell/renderer/webkit_test_runner.cc
index a001300a461..69f32cc0a57 100644
--- a/chromium/content/shell/renderer/webkit_test_runner.cc
+++ b/chromium/content/shell/renderer/webkit_test_runner.cc
@@ -9,6 +9,7 @@
#include <cmath>
#include "base/base64.h"
+#include "base/command_line.h"
#include "base/debug/debugger.h"
#include "base/files/file_path.h"
#include "base/md5.h"
@@ -19,6 +20,7 @@
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
+#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/public/renderer/history_item_serialization.h"
#include "content/public/renderer/render_view.h"
@@ -66,6 +68,7 @@ using WebKit::WebArrayBufferView;
using WebKit::WebContextMenuData;
using WebKit::WebDevToolsAgent;
using WebKit::WebDeviceMotionData;
+using WebKit::WebDeviceOrientationData;
using WebKit::WebDeviceOrientation;
using WebKit::WebElement;
using WebKit::WebFrame;
@@ -109,14 +112,16 @@ void MakeBitmapOpaque(SkBitmap* bitmap) {
#endif
void CopyCanvasToBitmap(SkCanvas* canvas, SkBitmap* snapshot) {
- SkDevice* device = skia::GetTopDevice(*canvas);
+ SkBaseDevice* device = skia::GetTopDevice(*canvas);
const SkBitmap& bitmap = device->accessBitmap(false);
const bool success = bitmap.copyTo(snapshot, SkBitmap::kARGB_8888_Config);
DCHECK(success);
#if !defined(OS_MACOSX)
// Only the expected PNGs for Mac have a valid alpha channel.
- MakeBitmapOpaque(snapshot);
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableOverlayFullscreenVideo))
+ MakeBitmapOpaque(snapshot);
#endif
}
@@ -217,6 +222,11 @@ void WebKitTestRunner::setDeviceMotionData(const WebDeviceMotionData& data) {
SetMockDeviceMotionData(data);
}
+void WebKitTestRunner::setDeviceOrientationData(
+ const WebDeviceOrientationData& data) {
+ SetMockDeviceOrientationData(data);
+}
+
void WebKitTestRunner::printMessage(const std::string& message) {
Send(new ShellViewHostMsg_PrintMessage(routing_id(), message));
}
diff --git a/chromium/content/shell/renderer/webkit_test_runner.h b/chromium/content/shell/renderer/webkit_test_runner.h
index 0d63e76b1dc..de8d48f3caa 100644
--- a/chromium/content/shell/renderer/webkit_test_runner.h
+++ b/chromium/content/shell/renderer/webkit_test_runner.h
@@ -21,6 +21,7 @@ class SkCanvas;
namespace WebKit {
class WebDeviceMotionData;
+class WebDeviceOrientationData;
struct WebRect;
}
@@ -53,6 +54,8 @@ class WebKitTestRunner : public RenderViewObserver,
const std::string& value);
virtual void setGamepadData(const WebKit::WebGamepads& gamepads);
virtual void setDeviceMotionData(const WebKit::WebDeviceMotionData& data);
+ virtual void setDeviceOrientationData(
+ const WebKit::WebDeviceOrientationData& data);
virtual void printMessage(const std::string& message);
virtual void postTask(::WebTestRunner::WebTask* task);
virtual void postDelayedTask(::WebTestRunner::WebTask* task,