Skip to content

Commit

Permalink
Move blimp switches to core
Browse files Browse the repository at this point in the history
Currently the command line switches for blimp are in the app directory,
but the code that will be using it will need to live in
//blimp/client/core. This means that the switches should be made
available to that code.

It is not moved to the public directory because for now it should not
be necessary for embedders to use them, and we should aim for the
configurations there to be made available as real runtime APIs instead.

BUG=611097

Review-Url: https://codereview.chromium.org/2154363002
Cr-Commit-Position: refs/heads/master@{#406100}
  • Loading branch information
tommynyquist authored and Commit bot committed Jul 18, 2016
1 parent e91be6b commit 3f0f053
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 24 deletions.
14 changes: 3 additions & 11 deletions blimp/client/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ source_set("session") {

public_deps = [
":feature",
":switches",
"//blimp/client/core:switches",
"//components/safe_json",
"//ui/events",
]
Expand All @@ -46,7 +46,7 @@ source_set("client") {

public_deps = [
":session",
":switches",
"//blimp/client/core:switches",
"//components/safe_json",
"//components/url_formatter",
"//skia",
Expand All @@ -72,13 +72,6 @@ source_set("client") {
]
}

source_set("switches") {
sources = [
"app/blimp_client_switches.cc",
"app/blimp_client_switches.h",
]
}

source_set("blimp_client_unit_tests") {
testonly = true

Expand All @@ -87,9 +80,9 @@ source_set("blimp_client_unit_tests") {
deps = [
":client",
":session",
":switches",
"//base",
"//base/test:test_support",
"//blimp/client/core:switches",
"//blimp/common",
"//testing/gmock",
"//testing/gtest",
Expand Down Expand Up @@ -433,7 +426,6 @@ if (is_android) {
"app/android/java/src/org/chromium/blimp/auth/TokenSource.java",
"app/android/java/src/org/chromium/blimp/auth/TokenSourceImpl.java",
"app/android/java/src/org/chromium/blimp/BlimpApplication.java",
"app/android/java/src/org/chromium/blimp/BlimpClientSwitches.java",
"app/android/java/src/org/chromium/blimp/BlimpLibraryLoader.java",
"app/android/java/src/org/chromium/blimp/BlimpRendererActivity.java",
"app/android/java/src/org/chromium/blimp/BlimpView.java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.chromium.blimp.auth.RetryingTokenSource;
import org.chromium.blimp.auth.TokenSource;
import org.chromium.blimp.auth.TokenSourceImpl;
import org.chromium.blimp.core.BlimpClientSwitches;
import org.chromium.blimp.input.WebInputBox;
import org.chromium.blimp.preferences.PreferencesUtil;
import org.chromium.blimp.session.BlimpClientSession;
Expand Down
13 changes: 13 additions & 0 deletions blimp/client/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ source_set("unit_tests") {
]
}

source_set("switches") {
visibility = [
"//blimp/client/*",
"//blimp/engine:browser_tests",
]

sources = [
"blimp_client_switches.cc",
"blimp_client_switches.h",
]
}

if (is_android) {
# This target is here to let //chrome depend on
# //blimp/client/public:public_java and automatically get the correct
Expand All @@ -136,6 +148,7 @@ if (is_android) {

java_files = [
"android/java/src/org/chromium/blimp/core/BlimpClientContextImpl.java",
"android/java/src/org/chromium/blimp/core/BlimpClientSwitches.java",
"android/java/src/org/chromium/blimp/core/BlimpContentsFactory.java",
"android/java/src/org/chromium/blimp/core/BlimpContentsImpl.java",
"android/java/src/org/chromium/blimp/core/BlimpContentsObserverProxy.java",
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.

package org.chromium.blimp;
package org.chromium.blimp.core;

/**
* Contains all of the command line switches that are specific to the blimp/
Expand All @@ -13,7 +13,7 @@ public final class BlimpClientSwitches {
// Specifies the engine's IP address. Must be used in conjunction with
// --engine-port and --engine-transport.
// This is the same command line flag as kEngineIP in
// blimp/client/app/blimp_client_switches.cc
// blimp/client/core/blimp_client_switches.cc
public static final String ENGINE_IP = "engine-ip";

// Prevent instantiation.
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 "blimp/client/app/blimp_client_switches.h"
#include "blimp/client/core/blimp_client_switches.h"

namespace blimp {
namespace switches {
Expand All @@ -12,7 +12,7 @@ const char kEngineCertPath[] = "engine-cert-path";
// Specifies the engine's IP address. Must be used in conjunction with
// --engine-port and --engine-transport.
// This is the same command line flag as ENGINE_IP in
// blimp/client/app/android/java/src/org/chromium/blimp/BlimpClientSwitches.java
// android/java/src/org/chromium/blimp/core/BlimpClientSwitches.java
const char kEngineIP[] = "engine-ip";

const char kEnginePort[] = "engine-port";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Defines all the command-line switches used by //blimp.
// Defines all the command-line switches used by //blimp/client/core.

#ifndef BLIMP_CLIENT_APP_BLIMP_CLIENT_SWITCHES_H_
#define BLIMP_CLIENT_APP_BLIMP_CLIENT_SWITCHES_H_
#ifndef BLIMP_CLIENT_CORE_BLIMP_CLIENT_SWITCHES_H_
#define BLIMP_CLIENT_CORE_BLIMP_CLIENT_SWITCHES_H_

namespace blimp {
namespace switches {
Expand Down Expand Up @@ -36,4 +36,4 @@ extern const char kDownloadWholeDocument[];
} // namespace switches
} // namespace blimp

#endif // BLIMP_CLIENT_APP_BLIMP_CLIENT_SWITCHES_H_
#endif // BLIMP_CLIENT_CORE_BLIMP_CLIENT_SWITCHES_H_
2 changes: 1 addition & 1 deletion blimp/client/session/assignment_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "base/task_runner_util.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
#include "blimp/client/app/blimp_client_switches.h"
#include "blimp/client/core/blimp_client_switches.h"
#include "blimp/common/get_client_token.h"
#include "blimp/common/protocol_version.h"
#include "components/safe_json/safe_json_parser.h"
Expand Down
2 changes: 1 addition & 1 deletion blimp/client/session/assignment_source_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "base/test/test_simple_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "blimp/client/app/blimp_client_switches.h"
#include "blimp/client/core/blimp_client_switches.h"
#include "blimp/common/get_client_token.h"
#include "blimp/common/protocol_version.h"
#include "blimp/common/switches.h"
Expand Down
2 changes: 1 addition & 1 deletion blimp/client/session/blimp_client_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/threading/thread_task_runner_handle.h"
#include "blimp/client/app/blimp_client_switches.h"
#include "blimp/client/core/blimp_client_switches.h"
#include "blimp/client/feature/ime_feature.h"
#include "blimp/client/feature/navigation_feature.h"
#include "blimp/client/feature/render_widget_feature.h"
Expand Down
2 changes: 1 addition & 1 deletion blimp/engine/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,8 @@ source_set("browser_tests") {
"//base",
"//blimp/client:feature",
"//blimp/client:session",
"//blimp/client:switches",
"//blimp/client:test_support",
"//blimp/client/core:switches",
"//blimp/common",
"//blimp/engine:app",
"//blimp/engine:app_config",
Expand Down
1 change: 1 addition & 0 deletions blimp/engine/DEPS
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include_rules = [
"+base",
"-blimp/client",
"+cc",
"-chrome",
"+components/crash",
Expand Down
3 changes: 3 additions & 0 deletions blimp/engine/browser_tests/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include_rules = [
"+blimp/client",
]
2 changes: 1 addition & 1 deletion blimp/engine/browser_tests/blimp_browser_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "blimp/client/app/blimp_client_switches.h"
#include "blimp/client/core/blimp_client_switches.h"
#include "blimp/client/session/assignment_source.h"
#include "blimp/common/switches.h"
#include "blimp/engine/app/blimp_browser_main_parts.h"
Expand Down

0 comments on commit 3f0f053

Please sign in to comment.