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

Unified Diff: ui/ui_controls/ui_controls_gtk.cc

Issue 9390038: Move automation/ui_controls to ui/ui_controls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win_aura fix, sync Created 8 years, 9 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/ui_controls/ui_controls_aura.cc ('k') | ui/ui_controls/ui_controls_internal_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ui_controls/ui_controls_gtk.cc
diff --git a/chrome/browser/automation/ui_controls_gtk.cc b/ui/ui_controls/ui_controls_gtk.cc
similarity index 76%
rename from chrome/browser/automation/ui_controls_gtk.cc
rename to ui/ui_controls/ui_controls_gtk.cc
index 8826609eaab1b6024c99bf6f499f0e7dde349966..eadb2c019e11a55ba69eeeaeb23668f2a072acc5 100644
--- a/chrome/browser/automation/ui_controls_gtk.cc
+++ b/ui/ui_controls/ui_controls_gtk.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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 "chrome/browser/automation/ui_controls.h"
+#include "ui/ui_controls/ui_controls.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
@@ -10,9 +10,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop.h"
-#include "chrome/browser/automation/ui_controls_internal.h"
-#include "chrome/browser/ui/gtk/gtk_util.h"
-#include "chrome/common/automation_constants.h"
+#include "ui/base/gtk/gtk_screen_util.h"
#include "ui/base/gtk/event_synthesis_gtk.h"
#include "ui/gfx/rect.h"
@@ -254,63 +252,6 @@ bool SendMouseClick(MouseButton type) {
}
#if defined(TOOLKIT_VIEWS)
-
-#if defined(OS_LINUX) && !defined(USE_AURA)
-void OnConfigure(GtkWidget* gtk_widget, GdkEvent* event, gpointer data) {
- views::Widget* widget = static_cast<views::Widget*>(data);
- gfx::Rect actual = widget->GetWindowScreenBounds();
- gfx::Rect desired = widget->GetRootView()->bounds();
- if (actual.size() == desired.size())
- MessageLoop::current()->Quit();
-}
-
-void SynchronizeWidgetSize(views::Widget* widget) {
- // If the actual window size and desired window size
- // are different, wait until the window is resized
- // to desired size.
- gfx::Rect actual = widget->GetWindowScreenBounds();
- gfx::Rect desired = widget->GetRootView()->bounds();
- if (actual.size() != desired.size()) {
- // Listen to configure-event that is emitted when an window gets
- // resized.
- GtkWidget* gtk_widget = widget->GetNativeView();
- g_signal_connect(gtk_widget, "configure-event",
- G_CALLBACK(&OnConfigure), widget);
- MessageLoop::current()->Run();
- }
-}
-#endif
-
-void MoveMouseToCenterAndPress(views::View* view,
- MouseButton button,
- int state,
- const base::Closure& task) {
-#if defined(OS_LINUX)
- // X is asynchronous and we need to wait until the window gets
- // resized to desired size.
- SynchronizeWidgetSize(view->GetWidget());
-#endif
-
- gfx::Point view_center(view->width() / 2, view->height() / 2);
- views::View::ConvertPointToScreen(view, &view_center);
- SendMouseMoveNotifyWhenDone(
- view_center.x(), view_center.y(),
- base::Bind(&ui_controls::internal::ClickTask, button, state, task));
-}
-#else
-void MoveMouseToCenterAndPress(GtkWidget* widget,
- MouseButton button,
- int state,
- const base::Closure& task) {
- gfx::Rect bounds = gtk_util::GetWidgetScreenBounds(widget);
- SendMouseMoveNotifyWhenDone(
- bounds.x() + bounds.width() / 2,
- bounds.y() + bounds.height() / 2,
- base::Bind(&ui_controls::internal::ClickTask, button, state, task));
-}
-#endif
-
-#if defined(TOOLKIT_VIEWS)
void RunClosureAfterAllPendingUIEvents(const base::Closure& task) {
// Send noop event and run task.
int x, y;
« no previous file with comments | « ui/ui_controls/ui_controls_aura.cc ('k') | ui/ui_controls/ui_controls_internal_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698