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

Unified Diff: ui/views/controls/resize_area.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 months 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 | « ui/views/controls/resize_area.h ('k') | ui/views/controls/resize_area_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/resize_area.cc
diff --git a/ui/views/controls/resize_area.cc b/ui/views/controls/resize_area.cc
deleted file mode 100644
index 66759106dfadf47b52714ffcd0381b1e4c2c06f8..0000000000000000000000000000000000000000
--- a/ui/views/controls/resize_area.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2012 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 "ui/views/controls/resize_area.h"
-
-#include "base/logging.h"
-#include "ui/accessibility/ax_view_state.h"
-#include "ui/base/cursor/cursor.h"
-#include "ui/views/controls/resize_area_delegate.h"
-#include "ui/views/native_cursor.h"
-
-namespace views {
-
-const char ResizeArea::kViewClassName[] = "ResizeArea";
-
-////////////////////////////////////////////////////////////////////////////////
-// ResizeArea
-
-ResizeArea::ResizeArea(ResizeAreaDelegate* delegate)
- : delegate_(delegate),
- initial_position_(0) {
-}
-
-ResizeArea::~ResizeArea() {
-}
-
-const char* ResizeArea::GetClassName() const {
- return kViewClassName;
-}
-
-gfx::NativeCursor ResizeArea::GetCursor(const ui::MouseEvent& event) {
- return enabled() ? GetNativeEastWestResizeCursor()
- : gfx::kNullCursor;
-}
-
-bool ResizeArea::OnMousePressed(const ui::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 ui::MouseEvent& event) {
- if (!event.IsLeftMouseButton())
- return false;
-
- ReportResizeAmount(event.x(), false);
- return true;
-}
-
-void ResizeArea::OnMouseReleased(const ui::MouseEvent& event) {
- ReportResizeAmount(event.x(), true);
-}
-
-void ResizeArea::OnMouseCaptureLost() {
- ReportResizeAmount(initial_position_, true);
-}
-
-void ResizeArea::GetAccessibleState(ui::AXViewState* state) {
- state->role = ui::AX_ROLE_SPLITTER;
-}
-
-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 | « ui/views/controls/resize_area.h ('k') | ui/views/controls/resize_area_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698