Skip to content

Commit

Permalink
Revert "Change namespace to ash for //ash/services/ime"
Browse files Browse the repository at this point in the history
This reverts commit 2ee029d.

Reason for revert: Suspect this CL has caused build failure on ChromeOS bots
Sample failure: https://ci.chromium.org/ui/p/chrome/builders/ci/chromeos-eve-chrome/18898/overview

Original change's description:
> Change namespace to ash for //ash/services/ime
>
> Codes in //ash/services/ime are a part of the ash-chrome, so namespace
> is changed to ash.
>
> This CL is part of the Chrome OS source code directory migration:
> https://docs.google.com/document/d/1g-98HpzA8XcoGBWUv1gQNr4rbnD5yfvbtYZyPDDbkaE.
>
> Bug: 1164001
> Change-Id: Ib32db96afec720a21b518913cdfa69ac4dc210fd
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3269789
> Commit-Queue: Yeunjoo Choi <ychoi@igalia.com>
> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
> Owners-Override: Hidehiko Abe <hidehiko@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#940616}

TBR=hidehiko@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com,ychoi@igalia.com

Change-Id: I5b74a10db43be8d27a97ab26ce60ae15f874b3ab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1164001
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3274345
Reviewed-by: Yuki Yamada <yukiy@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Owners-Override: Yuki Yamada <yukiy@chromium.org>
Commit-Queue: Yuki Yamada <yukiy@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940662}
  • Loading branch information
yukidmy authored and Chromium LUCI CQ committed Nov 11, 2021
1 parent a091bcd commit bc494c0
Show file tree
Hide file tree
Showing 68 changed files with 283 additions and 254 deletions.
4 changes: 2 additions & 2 deletions ash/services/ime/constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define FPL FILE_PATH_LITERAL
#define IME_DIR_STRING "input_methods"

namespace ash {
namespace chromeos {
namespace ime {

const base::FilePath::CharType kInputMethodsDirName[] =
Expand All @@ -39,4 +39,4 @@ const base::FilePath::CharType kLanguageDataDirName[] =
const char kGoogleKeyboardDownloadDomain[] = "dl.google.com";

} // namespace ime
} // namespace ash
} // namespace chromeos
8 changes: 7 additions & 1 deletion ash/services/ime/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "base/component_export.h"
#include "base/files/file_path.h"

