diff options
author | csilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-23 01:15:57 +0000 |
---|---|---|
committer | csilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-23 01:15:57 +0000 |
commit | 1e218739ae3350c2932a34a6087d539eac65ed1d (patch) | |
tree | 5fbebafabb1bd4be146bcaa2928ff8b9ccef1d72 /chrome | |
parent | 3b721d82c2d49058a30bd20afb03652b38c59e91 (diff) | |
download | chromium_src-1e218739ae3350c2932a34a6087d539eac65ed1d.zip chromium_src-1e218739ae3350c2932a34a6087d539eac65ed1d.tar.gz chromium_src-1e218739ae3350c2932a34a6087d539eac65ed1d.tar.bz2 |
Revert 93744 - 2nd try. added UI_API to Screen class.
Move screen.h to ui/gfx because Screen doesn't depend on views, and they're useful outside views.
BUG=none
TEST=none
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=93724
Review URL: http://codereview.chromium.org/7483014
TBR=oshima@google.com
Review URL: http://codereview.chromium.org/7488035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93749 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
13 files changed, 27 insertions, 24 deletions
diff --git a/chrome/browser/chromeos/frame/browser_view.cc b/chrome/browser/chromeos/frame/browser_view.cc index ec1f5b9..cee5b18 100644 --- a/chrome/browser/chromeos/frame/browser_view.cc +++ b/chrome/browser/chromeos/frame/browser_view.cc @@ -36,11 +36,11 @@ #include "ui/base/models/simple_menu_model.h" #include "ui/base/theme_provider.h" #include "ui/gfx/canvas.h" -#include "ui/gfx/screen.h" #include "views/controls/button/button.h" #include "views/controls/button/image_button.h" #include "views/controls/menu/menu_delegate.h" #include "views/controls/menu/menu_item_view.h" +#include "views/screen.h" #include "views/widget/root_view.h" #include "views/widget/widget.h" #include "views/window/hit_test.h" @@ -454,7 +454,7 @@ bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const { // non-full screen size, layout/paint at that size, then the window manager // will snap us to full screen size. This results in an ugly // resize/paint. To avoid this we always request a full screen size. - *bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow( + *bounds = views::Screen::GetMonitorWorkAreaNearestWindow( GTK_WIDGET(GetWidget()->GetNativeWindow())); return true; } diff --git a/chrome/browser/chromeos/input_method/candidate_window.cc b/chrome/browser/chromeos/input_method/candidate_window.cc index 46ee983..1a3636a 100644 --- a/chrome/browser/chromeos/input_method/candidate_window.cc +++ b/chrome/browser/chromeos/input_method/candidate_window.cc @@ -17,12 +17,12 @@ #include "chrome/browser/chromeos/input_method/ibus_ui_controller.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" -#include "ui/gfx/screen.h" #include "views/controls/label.h" #include "views/controls/textfield/textfield.h" #include "views/events/event.h" #include "views/layout/fill_layout.h" #include "views/layout/grid_layout.h" +#include "views/screen.h" #include "views/widget/widget.h" #include "views/window/non_client_view.h" @@ -1163,7 +1163,7 @@ void CandidateWindowView::ResizeAndMoveParentFrame() { const int horizontal_offset = GetHorizontalOffset(); gfx::Rect old_bounds = parent_frame_->GetClientAreaScreenBounds(); - gfx::Rect screen_bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow( + gfx::Rect screen_bounds = views::Screen::GetMonitorWorkAreaNearestWindow( parent_frame_->GetNativeView()); // The size. gfx::Rect frame_bounds = old_bounds; diff --git a/chrome/browser/chromeos/login/background_view.cc b/chrome/browser/chromeos/login/background_view.cc index ca7975b..a8f7244 100644 --- a/chrome/browser/chromeos/login/background_view.cc +++ b/chrome/browser/chromeos/login/background_view.cc @@ -40,6 +40,7 @@ #include "ui/gfx/gtk_util.h" #include "views/controls/button/text_button.h" #include "views/controls/label.h" +#include "views/screen.h" #include "views/widget/widget.h" using views::Widget; diff --git a/chrome/browser/chromeos/login/helper.cc b/chrome/browser/chromeos/login/helper.cc index f561899..afc563a 100644 --- a/chrome/browser/chromeos/login/helper.cc +++ b/chrome/browser/chromeos/login/helper.cc @@ -14,12 +14,12 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas_skia.h" -#include "ui/gfx/screen.h" #include "views/controls/button/menu_button.h" #include "views/controls/label.h" #include "views/controls/textfield/textfield.h" #include "views/controls/throbber.h" #include "views/painter.h" +#include "views/screen.h" #include "views/widget/widget.h" namespace chromeos { @@ -155,7 +155,7 @@ views::Painter* CreateBackgroundPainter() { } gfx::Rect CalculateScreenBounds(const gfx::Size& size) { - gfx::Rect bounds(gfx::Screen::GetMonitorWorkAreaNearestWindow(NULL)); + gfx::Rect bounds(views::Screen::GetMonitorWorkAreaNearestWindow(NULL)); if (!size.IsEmpty()) { int horizontal_diff = bounds.width() - size.width(); int vertical_diff = bounds.height() - size.height(); diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index 121b100..f79310a 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -53,7 +53,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/x/x11_util.h" -#include "ui/gfx/screen.h" +#include "views/screen.h" #include "views/widget/native_widget_gtk.h" namespace { @@ -730,7 +730,7 @@ void ScreenLocker::Init() { authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); gfx::Point left_top(1, 1); - gfx::Rect init_bounds(gfx::Screen::GetMonitorAreaNearestPoint(left_top)); + gfx::Rect init_bounds(views::Screen::GetMonitorAreaNearestPoint(left_top)); LockWindow* lock_window = new LockWindow(); lock_window_ = lock_window->GetWidget(); diff --git a/chrome/browser/chromeos/setting_level_bubble.cc b/chrome/browser/chromeos/setting_level_bubble.cc index 8af98bf..9d7cc9b 100644 --- a/chrome/browser/chromeos/setting_level_bubble.cc +++ b/chrome/browser/chromeos/setting_level_bubble.cc @@ -15,7 +15,7 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/views/bubble/bubble.h" -#include "ui/gfx/screen.h" +#include "views/screen.h" #include "views/widget/root_view.h" namespace { @@ -112,7 +112,7 @@ void SettingLevelBubble::ShowBubble(int percent) { // "point" at (since we use BubbleBorder::FLOAT, this position actually // specifies the center of the bubble). const gfx::Rect monitor_area = - gfx::Screen::GetMonitorAreaNearestWindow( + views::Screen::GetMonitorAreaNearestWindow( GTK_WIDGET(parent_widget->GetNativeWindow())); const gfx::Size view_size = view_->GetPreferredSize(); const gfx::Rect position_relative_to( diff --git a/chrome/browser/ui/panels/panel_browser_frame_view.cc b/chrome/browser/ui/panels/panel_browser_frame_view.cc index 0041557..cf904ed 100644 --- a/chrome/browser/ui/panels/panel_browser_frame_view.cc +++ b/chrome/browser/ui/panels/panel_browser_frame_view.cc @@ -22,11 +22,11 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas_skia.h" -#include "ui/gfx/screen.h" #include "views/controls/button/image_button.h" #include "views/controls/button/menu_button.h" #include "views/controls/label.h" #include "views/painter.h" +#include "views/screen.h" #include "views/widget/widget_delegate.h" #include "views/window/window_shape.h" @@ -159,7 +159,7 @@ PanelBrowserFrameView::MouseWatcher::~MouseWatcher() { } bool PanelBrowserFrameView::MouseWatcher::IsCursorInViewBounds() const { - gfx::Point cursor_point = gfx::Screen::GetCursorScreenPoint(); + gfx::Point cursor_point = views::Screen::GetCursorScreenPoint(); return view_->browser_view_->GetBounds().Contains(cursor_point.x(), cursor_point.y()); } diff --git a/chrome/browser/ui/views/fullscreen_exit_bubble.cc b/chrome/browser/ui/views/fullscreen_exit_bubble.cc index 43bbe78..3009674 100644 --- a/chrome/browser/ui/views/fullscreen_exit_bubble.cc +++ b/chrome/browser/ui/views/fullscreen_exit_bubble.cc @@ -13,8 +13,8 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas_skia.h" -#include "ui/gfx/screen.h" #include "views/controls/link.h" +#include "views/screen.h" #include "views/widget/widget.h" #if defined(OS_WIN) @@ -144,7 +144,7 @@ FullscreenExitBubble::FullscreenExitBubble( // Start the initial delay timer and begin watching the mouse. initial_delay_.Start(base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, &FullscreenExitBubble::CheckMousePosition); - gfx::Point cursor_pos = gfx::Screen::GetCursorScreenPoint(); + gfx::Point cursor_pos = views::Screen::GetCursorScreenPoint(); last_mouse_pos_ = cursor_pos; views::View::ConvertPointToView(NULL, root_view_, &last_mouse_pos_); mouse_position_checker_.Start( @@ -206,7 +206,7 @@ void FullscreenExitBubble::CheckMousePosition() { // either the popup is hidden or the mouse is not idle, so we don't want to // change anything's state. - gfx::Point cursor_pos = gfx::Screen::GetCursorScreenPoint(); + gfx::Point cursor_pos = views::Screen::GetCursorScreenPoint(); gfx::Point transformed_pos(cursor_pos); views::View::ConvertPointToView(NULL, root_view_, &transformed_pos); @@ -252,7 +252,7 @@ gfx::Rect FullscreenExitBubble::GetPopupRect( } // NOTE: don't use the bounds of the root_view_. On linux changing window // size is async. Instead we use the size of the screen. - gfx::Rect screen_bounds = gfx::Screen::GetMonitorAreaNearestWindow( + gfx::Rect screen_bounds = views::Screen::GetMonitorAreaNearestWindow( root_view_->GetWidget()->GetNativeView()); gfx::Point origin(screen_bounds.x() + (screen_bounds.width() - size.width()) / 2, diff --git a/chrome/browser/ui/views/keyboard_overlay_delegate.cc b/chrome/browser/ui/views/keyboard_overlay_delegate.cc index 0fbc554..c1448a94 100644 --- a/chrome/browser/ui/views/keyboard_overlay_delegate.cc +++ b/chrome/browser/ui/views/keyboard_overlay_delegate.cc @@ -13,7 +13,7 @@ #include "chrome/common/url_constants.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/gfx/screen.h" +#include "views/screen.h" static const int kBaseWidth = 1252; @@ -50,7 +50,7 @@ void KeyboardOverlayDelegate::GetDialogSize( gfx::Size* size) const { using std::min; DCHECK(view_); - gfx::Rect rect = gfx::Screen::GetMonitorAreaNearestWindow( + gfx::Rect rect = views::Screen::GetMonitorAreaNearestWindow( view_->native_view()); const int width = min(kBaseWidth, rect.width() - kHorizontalMargin); const int height = width * kBaseHeight / kBaseWidth; diff --git a/chrome/browser/ui/views/status_bubble_views.cc b/chrome/browser/ui/views/status_bubble_views.cc index d57e1d5..a99449e 100644 --- a/chrome/browser/ui/views/status_bubble_views.cc +++ b/chrome/browser/ui/views/status_bubble_views.cc @@ -24,9 +24,9 @@ #include "ui/base/text/text_elider.h" #include "ui/gfx/canvas_skia.h" #include "ui/gfx/point.h" -#include "ui/gfx/screen.h" #include "views/controls/label.h" #include "views/controls/scrollbar/native_scroll_bar.h" +#include "views/screen.h" #include "views/widget/root_view.h" #include "views/widget/widget.h" @@ -755,7 +755,7 @@ void StatusBubbleViews::AvoidMouse(const gfx::Point& location) { // download shelf. gfx::NativeView widget = base_view_->GetWidget()->GetNativeView(); gfx::Rect monitor_rect = - gfx::Screen::GetMonitorWorkAreaNearestWindow(widget); + views::Screen::GetMonitorWorkAreaNearestWindow(widget); const int bubble_bottom_y = top_left.y() + position_.y() + size_.height(); if (bubble_bottom_y + offset > monitor_rect.height() || diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.cc index 73ead11..0cb5bb0 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.cc @@ -22,6 +22,7 @@ #include "views/focus/focus_manager.h" #include "views/focus/view_storage.h" #include "views/layout/fill_layout.h" +#include "views/screen.h" #include "views/widget/widget.h" using WebKit::WebDragOperation; diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc index b607ed1..ab70af9 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc @@ -17,9 +17,9 @@ #include "content/browser/tab_contents/interstitial_page.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" -#include "ui/gfx/screen.h" #include "views/focus/focus_manager.h" #include "views/focus/view_storage.h" +#include "views/screen.h" #include "views/widget/native_widget.h" #include "views/widget/widget.h" @@ -386,7 +386,7 @@ void TabContentsViewViews::OnNativeTabContentsViewMouseMove(bool motion) { // bubble state). if (tab_contents_->delegate()) { tab_contents_->delegate()->ContentsMouseEvent( - tab_contents_, gfx::Screen::GetCursorScreenPoint(), motion); + tab_contents_, views::Screen::GetCursorScreenPoint(), motion); } } @@ -421,3 +421,4 @@ views::FocusManager* TabContentsViewViews::GetFocusManager() { // DCHECK(focus_manager_); return focus_manager_; } + diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc index 35e5ad3..d68988f 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc @@ -34,8 +34,8 @@ #include "ui/base/animation/slide_animation.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas_skia.h" -#include "ui/gfx/screen.h" #include "views/events/event.h" +#include "views/screen.h" #include "views/widget/widget.h" #if defined(TOOLKIT_USES_GTK) @@ -551,7 +551,7 @@ gfx::Point DraggedTabController::GetWindowCreatePoint() const { } // If the cursor is outside the monitor area, move it inside. For example, // dropping a tab onto the task bar on Windows produces this situation. - gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestPoint( + gfx::Rect work_area = views::Screen::GetMonitorWorkAreaNearestPoint( cursor_point); if (!work_area.IsEmpty()) { if (cursor_point.x() < work_area.x()) |