Commit f44ffcbe authored by gunsch's avatar gunsch Committed by Commit bot

Reorganizes Chromecast code to better reflect functional dependencies.

Motivation:
* chromecast/service/ directory had interplay with chromecast/shell/browser
  code, since the service is all run in the browser process and mildly
  coupled (involves starting WebContents instances, etc,). Made more sense
  for chromecast/service to live in chromecast/shell/browser.
* chromecast/shell/ directory is needless hierarchy, since the entire
  chromecast/ directory represents the Chromecast content-embedder.

Highlights:
* chromecast/shell/{app,browser,common,renderer} --> chromecast/*
* chromecast/shell/browser/resources --> chromecast/app/resources
* chromecast/shell/settings --> chromecast/app/resources
* chromecast/shell/android --> chromecast/browser/android
* chromecast/metrics --> chromecast/browser/metrics
* chromecast/service --> chromecast/browser/service

R=lcwu@chromium.org,gusfernandez@chromium.org,byungchul@chromium.org
TBR=xhwang@chromium.org,asvitkine@chromium.org,thestig@chromium.org,jam@chromium.org,yfriedman@chromium.org
BUG=None

Review URL: https://codereview.chromium.org/638803002

Cr-Commit-Position: refs/heads/master@{#299385}
parent ef97146f
# Do not add any includes under chrome/ anywhere in chromecast.
include_rules = [
# Chromecast code should, in general, only depend on chromecast/common unless
# a dependency is otherwise explicitly declared.
# Chromecast code should explicitly declare its dependencies on each
# sub-directory within chromecast/.
"-chromecast",
"+chromecast/common",
# Other Chromecast-wide dependencies.
"+content/public/common",
......
include_rules = [
# Includes for JNI.
"+chromecast/android",
"+chromecast/browser/android",
"+chromecast/crash/android",
"+chromecast/shell/browser/android",
]
......@@ -6,10 +6,10 @@
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
#include "chromecast/browser/android/cast_window_android.h"
#include "chromecast/browser/android/cast_window_manager.h"
#include "chromecast/browser/android/external_video_surface_container_impl.h"
#include "chromecast/crash/android/crash_handler.h"
#include "chromecast/shell/browser/android/cast_window_android.h"
#include "chromecast/shell/browser/android/cast_window_manager.h"
#include "chromecast/shell/browser/android/external_video_surface_container_impl.h"
namespace chromecast {
namespace android {
......@@ -19,9 +19,9 @@ namespace {
static base::android::RegistrationMethod kMethods[] = {
{ "CastWindowAndroid", shell::CastWindowAndroid::RegisterJni },
{ "CastWindowManager", shell::RegisterCastWindowManager },
{ "CrashHandler", CrashHandler::RegisterCastCrashJni },
{ "ExternalVideoSurfaceContainer",
shell::RegisterExternalVideoSurfaceContainer },
{ "CrashHandler", CrashHandler::RegisterCastCrashJni },
};
} // namespace
......
include_rules = [
"+chromecast",
"+components/crash",
"+content/public/app",
"+content/public/browser",
......
include_rules = [
"+chromecast/android",
]
......@@ -10,7 +10,7 @@
#include "base/logging.h"
#include "chromecast/android/cast_jni_registrar.h"
#include "chromecast/android/platform_jni_loader.h"
#include "chromecast/shell/app/cast_main_delegate.h"
#include "chromecast/app/cast_main_delegate.h"
#include "content/public/app/android_library_loader_hooks.h"
#include "content/public/app/content_main.h"
#include "content/public/browser/android/compositor.h"
......
......@@ -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 "chromecast/shell/app/cast_main_delegate.h"
#include "chromecast/app/cast_main_delegate.h"
#include "content/public/app/content_main.h"
int main(int argc, const char** argv) {
......
......@@ -2,18 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromecast/shell/app/cast_main_delegate.h"
#include "chromecast/app/cast_main_delegate.h"
#include "base/command_line.h"
#include "base/cpu.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/posix/global_descriptors.h"
#include "chromecast/browser/cast_content_browser_client.h"
#include "chromecast/common/cast_paths.h"
#include "chromecast/common/cast_resource_delegate.h"
#include "chromecast/common/global_descriptors.h"
#include "chromecast/shell/browser/cast_content_browser_client.h"
#include "chromecast/shell/renderer/cast_content_renderer_client.h"
#include "chromecast/renderer/cast_content_renderer_client.h"
#include "content/public/browser/browser_main_runner.h"
#include "content/public/common/content_switches.h"
#include "ui/base/resource/resource_bundle.h"
......
......@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMECAST_SHELL_APP_CAST_MAIN_DELEGATE_H_
#define CHROMECAST_SHELL_APP_CAST_MAIN_DELEGATE_H_
#ifndef CHROMECAST_APP_CAST_MAIN_DELEGATE_H_
#define CHROMECAST_APP_CAST_MAIN_DELEGATE_H_
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "chromecast/shell/common/cast_content_client.h"
#include "chromecast/common/cast_content_client.h"
#include "content/public/app/content_main_delegate.h"
namespace content {
......@@ -59,4 +59,4 @@ class CastMainDelegate : public content::ContentMainDelegate {
} // namespace shell
} // namespace chromecast
#endif // CHROMECAST_SHELL_APP_CAST_MAIN_DELEGATE_H_
#endif // CHROMECAST_APP_CAST_MAIN_DELEGATE_H_
......@@ -14,12 +14,12 @@
# range for IDR_ is 1 to 28,671 and the range for IDS_ is 1 to 32,767 and
# common convention starts practical use of IDs at 100 or 101.
{
"SRCDIR": "../../../..",
"SRCDIR": "../..",
"chromecast/shell/browser/resources/shell_resources.grd": {
"app/resources/shell_resources.grd": {
"includes": [31000],
},
"chromecast/shell/settings/chromecast_settings.grd": {
"app/resources/chromecast_settings.grd": {
"messages": [31500],
},
}
include_rules = [
# chromecast/browser/ is the top-level main directory for the Chromecast
# embedder and can include from all other chromecast/ directories.
"+chromecast",
"+components/crash",
"+content/public/browser",
"+media/base",
......
......@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromecast/shell/browser/android/cast_window_android.h"
#include "chromecast/browser/android/cast_window_android.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/path_service.h"
#include "chromecast/shell/browser/android/cast_window_manager.h"
#include "chromecast/browser/android/cast_window_manager.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.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 CHROMECAST_SHELL_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_
#define CHROMECAST_SHELL_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_
#ifndef CHROMECAST_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_
#define CHROMECAST_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_
#include <jni.h>
#include <vector>
......@@ -94,4 +94,4 @@ class CastWindowAndroid : public content::WebContentsDelegate,
} // namespace shell
} // namespace chromecast
#endif // CHROMECAST_SHELL_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_
#endif // CHROMECAST_BROWSER_ANDROID_CAST_WINDOW_ANDROID_H_
......@@ -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 "chromecast/shell/browser/android/cast_window_manager.h"
#include "chromecast/browser/android/cast_window_manager.h"
#include <jni.h>
......@@ -11,13 +11,13 @@
#include "base/android/scoped_java_ref.h"
#include "base/bind.h"
#include "base/lazy_instance.h"
#include "chromecast/browser/android/cast_window_android.h"
#include "chromecast/browser/cast_browser_context.h"
#include "chromecast/browser/cast_browser_main_parts.h"
#include "chromecast/browser/cast_browser_process.h"
#include "chromecast/browser/cast_content_browser_client.h"
#include "chromecast/common/chromecast_config.h"
#include "chromecast/common/pref_names.h"
#include "chromecast/shell/browser/android/cast_window_android.h"
#include "chromecast/shell/browser/cast_browser_context.h"
#include "chromecast/shell/browser/cast_browser_main_parts.h"
#include "chromecast/shell/browser/cast_browser_process.h"
#include "chromecast/shell/browser/cast_content_browser_client.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "ipc/ipc_channel.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 CHROMECAST_SHELL_BROWSER_ANDROID_CAST_WINDOW_MANAGER_H_
#define CHROMECAST_SHELL_BROWSER_ANDROID_CAST_WINDOW_MANAGER_H_
#ifndef CHROMECAST_BROWSER_ANDROID_CAST_WINDOW_MANAGER_H_
#define CHROMECAST_BROWSER_ANDROID_CAST_WINDOW_MANAGER_H_
#include <jni.h>
......@@ -32,4 +32,4 @@ bool RegisterCastWindowManager(JNIEnv* env);
} // namespace shell
} // namespace chromecast
#endif // CHROMECAST_SHELL_BROWSER_ANDROID_CAST_WINDOW_MANAGER_H_
#endif // CHROMECAST_BROWSER_ANDROID_CAST_WINDOW_MANAGER_H_
......@@ -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 "chromecast/shell/browser/android/external_video_surface_container_impl.h"
#include "chromecast/browser/android/external_video_surface_container_impl.h"
#include "base/android/jni_android.h"
#include "content/public/browser/android/content_view_core.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 CHROMECAST_SHELL_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_CONTAINER_IMPL_H_
#define CHROMECAST_SHELL_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_CONTAINER_IMPL_H_
#ifndef CHROMECAST_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_CONTAINER_IMPL_H_
#define CHROMECAST_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_CONTAINER_IMPL_H_
#include <jni.h>
......@@ -54,4 +54,4 @@ bool RegisterExternalVideoSurfaceContainer(JNIEnv* env);
} // namespace shell
} // namespace chromecast
#endif // CHROMECAST_SHELL_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_CONTAINER_IMPL_H_
#endif // CHROMECAST_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_CONTAINER_IMPL_H_
......@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromecast/shell/browser/cast_browser_context.h"
#include "chromecast/browser/cast_browser_context.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/macros.h"
#include "base/path_service.h"
#include "chromecast/browser/cast_download_manager_delegate.h"
#include "chromecast/browser/url_request_context_factory.h"
#include "chromecast/common/cast_paths.h"
#include "chromecast/shell/browser/cast_download_manager_delegate.h"
#include "chromecast/shell/browser/url_request_context_factory.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/storage_partition.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 CHROMECAST_SHELL_BROWSER_CAST_BROWSER_CONTEXT_H_
#define CHROMECAST_SHELL_BROWSER_CAST_BROWSER_CONTEXT_H_
#ifndef CHROMECAST_BROWSER_CAST_BROWSER_CONTEXT_H_
#define CHROMECAST_BROWSER_CAST_BROWSER_CONTEXT_H_
#include "base/files/file_path.h"
#include "base/macros.h"
......@@ -64,4 +64,4 @@ class CastBrowserContext : public content::BrowserContext {
} // namespace shell
} // namespace chromecast
#endif // CHROMECAST_SHELL_BROWSER_CAST_BROWSER_CONTEXT_H_
#endif // CHROMECAST_BROWSER_CAST_BROWSER_CONTEXT_H_
......@@ -2,22 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromecast/shell/browser/cast_browser_main_parts.h"
#include "chromecast/browser/cast_browser_main_parts.h"
#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
#include "base/prefs/pref_registry_simple.h"
#include "chromecast/browser/cast_browser_context.h"
#include "chromecast/browser/cast_browser_process.h"
#include "chromecast/browser/devtools/remote_debugging_server.h"
#include "chromecast/browser/metrics/cast_metrics_prefs.h"
#include "chromecast/browser/metrics/cast_metrics_service_client.h"
#include "chromecast/browser/service/cast_service.h"
#include "chromecast/browser/url_request_context_factory.h"
#include "chromecast/browser/webui/webui_cast.h"
#include "chromecast/common/chromecast_config.h"
#include "chromecast/metrics/cast_metrics_prefs.h"
#include "chromecast/metrics/cast_metrics_service_client.h"
#include "chromecast/net/network_change_notifier_cast.h"
#include "chromecast/net/network_change_notifier_factory_cast.h"
#include "chromecast/service/cast_service.h"
#include "chromecast/shell/browser/cast_browser_context.h"
#include "chromecast/shell/browser/cast_browser_process.h"
#include "chromecast/shell/browser/devtools/remote_debugging_server.h"
#include "chromecast/shell/browser/url_request_context_factory.h"
#include "chromecast/shell/browser/webui/webui_cast.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
#include "media/base/media_switches.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 CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_
#define CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_
#ifndef CHROMECAST_BROWSER_CAST_BROWSER_MAIN_PARTS_H_
#define CHROMECAST_BROWSER_CAST_BROWSER_MAIN_PARTS_H_
#include "base/macros.h"
#include "base/memory/ref_counted.h"
......@@ -42,4 +42,4 @@ class CastBrowserMainParts : public content::BrowserMainParts {
} // namespace shell
} // namespace chromecast
#endif // CHROMECAST_SHELL_BROWSER_CAST_BROWSER_MAIN_PARTS_H_
#endif // CHROMECAST_BROWSER_CAST_BROWSER_MAIN_PARTS_H_
......@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromecast/shell/browser/cast_browser_process.h"
#include "chromecast/browser/cast_browser_process.h"
#include "base/logging.h"
#include "chromecast/metrics/cast_metrics_service_client.h"
#include "chromecast/service/cast_service.h"
#include "chromecast/shell/browser/cast_browser_context.h"
#include "chromecast/shell/browser/devtools/remote_debugging_server.h"
#include "chromecast/browser/cast_browser_context.h"
#include "chromecast/browser/devtools/remote_debugging_server.h"
#include "chromecast/browser/metrics/cast_metrics_service_client.h"
#include "chromecast/browser/service/cast_service.h"
#if defined(OS_ANDROID)
#include "components/crash/browser/crash_dump_manager_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 CHROMECAST_SHELL_BROWSER_CAST_BROWSER_PROCESS_H_
#define CHROMECAST_SHELL_BROWSER_CAST_BROWSER_PROCESS_H_
#ifndef CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_
#define CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
......@@ -66,4 +66,4 @@ class CastBrowserProcess {
} // namespace shell
} // namespace chromecast
#endif // CHROMECAST_SHELL_BROWSER_CAST_BROWSER_PROCESS_H_
#endif // CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_
......@@ -2,21 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromecast/shell/browser/cast_content_browser_client.h"
#include "chromecast/browser/cast_content_browser_client.h"
#include "base/command_line.h"
#include "base/files/scoped_file.h"
#include "base/i18n/rtl.h"
#include "base/path_service.h"
#include "chromecast/browser/cast_browser_context.h"
#include "chromecast/browser/cast_browser_main_parts.h"
#include "chromecast/browser/cast_browser_process.h"
#include "chromecast/browser/cast_network_delegate.h"
#include "chromecast/browser/devtools/cast_dev_tools_delegate.h"
#include "chromecast/browser/geolocation/cast_access_token_store.h"
#include "chromecast/browser/url_request_context_factory.h"
#include "chromecast/common/cast_paths.h"
#include "chromecast/common/global_descriptors.h"
#include "chromecast/shell/browser/cast_browser_context.h"
#include "chromecast/shell/browser/cast_browser_main_parts.h"
#include "chromecast/shell/browser/cast_browser_process.h"
#include "chromecast/shell/browser/cast_network_delegate.h"
#include "chromecast/shell/browser/devtools/cast_dev_tools_delegate.h"
#include "chromecast/shell/browser/geolocation/cast_access_token_store.h"
#include "chromecast/shell/browser/url_request_context_factory.h"
#include "components/crash/app/breakpad_linux.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/certificate_request_result_type.h"
......@@ -28,7 +28,7 @@
#include "net/ssl/ssl_cert_request_info.h"
#if defined(OS_ANDROID)
#include "chromecast/shell/browser/android/external_video_surface_container_impl.h"
#include "chromecast/browser/android/external_video_surface_container_impl.h"
#endif // defined(OS_ANDROID)
#if defined(OS_ANDROID)
......@@ -148,7 +148,6 @@ void CastContentBrowserClient::AllowCertificateError(
void CastContentBrowserClient::SelectClientCertificate(
int render_process_id,
int render_view_id,
const net::HttpNetworkSession* network_session,
net::SSLCertRequestInfo* cert_request_info,
const base::Callback<void(net::X509Certificate*)>& callback) {
GURL requesting_url("https://" + cert_request_info->host_and_port.ToString());
......
......@@ -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 CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_
#define CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_
#ifndef CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_
#define CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
......@@ -53,7 +53,6 @@ class CastContentBrowserClient: public content::ContentBrowserClient {
virtual void SelectClientCertificate(
int render_process_id,
int render_frame_id,
const net::HttpNetworkSession* network_session,
net::SSLCertRequestInfo* cert_request_info,
const base::Callback<void(net::X509Certificate*)>& callback) override;
virtual bool CanCreateWindow(
......@@ -95,4 +94,4 @@ class CastContentBrowserClient: public content::ContentBrowserClient {
} // namespace shell
} // namespace chromecast
#endif // CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_
#endif // CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_
......@@ -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 "chromecast/shell/browser/cast_download_manager_delegate.h"
#include "chromecast/browser/cast_download_manager_delegate.h"
#include "base/files/file_path.h"
#include "base/logging.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 CHROMECAST_SHELL_BROWSER_CAST_DOWNLOAD_MANAGER_DELEGATE_H_
#define CHROMECAST_SHELL_BROWSER_CAST_DOWNLOAD_MANAGER_DELEGATE_H_
#ifndef CHROMECAST_BROWSER_CAST_DOWNLOAD_MANAGER_DELEGATE_H_
#define CHROMECAST_BROWSER_CAST_DOWNLOAD_MANAGER_DELEGATE_H_
#include "base/macros.h"
#include "content/public/browser/download_manager_delegate.h"
......@@ -38,4 +38,4 @@ class CastDownloadManagerDelegate : public content::DownloadManagerDelegate {
} // namespace shell
} // namespace chromecast
#endif // CHROMECAST_SHELL_BROWSER_CAST_DOWNLOAD_MANAGER_DELEGATE_H_
\ No newline at end of file
#endif // CHROMECAST_BROWSER_CAST_DOWNLOAD_MANAGER_DELEGATE_H_
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment