Skip to content

Commit

Permalink
Change namespace to ash for //ash/services/ime
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
duswnchl authored and Chromium LUCI CQ committed Nov 11, 2021
1 parent 4d99a6f commit 2ee029d
Show file tree
Hide file tree
Showing 68 changed files with 254 additions and 283 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 chromeos {
namespace ash {
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 chromeos
} // namespace ash
8 changes: 1 addition & 7 deletions 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 chromeos {
namespace ash {
namespace ime {

// The path where ChromeOS default input methods is installed, consisting of
Expand All @@ -33,13 +33,7 @@ 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 chromeos {
namespace ash {
namespace ime {

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

} // namespace ime
} // namespace chromeos
} // namespace ash
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 chromeos {
namespace ash {
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 chromeos
} // namespace ash

#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 chromeos {
namespace ash {
namespace ime {

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

} // namespace ime
} // namespace chromeos
} // namespace ash
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 chromeos {
namespace ash {
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 chromeos
} // namespace ash

#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 chromeos {
namespace ash {
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,
(chromeos::ime::mojom::InputFieldInfoPtr input_field_info,
chromeos::ime::mojom::InputMethodSettingsPtr settings),
(mojom::InputFieldInfoPtr input_field_info,
mojom::InputMethodSettingsPtr settings),
(override));
MOCK_METHOD(void, OnBlur, (), (override));
MOCK_METHOD(void,
OnSurroundingTextChanged,
(const std::string& text,
uint32_t offset,
chromeos::ime::mojom::SelectionRangePtr selection_range),
mojom::SelectionRangePtr selection_range),
(override));
MOCK_METHOD(void, OnCompositionCanceledBySystem, (), (override));
MOCK_METHOD(void,
ProcessKeyEvent,
(chromeos::ime::mojom::PhysicalKeyEventPtr event,
(mojom::PhysicalKeyEventPtr event,
ProcessKeyEventCallback callback),
(override));
MOCK_METHOD(void,
Expand Down Expand Up @@ -196,4 +196,4 @@ TEST_F(SystemEngineTest, CanReceiveMessagesAfterBinding) {
}

} // namespace ime
} // namespace chromeos
} // namespace ash
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 chromeos {
namespace ash {
namespace ime {

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

} // namespace ime
} // namespace chromeos
} // namespace ash
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 chromeos {
namespace ash {
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 chromeos
} // namespace ash

#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 chromeos {
namespace ash {
namespace ime {

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

} // namespace ime
} // namespace chromeos
} // namespace ash
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 chromeos {
namespace ash {
namespace ime {

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

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

#endif // ASH_SERVICES_IME_IME_SANDBOX_HOOK_H_
9 changes: 4 additions & 5 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 chromeos {
namespace ash {
namespace ime {

namespace {
Expand Down Expand Up @@ -142,11 +142,10 @@ 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(
chromeos::features::kAssistEmojiEnhanced);
return base::FeatureList::IsEnabled(features::kAssistEmojiEnhanced);
}
if (strcmp(feature_name, "AssistiveMultiWord") == 0) {
return chromeos::features::IsAssistiveMultiWordEnabled();
return features::IsAssistiveMultiWordEnabled();
}
if (strcmp(feature_name, "AssistiveMultiWordLacrosSupport") == 0) {
return base::FeatureList::IsEnabled(
Expand Down Expand Up @@ -238,4 +237,4 @@ ImeCrosDownloader* ImeService::GetDownloader() {
}

} // namespace ime
} // namespace chromeos
} // namespace ash
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 chromeos {
namespace ash {
namespace ime {

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

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

#endif // ASH_SERVICES_IME_IME_SERVICE_H_
17 changes: 8 additions & 9 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 chromeos {
namespace ash {
namespace ime {

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

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

Expand Down Expand Up @@ -163,8 +162,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<::chromeos::ime::TextSuggestion>&
suggestions) override {}
void DisplaySuggestions(
const std::vector<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 @@ -698,4 +697,4 @@ TEST_F(ImeServiceTest, KhmerKeyboardAltGr) {
}

} // namespace ime
} // namespace chromeos
} // namespace ash
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 chromeos {
namespace ash {
namespace ime {

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

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

#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 chromeos {
namespace ash {
namespace ime {

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

} // namespace ime
} // namespace chromeos
} // namespace ash
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 chromeos {
namespace ash {
namespace ime {

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

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

#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 chromeos {
namespace ash {
namespace ime {
namespace rulebased {

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

} // namespace rulebased
} // namespace ime
} // namespace chromeos
} // namespace ash
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 chromeos {
namespace ash {
namespace ime {
namespace rulebased {

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

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

#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,11 +12,11 @@
#include "base/cxx17_backports.h"
#include "testing/libfuzzer/proto/lpm_interface.h"

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

namespace {

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

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

0 comments on commit 2ee029d

Please sign in to comment.