diff options
-rw-r--r-- | chrome/browser/automation/ui_controls_aura.cc | 62 | ||||
-rw-r--r-- | chrome/browser/automation/ui_controls_gtk.cc (renamed from chrome/browser/automation/ui_controls_linux.cc) | 0 | ||||
-rw-r--r-- | chrome/browser/background/background_mode_manager_aura.cc | 23 | ||||
-rw-r--r-- | chrome/browser/background/background_mode_manager_gtk.cc (renamed from chrome/browser/background/background_mode_manager_linux.cc) | 0 | ||||
-rw-r--r-- | chrome/browser/fullscreen_aura.cc | 12 | ||||
-rw-r--r-- | chrome/browser/fullscreen_gtk.cc (renamed from chrome/browser/fullscreen_linux.cc) | 0 | ||||
-rw-r--r-- | chrome/browser/metrics/display_utils_aura.cc | 23 | ||||
-rw-r--r-- | chrome/browser/metrics/display_utils_gtk.cc (renamed from chrome/browser/metrics/display_utils_posix.cc) | 0 | ||||
-rw-r--r-- | chrome/browser/notifications/balloon_collection_gtk.cc | 87 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_views.cc | 9 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 18 |
11 files changed, 222 insertions, 12 deletions
diff --git a/chrome/browser/automation/ui_controls_aura.cc b/chrome/browser/automation/ui_controls_aura.cc new file mode 100644 index 0000000..c5a7ed7 --- /dev/null +++ b/chrome/browser/automation/ui_controls_aura.cc @@ -0,0 +1,62 @@ +// 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 "chrome/browser/automation/ui_controls.h" + +#include "base/logging.h" +#include "views/view.h" + +namespace ui_controls { + +bool SendKeyPress(gfx::NativeWindow window, + ui::KeyboardCode key, + bool control, + bool shift, + bool alt, + bool command) { + NOTIMPLEMENTED(); + return true; +} + +bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, + ui::KeyboardCode key, + bool control, + bool shift, + bool alt, + bool command, + Task* task) { + NOTIMPLEMENTED(); + return true; +} + +bool SendMouseMove(long x, long y) { + NOTIMPLEMENTED(); + return true; +} + +bool SendMouseMoveNotifyWhenDone(long x, long y, Task* task) { + NOTIMPLEMENTED(); + return true; +} + +bool SendMouseEvents(MouseButton type, int state) { + NOTIMPLEMENTED(); + return true; +} + +bool SendMouseEventsNotifyWhenDone(MouseButton type, int state, Task* task) { + NOTIMPLEMENTED(); + return true; +} + +bool SendMouseClick(MouseButton type) { + return SendMouseEvents(type, UP | DOWN); +} + +void MoveMouseToCenterAndPress(views::View* view, MouseButton button, + int state, Task* task) { + NOTIMPLEMENTED(); +} + +} // namespace ui_controls diff --git a/chrome/browser/automation/ui_controls_linux.cc b/chrome/browser/automation/ui_controls_gtk.cc index 6c7c5f7..6c7c5f7 100644 --- a/chrome/browser/automation/ui_controls_linux.cc +++ b/chrome/browser/automation/ui_controls_gtk.cc diff --git a/chrome/browser/background/background_mode_manager_aura.cc b/chrome/browser/background/background_mode_manager_aura.cc new file mode 100644 index 0000000..223c8ea --- /dev/null +++ b/chrome/browser/background/background_mode_manager_aura.cc @@ -0,0 +1,23 @@ +// 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 "chrome/browser/background/background_mode_manager.h" + +#include "grit/generated_resources.h" +#include "ui/base/l10n/l10n_util.h" + +// No background jobs for aura for now. + +void BackgroundModeManager::EnableLaunchOnStartup(bool should_launch) { + NOTIMPLEMENTED(); +} + +void BackgroundModeManager::DisplayAppInstalledNotification( + const Extension* extension) { + NOTIMPLEMENTED(); +} + +string16 BackgroundModeManager::GetPreferencesMenuLabel() { + return l10n_util::GetStringUTF16(IDS_SETTINGS); +} diff --git a/chrome/browser/background/background_mode_manager_linux.cc b/chrome/browser/background/background_mode_manager_gtk.cc index b4495c5..b4495c5 100644 --- a/chrome/browser/background/background_mode_manager_linux.cc +++ b/chrome/browser/background/background_mode_manager_gtk.cc diff --git a/chrome/browser/fullscreen_aura.cc b/chrome/browser/fullscreen_aura.cc new file mode 100644 index 0000000..6767eab --- /dev/null +++ b/chrome/browser/fullscreen_aura.cc @@ -0,0 +1,12 @@ +// 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 "chrome/browser/fullscreen.h" + +#include "base/logging.h" + +bool IsFullScreenMode() { + NOTIMPLEMENTED(); + return false; +} diff --git a/chrome/browser/fullscreen_linux.cc b/chrome/browser/fullscreen_gtk.cc index da69642..da69642 100644 --- a/chrome/browser/fullscreen_linux.cc +++ b/chrome/browser/fullscreen_gtk.cc diff --git a/chrome/browser/metrics/display_utils_aura.cc b/chrome/browser/metrics/display_utils_aura.cc new file mode 100644 index 0000000..791c973 --- /dev/null +++ b/chrome/browser/metrics/display_utils_aura.cc @@ -0,0 +1,23 @@ +// 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 "chrome/browser/metrics/display_utils.h" + +#include "content/browser/browser_thread.h" +#include "ui/gfx/screen.h" + +// static +void DisplayUtils::GetPrimaryDisplayDimensions(int* width, int* height) { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + gfx::Rect bounds = + gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point()); + *width = bounds.width(); + *height = bounds.height(); +} + +// static +int DisplayUtils::GetDisplayCount() { + NOTIMPLEMENTED(); + return 1; +} diff --git a/chrome/browser/metrics/display_utils_posix.cc b/chrome/browser/metrics/display_utils_gtk.cc index e3f5667..e3f5667 100644 --- a/chrome/browser/metrics/display_utils_posix.cc +++ b/chrome/browser/metrics/display_utils_gtk.cc diff --git a/chrome/browser/notifications/balloon_collection_gtk.cc b/chrome/browser/notifications/balloon_collection_gtk.cc new file mode 100644 index 0000000..0255ae8 --- /dev/null +++ b/chrome/browser/notifications/balloon_collection_gtk.cc @@ -0,0 +1,87 @@ +// 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 "chrome/browser/notifications/balloon_collection_impl.h" + +#include "chrome/browser/notifications/balloon.h" +#include "ui/gfx/size.h" + +#if defined(TOOLKIT_VIEWS) +#include "chrome/browser/ui/views/notifications/balloon_view.h" +#else +#include "chrome/browser/ui/gtk/notifications/balloon_view_gtk.h" +#endif + +Balloon* BalloonCollectionImpl::MakeBalloon(const Notification& notification, + Profile* profile) { + Balloon* balloon = new Balloon(notification, profile, this); + + balloon->set_view(new BalloonViewImpl(this)); + gfx::Size size(layout_.min_balloon_width(), layout_.min_balloon_height()); + balloon->set_content_size(size); + return balloon; +} + +int BalloonCollectionImpl::Layout::InterBalloonMargin() const { + return 5; +} + +int BalloonCollectionImpl::Layout::HorizontalEdgeMargin() const { + return 5; +} + +int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const { + return 5; +} + +void BalloonCollectionImpl::PositionBalloons(bool reposition) { + PositionBalloonsInternal(reposition); +} + +void BalloonCollectionImpl::DidProcessEvent(GdkEvent* event) { + switch (event->type) { + case GDK_MOTION_NOTIFY: + case GDK_LEAVE_NOTIFY: + HandleMouseMoveEvent(); + break; + default: + break; + } +} + +bool BalloonCollectionImpl::IsCursorInBalloonCollection() const { + GdkScreen* screen = gdk_screen_get_default(); + GdkDisplay* display = gdk_screen_get_display(screen); + gint x, y; + gdk_display_get_pointer(display, NULL, &x, &y, NULL); + gfx::Point cursor(x, y); + + return GetBalloonsBoundingBox().Contains(cursor); +} + +void BalloonCollectionImpl::SetPositionPreference( + PositionPreference position) { + if (position == DEFAULT_POSITION) + position = LOWER_RIGHT; + + // All positioning schemes are vertical, and linux + // uses the normal screen orientation. + if (position == UPPER_RIGHT) + layout_.set_placement(Layout::VERTICALLY_FROM_TOP_RIGHT); + else if (position == UPPER_LEFT) + layout_.set_placement(Layout::VERTICALLY_FROM_TOP_LEFT); + else if (position == LOWER_LEFT) + layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_LEFT); + else if (position == LOWER_RIGHT) + layout_.set_placement(Layout::VERTICALLY_FROM_BOTTOM_RIGHT); + else + NOTREACHED(); + + PositionBalloons(true); +} + +// static +BalloonCollection* BalloonCollection::Create() { + return new BalloonCollectionImpl(); +} diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc index 3f63061..ab6d0fc 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc @@ -930,11 +930,12 @@ void RenderWidgetHostViewViews::UpdateCursor(const WebCursor& cursor) { // Optimize the common case, where the cursor hasn't changed. // However, we can switch between different pixmaps, so only on the // non-pixmap branch. +#if defined(TOOLKIT_USES_GTK) if (current_cursor_.GetCursorType() != GDK_CURSOR_IS_PIXMAP && current_cursor_.GetCursorType() == cursor.GetCursorType()) { return; } - +#endif current_cursor_ = cursor; ShowCurrentCursor(); } @@ -950,10 +951,8 @@ void RenderWidgetHostViewViews::ShowCurrentCursor() { native_cursor_ = current_cursor_.GetNativeCursor(); } +#if defined(TOOLKIT_USES_GTK) bool RenderWidgetHostViewViews::IsReadyToPaint() { -#if defined(USE_AURA) - return false; -#else views::Widget* top = NULL; // TODO(oshima): move this functionality to Widget. @@ -968,8 +967,8 @@ bool RenderWidgetHostViewViews::IsReadyToPaint() { return top ? !!(static_cast<const views::NativeWidgetGtk*>(top->native_widget())-> window_contents()->window) : false; -#endif } +#endif #endif // !OS_WIN diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 1b88009..37963f9 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -233,7 +233,8 @@ 'browser/automation/ui_controls.h', 'browser/automation/ui_controls_internal.cc', 'browser/automation/ui_controls_internal.h', - 'browser/automation/ui_controls_linux.cc', + 'browser/automation/ui_controls_aura.cc', + 'browser/automation/ui_controls_gtk.cc', 'browser/automation/ui_controls_mac.mm', 'browser/automation/ui_controls_win.cc', 'browser/automation/url_request_automation_job.cc', @@ -247,7 +248,8 @@ 'browser/background/background_mode_manager.cc', 'browser/background/background_mode_manager.h', 'browser/background/background_mode_manager_chromeos.cc', - 'browser/background/background_mode_manager_linux.cc', + 'browser/background/background_mode_manager_aura.cc', + 'browser/background/background_mode_manager_gtk.cc', 'browser/background/background_mode_manager_mac.mm', 'browser/background/background_mode_manager_win.cc', 'browser/bookmarks/base_bookmark_model_observer.cc', @@ -1220,7 +1222,8 @@ 'browser/first_run/upgrade_util_win.cc', 'browser/first_run/upgrade_util_win.h', 'browser/fullscreen.h', - 'browser/fullscreen_linux.cc', + 'browser/fullscreen_aura.cc', + 'browser/fullscreen_gtk.cc', 'browser/fullscreen_mac.mm', 'browser/fullscreen_win.cc', 'browser/geolocation/chrome_access_token_store.cc', @@ -1461,8 +1464,9 @@ 'browser/memory_details_win.cc', 'browser/memory_purger.cc', 'browser/memory_purger.h', + 'browser/metrics/display_utils_aura.cc', + 'browser/metrics/display_utils_gtk.cc', 'browser/metrics/display_utils_mac.cc', - 'browser/metrics/display_utils_posix.cc', 'browser/metrics/display_utils_win.cc', 'browser/metrics/field_trial_synchronizer.cc', 'browser/metrics/field_trial_synchronizer.h', @@ -3942,7 +3946,7 @@ 'browser/chromeos/input_method/input_method.gyp:mozc_commands_proto', ], 'sources!': [ - 'browser/background_mode_manager_linux.cc', + 'browser/background/background_mode_manager_gtk.cc', 'browser/first_run/upgrade_util.cc', 'browser/first_run/upgrade_util.h', 'browser/first_run/upgrade_util_linux.cc', @@ -4779,9 +4783,9 @@ ['exclude', '^browser/ui/views/select_file_dialog.cc'], ], }], - # Exclude extension_input_ui_api again + # Exclude extension_input_ui_api that depends on chromeos again # (Required because of the '^browser/extensions/' include above) - ['toolkit_uses_gtk == 1 and ( touchui == 0 or chromeos == 0 )', { + ['chromeos == 0', { 'sources/': [ ['exclude', '^browser/extensions/extension_input_ui_api.cc'], ['exclude', '^browser/extensions/extension_input_ui_api.h'], |