namespace ash {
namespace chromeos {
namespace ime {

// The path where ChromeOS default input methods is installed, consisting of
Expand All @@ -33,7 +33,13 @@ extern const base::FilePath::CharType kLanguageDataDirName[];
// The domain of Google Keyboard language dictionary download URL.
COMPONENT_EXPORT(ASH_IME_CONSTANTS)
extern const char kGoogleKeyboardDownloadDomain[];
} // namespace ime
} // namespace chromeos

// TODO(https://crbug.com/1164001): remove when moved to ash.
namespace ash {
namespace ime {
using ::chromeos::ime::kBundledInputMethodsDirPath;
} // namespace ime
} // namespace ash

Expand Down
4 changes: 2 additions & 2 deletions ash/services/ime/decoder/decoder_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"

namespace ash {
namespace chromeos {
namespace ime {

namespace {
Expand Down Expand Up @@ -114,4 +114,4 @@ void DecoderEngine::ProcessMessage(const std::vector<uint8_t>& message,
}

} // namespace ime
} // namespace ash
} // namespace chromeos
4 changes: 2 additions & 2 deletions ash/services/ime/decoder/decoder_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

namespace ash {
namespace chromeos {
namespace ime {

// A Mojo wrapper around a "decoder" that converts key events and pointer events
Expand Down Expand Up @@ -59,6 +59,6 @@ class DecoderEngine : public mojom::InputChannel {
};

} // namespace ime
} // namespace ash
} // namespace chromeos

#endif // ASH_SERVICES_IME_DECODER_DECODER_ENGINE_H_
4 changes: 2 additions & 2 deletions ash/services/ime/decoder/system_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"

namespace ash {
namespace chromeos {
namespace ime {

SystemEngine::SystemEngine(ImeCrosPlatform* platform) : platform_(platform) {
Expand Down Expand Up @@ -49,4 +49,4 @@ bool SystemEngine::IsConnected() {
}

} // namespace ime
} // namespace ash
} // namespace chromeos
4 changes: 2 additions & 2 deletions ash/services/ime/decoder/system_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

namespace ash {
namespace chromeos {
namespace ime {

// An enhanced implementation of the basic InputEngine that uses a built-in
Expand Down Expand Up @@ -53,6 +53,6 @@ class SystemEngine : public InputEngine {
};

} // namespace ime
} // namespace ash
} // namespace chromeos

#endif // ASH_SERVICES_IME_DECODER_SYSTEM_ENGINE_H_
12 changes: 6 additions & 6 deletions ash/services/ime/decoder/system_engine_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace ash {
namespace chromeos {
namespace ime {

constexpr char kImeSpec[] = "xkb:us::eng";
Expand All @@ -30,20 +30,20 @@ mojo::ScopedMessagePipeHandle MessagePipeHandleFromInt(uint32_t handle) {
struct MockInputMethod : public mojom::InputMethod {
MOCK_METHOD(void,
OnFocus,
(mojom::InputFieldInfoPtr input_field_info,
mojom::InputMethodSettingsPtr settings),
(chromeos::ime::mojom::InputFieldInfoPtr input_field_info,
chromeos::ime::mojom::InputMethodSettingsPtr settings),
(override));
MOCK_METHOD(void, OnBlur, (), (override));
MOCK_METHOD(void,
OnSurroundingTextChanged,
(const std::string& text,
uint32_t offset,
mojom::SelectionRangePtr selection_range),
chromeos::ime::mojom::SelectionRangePtr selection_range),
(override));
MOCK_METHOD(void, OnCompositionCanceledBySystem, (), (override));
MOCK_METHOD(void,
ProcessKeyEvent,
(mojom::PhysicalKeyEventPtr event,
(chromeos::ime::mojom::PhysicalKeyEventPtr event,
ProcessKeyEventCallback callback),
(override));
MOCK_METHOD(void,
Expand Down Expand Up @@ -196,4 +196,4 @@ TEST_F(SystemEngineTest, CanReceiveMessagesAfterBinding) {
}

} // namespace ime
} // namespace ash
} // namespace chromeos
4 changes: 2 additions & 2 deletions ash/services/ime/ime_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "base/files/file_util.h"
#include "base/logging.h"

namespace ash {
namespace chromeos {
namespace ime {

namespace {
Expand Down Expand Up @@ -142,4 +142,4 @@ void FakeDecoderEntryPointsForTesting( // IN-TEST
}

} // namespace ime
} // namespace ash
} // namespace chromeos
4 changes: 2 additions & 2 deletions ash/services/ime/ime_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "base/scoped_native_library.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

namespace ash {
namespace chromeos {
namespace ime {

// A proxy class for the IME decoder.
Expand Down Expand Up @@ -76,6 +76,6 @@ void FakeDecoderEntryPointsForTesting(
const ImeDecoder::EntryPoints& decoder_entry_points);

} // namespace ime
} // namespace ash
} // namespace chromeos

#endif // ASH_SERVICES_IME_IME_DECODER_H_
4 changes: 2 additions & 2 deletions ash/services/ime/ime_sandbox_hook.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using sandbox::syscall_broker::BrokerFilePermission;
using sandbox::syscall_broker::MakeBrokerCommandSet;

namespace ash {
namespace chromeos {
namespace ime {

namespace {
Expand Down Expand Up @@ -83,4 +83,4 @@ bool ImePreSandboxHook(sandbox::policy::SandboxLinux::Options options) {
}

} // namespace ime
} // namespace ash
} // namespace chromeos
4 changes: 2 additions & 2 deletions ash/services/ime/ime_sandbox_hook.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

#include "sandbox/policy/linux/sandbox_linux.h"

namespace ash {
namespace chromeos {
namespace ime {

bool ImePreSandboxHook(sandbox::policy::SandboxLinux::Options options);

} // namespace ime
} // namespace ash
} // namespace chromeos

#endif // ASH_SERVICES_IME_IME_SANDBOX_HOOK_H_
9 changes: 5 additions & 4 deletions ash/services/ime/ime_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "base/task/sequenced_task_runner.h"
#include "mojo/public/c/system/thunks.h"

namespace ash {
namespace chromeos {
namespace ime {

namespace {
Expand Down Expand Up @@ -142,10 +142,11 @@ void ImeService::RunInMainSequence(ImeSequencedTask task, int task_id) {

bool ImeService::IsFeatureEnabled(const char* feature_name) {
if (strcmp(feature_name, "AssistiveEmojiEnhanced") == 0) {
return base::FeatureList::IsEnabled(features::kAssistEmojiEnhanced);
return base::FeatureList::IsEnabled(
chromeos::features::kAssistEmojiEnhanced);
}
if (strcmp(feature_name, "AssistiveMultiWord") == 0) {
return features::IsAssistiveMultiWordEnabled();
return chromeos::features::IsAssistiveMultiWordEnabled();
}
if (strcmp(feature_name, "AssistiveMultiWordLacrosSupport") == 0) {
return base::FeatureList::IsEnabled(
Expand Down Expand Up @@ -237,4 +238,4 @@ ImeCrosDownloader* ImeService::GetDownloader() {
}

} // namespace ime
} // namespace ash
} // namespace chromeos
4 changes: 2 additions & 2 deletions ash/services/ime/ime_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h"

namespace ash {
namespace chromeos {
namespace ime {

class ImeService : public mojom::ImeService,
Expand Down Expand Up @@ -97,6 +97,6 @@ class ImeService : public mojom::ImeService,
};

} // namespace ime
} // namespace ash
} // namespace chromeos

#endif // ASH_SERVICES_IME_IME_SERVICE_H_
17 changes: 9 additions & 8 deletions ash/services/ime/ime_service_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

using testing::_;

namespace ash {
namespace chromeos {
namespace ime {

namespace {
Expand Down Expand Up @@ -74,15 +74,16 @@ class TestDecoderState : public mojom::InputMethod {

private:
// mojom::InputMethod:
void OnFocus(mojom::InputFieldInfoPtr input_field_info,
mojom::InputMethodSettingsPtr settings) override {}
void OnFocus(chromeos::ime::mojom::InputFieldInfoPtr input_field_info,
chromeos::ime::mojom::InputMethodSettingsPtr settings) override {
}
void OnBlur() override {}
void OnSurroundingTextChanged(
const std::string& text,
uint32_t offset,
mojom::SelectionRangePtr selection_range) override {}
chromeos::ime::mojom::SelectionRangePtr selection_range) override {}
void OnCompositionCanceledBySystem() override {}
void ProcessKeyEvent(mojom::PhysicalKeyEventPtr event,
void ProcessKeyEvent(chromeos::ime::mojom::PhysicalKeyEventPtr event,
ProcessKeyEventCallback callback) override {}
void OnCandidateSelected(uint32_t selected_candidate_index) override {}

Expand Down Expand Up @@ -162,8 +163,8 @@ class ImeServiceTest : public testing::Test, public mojom::InputMethodHost {
void HandleAutocorrect(mojom::AutocorrectSpanPtr autocorrect_span) override {}
void RequestSuggestions(mojom::SuggestionsRequestPtr request,
RequestSuggestionsCallback callback) override {}
void DisplaySuggestions(
const std::vector<TextSuggestion>& suggestions) override {}
void DisplaySuggestions(const std::vector<::chromeos::ime::TextSuggestion>&
suggestions) override {}
void UpdateCandidatesWindow(mojom::CandidatesWindowPtr window) override {}
void RecordUkm(mojom::UkmEntryPtr entry) override {}
void ReportKoreanAction(mojom::KoreanAction action) override {}
Expand Down Expand Up @@ -697,4 +698,4 @@ TEST_F(ImeServiceTest, KhmerKeyboardAltGr) {
}

} // namespace ime
} // namespace ash
} // namespace chromeos
4 changes: 2 additions & 2 deletions ash/services/ime/input_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef ASH_SERVICES_IME_INPUT_ENGINE_H_
#define ASH_SERVICES_IME_INPUT_ENGINE_H_

namespace ash {
namespace chromeos {
namespace ime {

// Base class for all input engines.
Expand All @@ -17,6 +17,6 @@ struct InputEngine {
};

} // namespace ime
} // namespace ash
} // namespace chromeos

#endif // ASH_SERVICES_IME_INPUT_ENGINE_H_
4 changes: 2 additions & 2 deletions ash/services/ime/mock_input_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "ash/services/ime/mock_input_channel.h"

namespace ash {
namespace chromeos {
namespace ime {

MockInputChannel::MockInputChannel() : receiver_(this) {}
Expand All @@ -30,4 +30,4 @@ void MockInputChannel::ProcessMessage(const std::vector<uint8_t>& message,
}

} // namespace ime
} // namespace ash
} // namespace chromeos
4 changes: 2 additions & 2 deletions ash/services/ime/mock_input_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "mojo/public/cpp/bindings/receiver.h"
#include "testing/gmock/include/gmock/gmock.h"

namespace ash {
namespace chromeos {
namespace ime {

// A mock receiver InputChannel.
Expand All @@ -36,6 +36,6 @@ class MockInputChannel : public mojom::InputChannel {
};

} // namespace ime
} // namespace ash
} // namespace chromeos

#endif // ASH_SERVICES_IME_MOCK_INPUT_CHANNEL_H_
4 changes: 2 additions & 2 deletions ash/services/ime/public/cpp/rulebased/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "ash/services/ime/public/cpp/rulebased/rules_data.h"
#include "base/strings/utf_string_conversions.h"

namespace ash {
namespace chromeos {
namespace ime {
namespace rulebased {

Expand Down Expand Up @@ -148,4 +148,4 @@ ProcessKeyResult Engine::ProcessBackspace() {

} // namespace rulebased
} // namespace ime
} // namespace ash
} // namespace chromeos
4 changes: 2 additions & 2 deletions ash/services/ime/public/cpp/rulebased/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "ash/services/ime/public/mojom/input_method.mojom.h"

namespace ash {
namespace chromeos {
namespace ime {
namespace rulebased {

Expand Down Expand Up @@ -69,6 +69,6 @@ class Engine {

} // namespace rulebased
} // namespace ime
} // namespace ash
} // namespace chromeos

#endif // ASH_SERVICES_IME_PUBLIC_CPP_RULEBASED_ENGINE_H_
6 changes: 3 additions & 3 deletions ash/services/ime/public/cpp/rulebased/rulebased_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#include "base/cxx17_backports.h"
#include "testing/libfuzzer/proto/lpm_interface.h"

namespace {
namespace rulebased = chromeos::ime::rulebased;
namespace mojom = chromeos::ime::mojom;

namespace rulebased = ::ash::ime::rulebased;
namespace mojom = ::ash::ime::mojom;
namespace {

// Must match ash/services/ime/public/cpp/rulebased/rulebased_fuzzer.proto
constexpr mojom::DomCode kKeyCodes[] = {
Expand Down
Loading

0 comments on commit bc494c0

Please sign in to comment.