forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chromecast: initial checkin of Android-based cast shell.
R=byungchul@chromium.org,lcwu@chromium.org,yfriedman@chromium.org BUG=400876 Review URL: https://codereview.chromium.org/490603002 Cr-Commit-Position: refs/heads/master@{#294476}
- Loading branch information
gunsch
authored and
Commit bot
committed
Sep 11, 2014
1 parent
149b92d
commit 407189f
Showing
43 changed files
with
1,865 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ include_rules = [ | |
"+crypto", | ||
"+grit/chromecast_settings.h", | ||
"+grit/shell_resources.h", | ||
"+jni", | ||
"+net", | ||
"+ui", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2014 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 "chromecast/android/cast_jni_registrar.h" | ||
|
||
#include "base/android/jni_android.h" | ||
#include "base/android/jni_registrar.h" | ||
#include "chromecast/android/chromecast_config_android.h" | ||
#include "chromecast/shell/browser/android/cast_window_android.h" | ||
#include "chromecast/shell/browser/android/cast_window_manager.h" | ||
|
||
namespace chromecast { | ||
namespace android { | ||
|
||
namespace { | ||
|
||
static base::android::RegistrationMethod kMethods[] = { | ||
{ "CastWindowAndroid", shell::CastWindowAndroid::RegisterJni }, | ||
{ "CastWindowManager", shell::RegisterCastWindowManager }, | ||
}; | ||
|
||
} // namespace | ||
|
||
bool RegisterJni(JNIEnv* env) { | ||
return RegisterNativeMethods(env, kMethods, arraysize(kMethods)); | ||
} | ||
|
||
} // namespace android | ||
} // namespace chromecast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2014 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 CHROMECAST_ANDROID_CAST_JNI_REGISTRAR_H_ | ||
#define CHROMECAST_ANDROID_CAST_JNI_REGISTRAR_H_ | ||
|
||
#include <jni.h> | ||
|
||
namespace chromecast { | ||
namespace android { | ||
|
||
// Register all JNI bindings necessary for the Android cast shell. | ||
bool RegisterJni(JNIEnv* env); | ||
|
||
} // namespace android | ||
} // namespace chromecast | ||
|
||
#endif // CHROMECAST_ANDROID_CAST_JNI_REGISTRAR_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2014 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 "chromecast/android/chromecast_config_android.h" | ||
|
||
namespace chromecast { | ||
namespace android { | ||
|
||
namespace { | ||
base::LazyInstance<ChromecastConfigAndroid> g_instance = | ||
LAZY_INSTANCE_INITIALIZER; | ||
} // namespace | ||
|
||
// static | ||
ChromecastConfigAndroid* ChromecastConfigAndroid::GetInstance() { | ||
return g_instance.Pointer(); | ||
} | ||
|
||
ChromecastConfigAndroid::ChromecastConfigAndroid() { | ||
} | ||
|
||
ChromecastConfigAndroid::~ChromecastConfigAndroid() { | ||
} | ||
|
||
// Registers a handler to be notified when SendUsageStats is changed. | ||
void ChromecastConfigAndroid::SetSendUsageStatsChangedCallback( | ||
const base::Callback<void(bool)>& callback) { | ||
send_usage_stats_changed_callback_ = callback; | ||
} | ||
|
||
} // namespace android | ||
} // namespace chromecast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2014 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 CHROMECAST_ANDROID_CHROMECAST_CONFIG_ANDROID_H_ | ||
#define CHROMECAST_ANDROID_CHROMECAST_CONFIG_ANDROID_H_ | ||
|
||
#include <jni.h> | ||
|
||
#include "base/callback.h" | ||
#include "base/lazy_instance.h" | ||
#include "base/macros.h" | ||
|
||
namespace chromecast { | ||
namespace android { | ||
|
||
class ChromecastConfigAndroid { | ||
public: | ||
static ChromecastConfigAndroid* GetInstance(); | ||
|
||
// Registers a handler to be notified when SendUsageStats is changed. | ||
void SetSendUsageStatsChangedCallback( | ||
const base::Callback<void(bool)>& callback); | ||
|
||
const base::Callback<void(bool)>& send_usage_stats_changed_callback() const { | ||
return send_usage_stats_changed_callback_; | ||
} | ||
|
||
private: | ||
friend struct base::DefaultLazyInstanceTraits<ChromecastConfigAndroid>; | ||
|
||
ChromecastConfigAndroid(); | ||
~ChromecastConfigAndroid(); | ||
|
||
base::Callback<void(bool)> send_usage_stats_changed_callback_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(ChromecastConfigAndroid); | ||
}; | ||
|
||
} // namespace android | ||
} // namespace chromecast | ||
|
||
#endif // CHROMECAST_ANDROID_CHROMECAST_CONFIG_ANDROID_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2014 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 CHROMECAST_ANDROID_PLATFORM_JNI_LOADER_H_ | ||
#define CHROMECAST_ANDROID_PLATFORM_JNI_LOADER_H_ | ||
|
||
#include <jni.h> | ||
|
||
namespace chromecast { | ||
namespace android { | ||
|
||
bool PlatformRegisterJni(JNIEnv* env); | ||
|
||
} // namespace android | ||
} // namespace chromecast | ||
|
||
#endif // CHROMECAST_ANDROID_PLATFORM_JNI_LOADER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2014 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 "chromecast/android/platform_jni_loader.h" | ||
|
||
namespace chromecast { | ||
namespace android { | ||
|
||
bool PlatformRegisterJni(JNIEnv* env) { | ||
// Intentional no-op for public build. | ||
return true; | ||
} | ||
|
||
} // namespace android | ||
} // namespace chromecast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Note(gunsch): This file is for the cast_shell_apk target in chromecast.gyp. | ||
See the notes above that target's 'java_in_dir' variable in chromecast.gyp. |
Oops, something went wrong.