summaryrefslogtreecommitdiffstats
path: root/views/controls/table
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-13 17:36:09 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-13 17:36:09 +0000
commitb6d81261a469240e25b41e7125bb7166ca3d35bb (patch)
tree9ddaf52100915560ce5c3d0167e79ef4a26aec56 /views/controls/table
parent917a44b0724089630cb1d962a9383df7a1deaf7e (diff)
downloadchromium_src-b6d81261a469240e25b41e7125bb7166ca3d35bb.zip
chromium_src-b6d81261a469240e25b41e7125bb7166ca3d35bb.tar.gz
chromium_src-b6d81261a469240e25b41e7125bb7166ca3d35bb.tar.bz2
Move app/key* to ui/base/keycodes/*
BUG=none TEST=none TBR=brettw Review URL: http://codereview.chromium.org/6246001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/table')
-rw-r--r--views/controls/table/group_table_view.cc10
-rw-r--r--views/controls/table/group_table_view.h2
-rw-r--r--views/controls/table/native_table_win.cc2
-rw-r--r--views/controls/table/native_table_win.h2
-rw-r--r--views/controls/table/table_view.cc2
-rw-r--r--views/controls/table/table_view.h5
-rw-r--r--views/controls/table/table_view_observer.h4
7 files changed, 14 insertions, 13 deletions
diff --git a/views/controls/table/group_table_view.cc b/views/controls/table/group_table_view.cc
index 4d34c56..cf35d73 100644
--- a/views/controls/table/group_table_view.cc
+++ b/views/controls/table/group_table_view.cc
@@ -63,7 +63,7 @@ void GroupTableView::SyncSelection() {
}
}
-bool GroupTableView::OnKeyDown(app::KeyboardCode virtual_keycode) {
+bool GroupTableView::OnKeyDown(ui::KeyboardCode virtual_keycode) {
// In a list view, multiple items can be selected but only one item has the
// focus. This creates a problem when the arrow keys are used for navigating
// between items in the list view. An example will make this more clear:
@@ -89,8 +89,8 @@ bool GroupTableView::OnKeyDown(app::KeyboardCode virtual_keycode) {
// detect that one of the arrow keys is pressed. Thus, when it comes time
// for the list view control to actually switch the focus, the right item
// will be selected.
- if ((virtual_keycode != app::VKEY_UP) &&
- (virtual_keycode != app::VKEY_DOWN)) {
+ if ((virtual_keycode != ui::VKEY_UP) &&
+ (virtual_keycode != ui::VKEY_DOWN)) {
return TableView::OnKeyDown(virtual_keycode);
}
@@ -118,10 +118,10 @@ bool GroupTableView::OnKeyDown(app::KeyboardCode virtual_keycode) {
// If the user pressed the UP key, then the focus should be set to the
// topmost element in the group. If the user pressed the DOWN key, the focus
// should be set to the bottommost element.
- if (virtual_keycode == app::VKEY_UP) {
+ if (virtual_keycode == ui::VKEY_UP) {
SetFocusOnItem(group_range.start);
} else {
- DCHECK_EQ(virtual_keycode, app::VKEY_DOWN);
+ DCHECK_EQ(virtual_keycode, ui::VKEY_DOWN);
SetFocusOnItem(group_range.start + group_range.length - 1);
}
diff --git a/views/controls/table/group_table_view.h b/views/controls/table/group_table_view.h
index adf0bac..8ce6270 100644
--- a/views/controls/table/group_table_view.h
+++ b/views/controls/table/group_table_view.h
@@ -57,7 +57,7 @@ class GroupTableView : public TableView {
// keys), we must take action when an arrow key is pressed. The reason we
// need to process this message has to do with the manner in which the focus
// needs to be set on a group item when a group is selected.
- virtual bool OnKeyDown(app::KeyboardCode virtual_keycode);
+ virtual bool OnKeyDown(ui::KeyboardCode virtual_keycode);
// Overriden to make sure rows in the same group stay grouped together.
virtual int CompareRows(int model_row1, int model_row2);
diff --git a/views/controls/table/native_table_win.cc b/views/controls/table/native_table_win.cc
index 35769c6..d660dbb 100644
--- a/views/controls/table/native_table_win.cc
+++ b/views/controls/table/native_table_win.cc
@@ -463,7 +463,7 @@ void NativeTableWin::OnMiddleClick() {
table_->observer()->OnMiddleClick();
}
-bool NativeTableWin::OnKeyDown(app::KeyboardCode virtual_keycode) {
+bool NativeTableWin::OnKeyDown(ui::KeyboardCode virtual_keycode) {
if (!ignore_listview_change_ && table_->observer())
table_->observer()->OnKeyDown(virtual_keycode);
return false; // Let the key event be processed as ususal.
diff --git a/views/controls/table/native_table_win.h b/views/controls/table/native_table_win.h
index dcbc087..548f070 100644
--- a/views/controls/table/native_table_win.h
+++ b/views/controls/table/native_table_win.h
@@ -74,7 +74,7 @@ class NativeTableWin : public NativeControlWin, public NativeTableWrapper {
virtual void OnMiddleClick();
// Overridden from NativeControl. Notifies the observer.
- virtual bool OnKeyDown(app::KeyboardCode virtual_keycode);
+ virtual bool OnKeyDown(ui::KeyboardCode virtual_keycode);
// Custom drawing of our icons.
LRESULT OnCustomDraw(NMLVCUSTOMDRAW* draw_info);
diff --git a/views/controls/table/table_view.cc b/views/controls/table/table_view.cc
index d35b074..45b0bf1 100644
--- a/views/controls/table/table_view.cc
+++ b/views/controls/table/table_view.cc
@@ -1503,7 +1503,7 @@ void TableView::OnSelectedStateChanged() {
}
}
-bool TableView::OnKeyDown(app::KeyboardCode virtual_keycode) {
+bool TableView::OnKeyDown(ui::KeyboardCode virtual_keycode) {
if (!ignore_listview_change_ && table_view_observer_) {
table_view_observer_->OnKeyDown(virtual_keycode);
}
diff --git a/views/controls/table/table_view.h b/views/controls/table/table_view.h
index 83ac85a..cae1a64b 100644
--- a/views/controls/table/table_view.h
+++ b/views/controls/table/table_view.h
@@ -16,10 +16,11 @@ typedef struct tagNMLVCUSTOMDRAW NMLVCUSTOMDRAW;
#include <map>
#include <vector>
-#include "app/keyboard_codes.h"
#include "app/table_model_observer.h"
#include "base/gtest_prod_util.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/base/keycodes/keyboard_codes.h"
+
#if defined(OS_WIN)
// TODO(port): remove the ifdef when native_control.h is ported.
#include "views/controls/native_control.h"
@@ -258,7 +259,7 @@ class TableView : public NativeControl,
virtual void OnMiddleClick();
// Overridden from NativeControl. Notifies the observer.
- virtual bool OnKeyDown(app::KeyboardCode virtual_keycode);
+ virtual bool OnKeyDown(ui::KeyboardCode virtual_keycode);
// Invoked to customize the colors or font at a particular cell. If you
// change the colors or font, return true. This is only invoked if
diff --git a/views/controls/table/table_view_observer.h b/views/controls/table/table_view_observer.h
index 86fff7a..3444118 100644
--- a/views/controls/table/table_view_observer.h
+++ b/views/controls/table/table_view_observer.h
@@ -6,7 +6,7 @@
#define VIEWS_CONTROLS_TABLE_TABLE_VIEW_OBSERVER_H_
#pragma once
-#include "app/keyboard_codes.h"
+#include "ui/base/keycodes/keyboard_codes.h"
namespace views {
@@ -28,7 +28,7 @@ class TableViewObserver {
virtual void OnMiddleClick() {}
// Optional method invoked when the user hits a key with the table in focus.
- virtual void OnKeyDown(app::KeyboardCode virtual_keycode) {}
+ virtual void OnKeyDown(ui::KeyboardCode virtual_keycode) {}
// Invoked when the user presses the delete key.
virtual void OnTableViewDelete(TableView* table_view) {}