Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: views/controls/resize_area.cc

Issue 8687031: views: Move the remaining files to ui/views/controls/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/controls/resize_area.h ('k') | views/controls/resize_area_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/resize_area.cc
diff --git a/views/controls/resize_area.cc b/views/controls/resize_area.cc
deleted file mode 100644
index 88ac5b57002c49057a1c8e19a78072ed8215749b..0000000000000000000000000000000000000000
--- a/views/controls/resize_area.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) 2011 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 "views/controls/resize_area.h"
-
-#include "base/logging.h"
-#include "ui/base/accessibility/accessible_view_state.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "views/controls/resize_area_delegate.h"
-
-#if defined(OS_LINUX)
-#include "ui/gfx/gtk_util.h"
-#endif
-
-#if defined(USE_AURA)
-#include "ui/aura/cursor.h"
-#endif
-
-namespace views {
-
-const char ResizeArea::kViewClassName[] = "views/ResizeArea";
-
-////////////////////////////////////////////////////////////////////////////////
-// ResizeArea
-
-ResizeArea::ResizeArea(ResizeAreaDelegate* delegate)
- : delegate_(delegate),
- initial_position_(0) {
-}
-
-ResizeArea::~ResizeArea() {
-}
-
-std::string ResizeArea::GetClassName() const {
- return kViewClassName;
-}
-
-gfx::NativeCursor ResizeArea::GetCursor(const MouseEvent& event) {
- if (!IsEnabled())
- return gfx::kNullCursor;
-#if defined(USE_AURA)
- return aura::kCursorEastWestResize;
-#elif defined(OS_WIN)
- static HCURSOR g_resize_cursor = LoadCursor(NULL, IDC_SIZEWE);
- return g_resize_cursor;
-#elif defined(OS_LINUX)
- return gfx::GetCursor(GDK_SB_H_DOUBLE_ARROW);
-#endif
-}
-
-bool ResizeArea::OnMousePressed(const views::MouseEvent& event) {
- if (!event.IsOnlyLeftMouseButton())
- return false;
-
- // The resize area obviously will move once you start dragging so we need to
- // convert coordinates to screen coordinates so that we don't lose our
- // bearings.
- gfx::Point point(event.x(), 0);
- View::ConvertPointToScreen(this, &point);
- initial_position_ = point.x();
-
- return true;
-}
-
-bool ResizeArea::OnMouseDragged(const views::MouseEvent& event) {
- if (!event.IsLeftMouseButton())
- return false;
-
- ReportResizeAmount(event.x(), false);
- return true;
-}
-
-void ResizeArea::OnMouseReleased(const views::MouseEvent& event) {
- ReportResizeAmount(event.x(), true);
-}
-
-void ResizeArea::OnMouseCaptureLost() {
- ReportResizeAmount(initial_position_, true);
-}
-
-void ResizeArea::GetAccessibleState(ui::AccessibleViewState* state) {
- state->role = ui::AccessibilityTypes::ROLE_SEPARATOR;
-}
-
-void ResizeArea::ReportResizeAmount(int resize_amount, bool last_update) {
- gfx::Point point(resize_amount, 0);
- View::ConvertPointToScreen(this, &point);
- resize_amount = point.x() - initial_position_;
- delegate_->OnResize(base::i18n::IsRTL() ? -resize_amount : resize_amount,
- last_update);
-}
-
-} // namespace views
« no previous file with comments | « views/controls/resize_area.h ('k') | views/controls/resize_area_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698