diff options
Diffstat (limited to 'chrome/views')
-rw-r--r-- | chrome/views/chrome_menu.cc | 9 | ||||
-rw-r--r-- | chrome/views/chrome_menu.h | 5 | ||||
-rw-r--r-- | chrome/views/view_constants.cc | 13 | ||||
-rw-r--r-- | chrome/views/view_constants.h | 25 | ||||
-rw-r--r-- | chrome/views/views.vcproj | 8 |
5 files changed, 49 insertions, 11 deletions
diff --git a/chrome/views/chrome_menu.cc b/chrome/views/chrome_menu.cc index b2870ee..77c33e9 100644 --- a/chrome/views/chrome_menu.cc +++ b/chrome/views/chrome_menu.cc @@ -23,6 +23,7 @@ #include "chrome/views/border.h" #include "chrome/views/container_win.h" #include "chrome/views/root_view.h" +#include "chrome/views/view_constants.h" #include "generated_resources.h" #undef min @@ -1035,9 +1036,6 @@ gfx::Rect SubmenuView::CalculateDropIndicatorBounds( // static const int MenuItemView::kMenuItemViewID = 1001; -// static -const int MenuItemView::kDropBetweenPixels = 5; - // static bool MenuItemView::allow_task_nesting_during_run_ = false; @@ -1891,9 +1889,8 @@ int MenuController::OnDragUpdated(SubmenuView* source, if (!over_empty_menu) { int menu_item_height = menu_item->height(); if (menu_item->HasSubmenu() && - (menu_item_loc.y() > MenuItemView::kDropBetweenPixels && - menu_item_loc.y() < (menu_item_height - - MenuItemView::kDropBetweenPixels))) { + (menu_item_loc.y() > kDropBetweenPixels && + menu_item_loc.y() < (menu_item_height - kDropBetweenPixels))) { drop_position = MenuDelegate::DROP_ON; } else if (menu_item_loc.y() < menu_item_height / 2) { drop_position = MenuDelegate::DROP_BEFORE; diff --git a/chrome/views/chrome_menu.h b/chrome/views/chrome_menu.h index 9051999..e1ed347 100644 --- a/chrome/views/chrome_menu.h +++ b/chrome/views/chrome_menu.h @@ -207,11 +207,6 @@ class MenuItemView : public View { // ID used to identify menu items. static const int kMenuItemViewID; - // Used to determine whether a drop is on an item or before/after it. If - // a drop occurs kDropBetweenPixels from the top/bottom it is considered - // before/after the menu item, otherwise it is on the item. - static const int kDropBetweenPixels; - // If true SetNestableTasksAllowed(true) is invoked before MessageLoop::Run // is invoked. This is only useful for testing and defaults to false. static bool allow_task_nesting_during_run_; diff --git a/chrome/views/view_constants.cc b/chrome/views/view_constants.cc new file mode 100644 index 0000000..84b7452 --- /dev/null +++ b/chrome/views/view_constants.cc @@ -0,0 +1,13 @@ +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/views/view_constants.h" + +namespace views { + +const int kAutoscrollSize = 10; +const int kAutoscrollRowTimerMS = 200; +const int kDropBetweenPixels = 5; + +} // namespace views diff --git a/chrome/views/view_constants.h b/chrome/views/view_constants.h new file mode 100644 index 0000000..a8e9fd2 --- /dev/null +++ b/chrome/views/view_constants.h @@ -0,0 +1,25 @@ +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_VIEWS_VIEW_CONSTANTS_H_ +#define CHROME_VIEWS_VIEW_CONSTANTS_H_ + +namespace views { + +// Size (width or height) within which the user can hold the mouse and the +// view should scroll. +extern const int kAutoscrollSize; + +// Time in milliseconds to autoscroll by a row. This is used during drag and +// drop. +extern const int kAutoscrollRowTimerMS; + +// Used to determine whether a drop is on an item or before/after it. If a drop +// occurs kDropBetweenPixels from the top/bottom it is considered before/after +// the item, otherwise it is on the item. +extern const int kDropBetweenPixels; + +} // namespace views + +#endif // CHROME_VIEWS_VIEW_CONSTANTS_H_ diff --git a/chrome/views/views.vcproj b/chrome/views/views.vcproj index 247dbab..91dce86 100644 --- a/chrome/views/views.vcproj +++ b/chrome/views/views.vcproj @@ -610,6 +610,14 @@ > </File> <File + RelativePath=".\view_constants.cc" + > + </File> + <File + RelativePath=".\view_constants.h" + > + </File> + <File RelativePath=".\view_menu_delegate.h" > </File> |