Skip to content

Commit

Permalink
Move ash/ime to ui/chromeos/ime. This should make it easier
Browse files Browse the repository at this point in the history
to compile Athena without compiling Ash

BUG=426561
TEST=None
R=oshima, shuchen, sky

Review URL: https://codereview.chromium.org/680383008

Cr-Commit-Position: refs/heads/master@{#304271}
  • Loading branch information
pkotwicz authored and Commit bot committed Nov 14, 2014
1 parent b548de0 commit 347c774
Show file tree
Hide file tree
Showing 39 changed files with 201 additions and 172 deletions.
16 changes: 0 additions & 16 deletions ash/ash.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,6 @@
'host/root_window_transformer.h',
'host/transformer_helper.cc',
'host/transformer_helper.h',
'ime/candidate_view.cc',
'ime/candidate_view.h',
'ime/candidate_window_view.cc',
'ime/candidate_window_view.h',
'ime/infolist_window.cc',
'ime/infolist_window.h',
'ime/input_method_menu_item.cc',
'ime/input_method_menu_item.h',
'ime/input_method_menu_manager.cc',
'ime/input_method_menu_manager.h',
'ime/mode_indicator_view.cc',
'ime/mode_indicator_view.h',
'keyboard_uma_event_filter.cc',
'keyboard_uma_event_filter.h',
'magnifier/magnification_controller.cc',
Expand Down Expand Up @@ -800,10 +788,6 @@
'frame/custom_frame_view_ash_unittest.cc',
'frame/default_header_painter_unittest.cc',
'host/ash_window_tree_host_x11_unittest.cc',
'ime/candidate_view_unittest.cc',
'ime/candidate_window_view_unittest.cc',
'ime/input_method_menu_item_unittest.cc',
'ime/input_method_menu_manager_unittest.cc',
'keyboard_overlay/keyboard_overlay_delegate_unittest.cc',
'keyboard_overlay/keyboard_overlay_view_unittest.cc',
'magnifier/magnification_controller_unittest.cc',
Expand Down
4 changes: 0 additions & 4 deletions ash/ash_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,6 @@ Press Ctrl+Alt+Z to disable.
Press Control Shift Q twice to quit.
</message>

<message name="IDS_ASH_IME_INFOLIST_WINDOW_TITLE" desc="The title of the infolist window where the meanings and the usages of words are displayed.">
Information
</message>

<message name="IDS_ASH_CONTROL_KEY" desc="Name of [Ctrl] key name. Shouldn't be translated in many languages actually. This name should be lower case.">
ctrl
</message>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
#include <string>
#include <vector>

#include "ash/ime/infolist_window.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/wm/window_util.h"
#include "base/logging.h"
#include "chrome/browser/chromeos/input_method/mode_indicator_controller.h"
#include "ui/chromeos/ime/infolist_window.h"
#include "ui/gfx/screen.h"
#include "ui/views/widget/widget.h"

Expand Down Expand Up @@ -46,7 +46,7 @@ void CandidateWindowControllerImpl::InitCandidateWindowView() {

aura::Window* active_window = ash::wm::GetActiveWindow();
candidate_window_view_ =
new ash::ime::CandidateWindowView(ash::Shell::GetContainer(
new ui::ime::CandidateWindowView(ash::Shell::GetContainer(
active_window ? active_window->GetRootWindow()
: ash::Shell::GetTargetRootWindow(),
ash::kShellWindowId_SettingBubbleContainer));
Expand Down Expand Up @@ -143,7 +143,7 @@ void CandidateWindowControllerImpl::UpdateLookupTable(
if (infolist_window_) {
infolist_window_->Relayout(infolist_entries);
} else {
infolist_window_ = new ash::ime::InfolistWindow(
infolist_window_ = new ui::ime::InfolistWindow(
candidate_window_view_, infolist_entries);
infolist_window_->InitWidget();
infolist_window_->GetWidget()->AddObserver(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,19 @@

#include "chrome/browser/chromeos/input_method/candidate_window_controller.h"

#include "ash/ime/candidate_window_view.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "ui/base/ime/chromeos/ime_bridge.h"
#include "ui/base/ime/infolist_entry.h"
#include "ui/chromeos/ime/candidate_window_view.h"
#include "ui/views/widget/widget_observer.h"

namespace ash {
namespace ui {
class CandidateWindow;

namespace ime {
class InfolistWindow;
} // namespace ime
} // namespace ash

namespace ui {
class CandidateWindow;
} // namespace ui

namespace views {
Expand All @@ -38,7 +36,7 @@ class ModeIndicatorController;
// CandidateWindowController controls the CandidateWindow.
class CandidateWindowControllerImpl
: public CandidateWindowController,
public ash::ime::CandidateWindowView::Observer,
public ui::ime::CandidateWindowView::Observer,
public views::WidgetObserver,
public IMECandidateWindowHandlerInterface {
public:
Expand All @@ -59,7 +57,7 @@ class CandidateWindowControllerImpl
bool* has_highlighted);

private:
// ash::ime::CandidateWindowView::Observer implementation.
// ui::ime::CandidateWindowView::Observer implementation.
virtual void OnCandidateCommitted(int index) override;

// views::WidgetObserver implementation.
Expand All @@ -78,10 +76,10 @@ class CandidateWindowControllerImpl
void InitCandidateWindowView();

// The candidate window view.
ash::ime::CandidateWindowView* candidate_window_view_;
ui::ime::CandidateWindowView* candidate_window_view_;

// This is the outer frame of the infolist window view. Owned by the widget.
ash::ime::InfolistWindow* infolist_window_;
ui::ime::InfolistWindow* infolist_window_;

gfx::Rect cursor_bounds_;
gfx::Rect composition_head_;
Expand Down
17 changes: 10 additions & 7 deletions chrome/browser/chromeos/input_method/input_method_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
#undef RootWindow
#include <map>

#include "ash/ime/input_method_menu_item.h"
#include "ash/ime/input_method_menu_manager.h"
#include "ash/shell.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
Expand All @@ -28,6 +25,8 @@
#include "ui/base/ime/candidate_window.h"
#include "ui/base/ime/chromeos/ime_keymap.h"
#include "ui/base/ime/text_input_flags.h"
#include "ui/chromeos/ime/input_method_menu_item.h"
#include "ui/chromeos/ime/input_method_menu_manager.h"
#include "ui/events/event.h"
#include "ui/events/event_processor.h"
#include "ui/events/keycodes/dom4/keycode_converter.h"
Expand All @@ -38,6 +37,10 @@
#include "athena/screen/public/screen_manager.h"
#endif

#if defined(USE_ASH)
#include "ash/shell.h"
#endif

namespace chromeos {

namespace {
Expand Down Expand Up @@ -459,15 +462,15 @@ bool InputMethodEngine::UpdateMenuItems(
if (!IsActive())
return false;

ash::ime::InputMethodMenuItemList menu_item_list;
ui::ime::InputMethodMenuItemList menu_item_list;
for (std::vector<MenuItem>::const_iterator item = items.begin();
item != items.end(); ++item) {
ash::ime::InputMethodMenuItem property;
ui::ime::InputMethodMenuItem property;
MenuItemToProperty(*item, &property);
menu_item_list.push_back(property);
}

ash::ime::InputMethodMenuManager::GetInstance()->
ui::ime::InputMethodMenuManager::GetInstance()->
SetCurrentInputMethodMenuItemList(
menu_item_list);
return true;
Expand Down Expand Up @@ -662,7 +665,7 @@ void InputMethodEngine::SetSurroundingText(const std::string& text,
// TODO(uekawa): rename this method to a more reasonable name.
void InputMethodEngine::MenuItemToProperty(
const MenuItem& item,
ash::ime::InputMethodMenuItem* property) {
ui::ime::InputMethodMenuItem* property) {
property->key = item.id;

if (item.modified & MENU_ITEM_MODIFIED_LABEL) {
Expand Down
6 changes: 2 additions & 4 deletions chrome/browser/chromeos/input_method/input_method_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ class Profile;
namespace ui {
class CandidateWindow;
class KeyEvent;
} // namespace ui

namespace ash {
namespace ime {
struct InputMethodMenuItem;
} // namespace ime
} // namespace ash
} // namespace ui

namespace chromeos {

Expand Down Expand Up @@ -97,7 +95,7 @@ class InputMethodEngine : public InputMethodEngineInterface {
private:
// Converts MenuItem to InputMethodMenuItem.
void MenuItemToProperty(const MenuItem& item,
ash::ime::InputMethodMenuItem* property);
ui::ime::InputMethodMenuItem* property);

// Enables overriding input view page to Virtual Keyboard window.
void EnableInputView();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/ime/input_method_menu_item.h"
#include "ash/ime/input_method_menu_manager.h"
#include "base/bind_helpers.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
Expand All @@ -21,6 +19,8 @@
#include "ui/base/ime/chromeos/mock_ime_candidate_window_handler.h"
#include "ui/base/ime/chromeos/mock_ime_input_context_handler.h"
#include "ui/base/ime/text_input_flags.h"
#include "ui/chromeos/ime/input_method_menu_item.h"
#include "ui/chromeos/ime/input_method_menu_manager.h"
#include "ui/events/event.h"

namespace chromeos {
Expand Down Expand Up @@ -881,8 +881,8 @@ IN_PROC_BROWSER_TEST_P(InputMethodEngineBrowserTest,
ASSERT_TRUE(content::ExecuteScript(
host->host_contents(), set_menu_item_test_script));

const ash::ime::InputMethodMenuItemList& props =
ash::ime::InputMethodMenuManager::GetInstance()->
const ui::ime::InputMethodMenuItemList& props =
ui::ime::InputMethodMenuManager::GetInstance()->
GetCurrentInputMethodMenuItemList();
ASSERT_EQ(5U, props.size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#include <sstream>

#include "ash/ime/input_method_menu_item.h"
#include "ash/ime/input_method_menu_manager.h"
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/location.h"
Expand Down Expand Up @@ -38,6 +36,8 @@
#include "components/user_manager/user_manager.h"
#include "third_party/icu/source/common/unicode/uloc.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/chromeos/ime/input_method_menu_item.h"
#include "ui/chromeos/ime/input_method_menu_manager.h"
#include "ui/keyboard/keyboard_controller.h"
#include "ui/keyboard/keyboard_util.h"

Expand Down Expand Up @@ -982,9 +982,9 @@ void InputMethodManagerImpl::ChangeInputMethodInternal(
// extension IMEs via InputMethodEngine::(Set|Update)MenuItems.
// If the current input method is a keyboard layout, empty
// properties are sufficient.
const ash::ime::InputMethodMenuItemList empty_menu_item_list;
ash::ime::InputMethodMenuManager* input_method_menu_manager =
ash::ime::InputMethodMenuManager::GetInstance();
const ui::ime::InputMethodMenuItemList empty_menu_item_list;
ui::ime::InputMethodMenuManager* input_method_menu_manager =
ui::ime::InputMethodMenuManager::GetInstance();
input_method_menu_manager->SetCurrentInputMethodMenuItemList(
empty_menu_item_list);
}
Expand Down Expand Up @@ -1061,7 +1061,7 @@ void InputMethodManagerImpl::ActivateInputMethodMenuItem(
const std::string& key) {
DCHECK(!key.empty());

if (ash::ime::InputMethodMenuManager::GetInstance()->
if (ui::ime::InputMethodMenuManager::GetInstance()->
HasInputMethodMenuItemForKey(key)) {
IMEEngineHandlerInterface* engine =
IMEBridge::Get()->GetCurrentEngineHandler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include <algorithm>

#include "ash/ime/input_method_menu_item.h"
#include "ash/ime/input_method_menu_manager.h"
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
Expand All @@ -31,6 +29,8 @@
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/ime/chromeos/mock_ime_engine_handler.h"
#include "ui/base/ime/input_method_initializer.h"
#include "ui/chromeos/ime/input_method_menu_item.h"
#include "ui/chromeos/ime/input_method_menu_manager.h"
#include "ui/events/keycodes/keyboard_codes.h"

namespace chromeos {
Expand Down Expand Up @@ -61,7 +61,7 @@ std::string ImeIdFromEngineId(const std::string& id) {
}

class TestObserver : public InputMethodManager::Observer,
public ash::ime::InputMethodMenuManager::Observer {
public ui::ime::InputMethodMenuManager::Observer {
public:
TestObserver()
: input_method_changed_count_(0),
Expand All @@ -76,7 +76,7 @@ class TestObserver : public InputMethodManager::Observer,
last_show_message_ = show_message;
}
virtual void InputMethodMenuItemChanged(
ash::ime::InputMethodMenuManager* manager) override {
ui::ime::InputMethodMenuManager* manager) override {
++input_method_menu_item_changed_count_;
}

Expand Down Expand Up @@ -141,7 +141,7 @@ class InputMethodManagerImplTest : public BrowserWithTestWindowTest {
IMEBridge::Initialize();
IMEBridge::Get()->SetCurrentEngineHandler(mock_engine_handler_.get());

menu_manager_ = ash::ime::InputMethodMenuManager::GetInstance();
menu_manager_ = ui::ime::InputMethodMenuManager::GetInstance();

InitImeList();

Expand Down Expand Up @@ -325,7 +325,7 @@ class InputMethodManagerImplTest : public BrowserWithTestWindowTest {
FakeImeKeyboard* keyboard_;
MockComponentExtIMEManagerDelegate* mock_delegate_;
std::vector<ComponentExtensionIME> ime_list_;
ash::ime::InputMethodMenuManager* menu_manager_;
ui::ime::InputMethodMenuManager* menu_manager_;

private:
DISALLOW_COPY_AND_ASSIGN(InputMethodManagerImplTest);
Expand Down Expand Up @@ -799,8 +799,8 @@ TEST_F(InputMethodManagerImplTest, TestXkbSetting) {

TEST_F(InputMethodManagerImplTest, TestActivateInputMethodMenuItem) {
const std::string kKey = "key";
ash::ime::InputMethodMenuItemList menu_list;
menu_list.push_back(ash::ime::InputMethodMenuItem(
ui::ime::InputMethodMenuItemList menu_list;
menu_list.push_back(ui::ime::InputMethodMenuItem(
kKey, "label", false, false));
menu_manager_->SetCurrentInputMethodMenuItemList(menu_list);

Expand All @@ -826,8 +826,8 @@ TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodProperties) {
manager_->GetActiveIMEState()->ChangeInputMethod(
ImeIdFromEngineId(kNaclMozcUsId), false /* show_message */);

ash::ime::InputMethodMenuItemList current_property_list;
current_property_list.push_back(ash::ime::InputMethodMenuItem(
ui::ime::InputMethodMenuItemList current_property_list;
current_property_list.push_back(ui::ime::InputMethodMenuItem(
"key", "label", false, false));
menu_manager_->SetCurrentInputMethodMenuItemList(current_property_list);

Expand All @@ -852,8 +852,8 @@ TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodPropertiesTwoImes) {
EXPECT_EQ(2U, manager_->GetActiveIMEState()->GetNumActiveInputMethods());
EXPECT_TRUE(menu_manager_->GetCurrentInputMethodMenuItemList().empty());

ash::ime::InputMethodMenuItemList current_property_list;
current_property_list.push_back(ash::ime::InputMethodMenuItem("key-mozc",
ui::ime::InputMethodMenuItemList current_property_list;
current_property_list.push_back(ui::ime::InputMethodMenuItem("key-mozc",
"label",
false,
false));
Expand All @@ -870,7 +870,7 @@ TEST_F(InputMethodManagerImplTest, TestGetCurrentInputMethodPropertiesTwoImes) {

// Asynchronous property update signal from mozc-chewing.
current_property_list.clear();
current_property_list.push_back(ash::ime::InputMethodMenuItem(
current_property_list.push_back(ui::ime::InputMethodMenuItem(
"key-chewing", "label", false, false));
menu_manager_->SetCurrentInputMethodMenuItemList(current_property_list);
ASSERT_EQ(1U, menu_manager_->GetCurrentInputMethodMenuItemList().size());
Expand Down
Loading

0 comments on commit 347c774

Please sign in to comment.