diff options
author | simon.hong81@gmail.com <simon.hong81@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-24 06:16:09 +0000 |
---|---|---|
committer | simon.hong81@gmail.com <simon.hong81@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-24 06:16:09 +0000 |
commit | a847eba3b388fe9091c80aed23276fa9f12b5d3d (patch) | |
tree | 77170945e913d802c377ba07c71733c428a4b2b9 /ash | |
parent | ef8a1ac33a83325033f3ff4214c9a0b6ba2ba090 (diff) | |
download | chromium_src-a847eba3b388fe9091c80aed23276fa9f12b5d3d.zip chromium_src-a847eba3b388fe9091c80aed23276fa9f12b5d3d.tar.gz chromium_src-a847eba3b388fe9091c80aed23276fa9f12b5d3d.tar.bz2 |
Rename SwitchToWindow() to LaunchAppIndexAt()
Its function is launch app in the launcher. But its name is a liitle bit
different from functionality.
BUG=NONE
TEST=manual test
Review URL: https://chromiumcodereview.appspot.com/17551014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208151 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/accelerators/accelerator_controller.cc | 36 | ||||
-rw-r--r-- | ash/accelerators/accelerator_table.cc | 18 | ||||
-rw-r--r-- | ash/accelerators/accelerator_table.h | 18 | ||||
-rw-r--r-- | ash/launcher/launcher.cc | 6 | ||||
-rw-r--r-- | ash/launcher/launcher.h | 6 |
5 files changed, 42 insertions, 42 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index 39f7aaa..b3e2b8d 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -762,32 +762,32 @@ bool AcceleratorController::PerformAction(int action, if (ime_control_delegate_) return ime_control_delegate_->HandleSwitchIme(accelerator); break; - case SELECT_WIN_0: - Launcher::ForPrimaryDisplay()->SwitchToWindow(0); + case LAUNCH_APP_0: + Launcher::ForPrimaryDisplay()->LaunchAppIndexAt(0); return true; - case SELECT_WIN_1: - Launcher::ForPrimaryDisplay()->SwitchToWindow(1); + case LAUNCH_APP_1: + Launcher::ForPrimaryDisplay()->LaunchAppIndexAt(1); return true; - case SELECT_WIN_2: - Launcher::ForPrimaryDisplay()->SwitchToWindow(2); + case LAUNCH_APP_2: + Launcher::ForPrimaryDisplay()->LaunchAppIndexAt(2); return true; - case SELECT_WIN_3: - Launcher::ForPrimaryDisplay()->SwitchToWindow(3); + case LAUNCH_APP_3: + Launcher::ForPrimaryDisplay()->LaunchAppIndexAt(3); return true; - case SELECT_WIN_4: - Launcher::ForPrimaryDisplay()->SwitchToWindow(4); + case LAUNCH_APP_4: + Launcher::ForPrimaryDisplay()->LaunchAppIndexAt(4); return true; - case SELECT_WIN_5: - Launcher::ForPrimaryDisplay()->SwitchToWindow(5); + case LAUNCH_APP_5: + Launcher::ForPrimaryDisplay()->LaunchAppIndexAt(5); return true; - case SELECT_WIN_6: - Launcher::ForPrimaryDisplay()->SwitchToWindow(6); + case LAUNCH_APP_6: + Launcher::ForPrimaryDisplay()->LaunchAppIndexAt(6); return true; - case SELECT_WIN_7: - Launcher::ForPrimaryDisplay()->SwitchToWindow(7); + case LAUNCH_APP_7: + Launcher::ForPrimaryDisplay()->LaunchAppIndexAt(7); return true; - case SELECT_LAST_WIN: - Launcher::ForPrimaryDisplay()->SwitchToWindow(-1); + case LAUNCH_LAST_APP: + Launcher::ForPrimaryDisplay()->LaunchAppIndexAt(-1); return true; case WINDOW_SNAP_LEFT: case WINDOW_SNAP_RIGHT: { diff --git a/ash/accelerators/accelerator_table.cc b/ash/accelerators/accelerator_table.cc index 93298fe..6e7af10 100644 --- a/ash/accelerators/accelerator_table.cc +++ b/ash/accelerators/accelerator_table.cc @@ -130,15 +130,15 @@ const AcceleratorData kAcceleratorData[] = { { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, SHOW_SYSTEM_TRAY_BUBBLE }, { true, ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN, SHOW_TASK_MANAGER }, - { true, ui::VKEY_1, ui::EF_ALT_DOWN, SELECT_WIN_0 }, - { true, ui::VKEY_2, ui::EF_ALT_DOWN, SELECT_WIN_1 }, - { true, ui::VKEY_3, ui::EF_ALT_DOWN, SELECT_WIN_2 }, - { true, ui::VKEY_4, ui::EF_ALT_DOWN, SELECT_WIN_3 }, - { true, ui::VKEY_5, ui::EF_ALT_DOWN, SELECT_WIN_4 }, - { true, ui::VKEY_6, ui::EF_ALT_DOWN, SELECT_WIN_5 }, - { true, ui::VKEY_7, ui::EF_ALT_DOWN, SELECT_WIN_6 }, - { true, ui::VKEY_8, ui::EF_ALT_DOWN, SELECT_WIN_7 }, - { true, ui::VKEY_9, ui::EF_ALT_DOWN, SELECT_LAST_WIN }, + { true, ui::VKEY_1, ui::EF_ALT_DOWN, LAUNCH_APP_0 }, + { true, ui::VKEY_2, ui::EF_ALT_DOWN, LAUNCH_APP_1 }, + { true, ui::VKEY_3, ui::EF_ALT_DOWN, LAUNCH_APP_2 }, + { true, ui::VKEY_4, ui::EF_ALT_DOWN, LAUNCH_APP_3 }, + { true, ui::VKEY_5, ui::EF_ALT_DOWN, LAUNCH_APP_4 }, + { true, ui::VKEY_6, ui::EF_ALT_DOWN, LAUNCH_APP_5 }, + { true, ui::VKEY_7, ui::EF_ALT_DOWN, LAUNCH_APP_6 }, + { true, ui::VKEY_8, ui::EF_ALT_DOWN, LAUNCH_APP_7 }, + { true, ui::VKEY_9, ui::EF_ALT_DOWN, LAUNCH_LAST_APP }, // Window management shortcuts. { true, ui::VKEY_OEM_4, ui::EF_ALT_DOWN, WINDOW_SNAP_LEFT }, diff --git a/ash/accelerators/accelerator_table.h b/ash/accelerators/accelerator_table.h index 563a7c5..277baaf 100644 --- a/ash/accelerators/accelerator_table.h +++ b/ash/accelerators/accelerator_table.h @@ -34,6 +34,15 @@ enum AcceleratorAction { FOCUS_PREVIOUS_PANE, KEYBOARD_BRIGHTNESS_DOWN, KEYBOARD_BRIGHTNESS_UP, + LAUNCH_APP_0, + LAUNCH_APP_1, + LAUNCH_APP_2, + LAUNCH_APP_3, + LAUNCH_APP_4, + LAUNCH_APP_5, + LAUNCH_APP_6, + LAUNCH_APP_7, + LAUNCH_LAST_APP, LOCK_PRESSED, LOCK_RELEASED, MAGNIFY_SCREEN_ZOOM_IN, @@ -59,15 +68,6 @@ enum AcceleratorAction { SCALE_UI_DOWN, SCALE_UI_RESET, SCALE_UI_UP, - SELECT_LAST_WIN, - SELECT_WIN_0, - SELECT_WIN_1, - SELECT_WIN_2, - SELECT_WIN_3, - SELECT_WIN_4, - SELECT_WIN_5, - SELECT_WIN_6, - SELECT_WIN_7, SHOW_KEYBOARD_OVERLAY, SHOW_MESSAGE_CENTER_BUBBLE, SHOW_OAK, diff --git a/ash/launcher/launcher.cc b/ash/launcher/launcher.cc index 8991c35..03e7ff8 100644 --- a/ash/launcher/launcher.cc +++ b/ash/launcher/launcher.cc @@ -146,11 +146,11 @@ views::View* Launcher::GetAppListButtonView() const { return launcher_view_->GetAppListButtonView(); } -void Launcher::SwitchToWindow(int window_index) { +void Launcher::LaunchAppIndexAt(int item_index) { LauncherModel* launcher_model = launcher_view_->model(); const LauncherItems& items = launcher_model->items(); int item_count = launcher_model->item_count(); - int indexes_left = window_index >= 0 ? window_index : item_count; + int indexes_left = item_index >= 0 ? item_index : item_count; int found_index = -1; // Iterating until we have hit the index we are interested in which @@ -165,7 +165,7 @@ void Launcher::SwitchToWindow(int window_index) { // There are two ways how found_index can be valid: a.) the nth item was // found (which is true when indexes_left is -1) or b.) the last item was // requested (which is true when index was passed in as a negative number). - if (found_index >= 0 && (indexes_left == -1 || window_index < 0) && + if (found_index >= 0 && (indexes_left == -1 || item_index < 0) && (delegate_->IsPerAppLauncher() || (items[found_index].status == ash::STATUS_RUNNING || items[found_index].status == ash::STATUS_CLOSED))) { diff --git a/ash/launcher/launcher.h b/ash/launcher/launcher.h index caeb63f..f9bdcc0 100644 --- a/ash/launcher/launcher.h +++ b/ash/launcher/launcher.h @@ -87,9 +87,9 @@ class ASH_EXPORT Launcher { views::View* GetAppListButtonView() const; - // Switches to a 0-indexed (in order of creation) window. - // A negative index switches to the last window in the list. - void SwitchToWindow(int window_index); + // Launch a 0-indexed launcher item in the Launcher. + // A negative index launches the last launcher item in the launcher. + void LaunchAppIndexAt(int item_index); // Only to be called for testing. Retrieves the LauncherView. // TODO(sky): remove this! |