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

Unified Diff: ui/views/test/widget_test.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/test/widget_test.h ('k') | ui/views/test/widget_test_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/widget_test.cc
diff --git a/ui/views/test/widget_test.cc b/ui/views/test/widget_test.cc
deleted file mode 100644
index 4f2705d3bd951557069293bca029c30769f57803..0000000000000000000000000000000000000000
--- a/ui/views/test/widget_test.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2013 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/test/widget_test.h"
-
-#include "ui/gfx/native_widget_types.h"
-#include "ui/views/widget/root_view.h"
-
-namespace views {
-namespace test {
-
-// A widget that assumes mouse capture always works. It won't in testing, so we
-// mock it.
-NativeWidgetCapture::NativeWidgetCapture(
- internal::NativeWidgetDelegate* delegate)
- : PlatformNativeWidget(delegate),
- mouse_capture_(false) {}
-
-NativeWidgetCapture::~NativeWidgetCapture() {}
-
-void NativeWidgetCapture::SetCapture() {
- mouse_capture_ = true;
-}
-
-void NativeWidgetCapture::ReleaseCapture() {
- if (mouse_capture_)
- delegate()->OnMouseCaptureLost();
- mouse_capture_ = false;
-}
-
-bool NativeWidgetCapture::HasCapture() const {
- return mouse_capture_;
-}
-
-WidgetTest::WidgetTest() {}
-WidgetTest::~WidgetTest() {}
-
-NativeWidget* WidgetTest::CreatePlatformNativeWidget(
- internal::NativeWidgetDelegate* delegate) {
- return new NativeWidgetCapture(delegate);
-}
-
-Widget* WidgetTest::CreateTopLevelPlatformWidget() {
- Widget* toplevel = new Widget;
- Widget::InitParams toplevel_params =
- CreateParams(Widget::InitParams::TYPE_WINDOW);
- toplevel_params.native_widget = CreatePlatformNativeWidget(toplevel);
- toplevel->Init(toplevel_params);
- return toplevel;
-}
-
-Widget* WidgetTest::CreateTopLevelFramelessPlatformWidget() {
- Widget* toplevel = new Widget;
- Widget::InitParams toplevel_params =
- CreateParams(Widget::InitParams::TYPE_WINDOW_FRAMELESS);
- toplevel_params.native_widget = CreatePlatformNativeWidget(toplevel);
- toplevel->Init(toplevel_params);
- return toplevel;
-}
-
-Widget* WidgetTest::CreateChildPlatformWidget(
- gfx::NativeView parent_native_view) {
- Widget* child = new Widget;
- Widget::InitParams child_params =
- CreateParams(Widget::InitParams::TYPE_CONTROL);
- child_params.native_widget = CreatePlatformNativeWidget(child);
- child_params.parent = parent_native_view;
- child->Init(child_params);
- child->SetContentsView(new View);
- return child;
-}
-
-Widget* WidgetTest::CreateTopLevelNativeWidget() {
- Widget* toplevel = new Widget;
- Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW);
- toplevel->Init(params);
- return toplevel;
-}
-
-Widget* WidgetTest::CreateChildNativeWidgetWithParent(Widget* parent) {
- Widget* child = new Widget;
- Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_CONTROL);
- params.parent = parent->GetNativeView();
- child->Init(params);
- child->SetContentsView(new View);
- return child;
-}
-
-Widget* WidgetTest::CreateChildNativeWidget() {
- return CreateChildNativeWidgetWithParent(NULL);
-}
-
-View* WidgetTest::GetMousePressedHandler(internal::RootView* root_view) {
- return root_view->mouse_pressed_handler_;
-}
-
-View* WidgetTest::GetMouseMoveHandler(internal::RootView* root_view) {
- return root_view->mouse_move_handler_;
-}
-
-View* WidgetTest::GetGestureHandler(internal::RootView* root_view) {
- return root_view->gesture_handler_;
-}
-
-} // namespace test
-} // namespace views
« no previous file with comments | « ui/views/test/widget_test.h ('k') | ui/views/test/widget_test_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698