Skip to content

Commit

Permalink
Reorganizes Chromecast code to better reflect functional dependencies.
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
gunsch authored and Commit bot committed Oct 13, 2014
1 parent ef97146 commit f44ffcb
Show file tree
Hide file tree
Showing 153 changed files with 305 additions and 369 deletions.
5 changes: 2 additions & 3 deletions chromecast/DEPS
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# 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",
Expand Down
2 changes: 1 addition & 1 deletion chromecast/android/DEPS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_rules = [
# Includes for JNI.
"+chromecast/android",
"+chromecast/browser/android",
"+chromecast/crash/android",
"+chromecast/shell/browser/android",
]
8 changes: 4 additions & 4 deletions chromecast/android/cast_jni_registrar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions chromecast/shell/app/DEPS → chromecast/app/DEPS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_rules = [
"+chromecast",
"+components/crash",
"+content/public/app",
"+content/public/browser",
Expand Down
3 changes: 3 additions & 0 deletions chromecast/app/android/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include_rules = [
"+chromecast/android",
]
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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],
},
}
8 changes: 8 additions & 0 deletions chromecast/browser/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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",
]
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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_
Loading

0 comments on commit f44ffcb

Please sign in to comment.