diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 19:51:17 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 19:51:17 +0000 |
commit | ffabb1ea75e662308da91e916a0ffc922525aa18 (patch) | |
tree | 788b1ac84169a936b02d10feda6c94efaee129ea /ash/keyboard_overlay | |
parent | c856e976800426511cd1a0f74d38c1fa7c883018 (diff) | |
download | chromium_src-ffabb1ea75e662308da91e916a0ffc922525aa18.zip chromium_src-ffabb1ea75e662308da91e916a0ffc922525aa18.tar.gz chromium_src-ffabb1ea75e662308da91e916a0ffc922525aa18.tar.bz2 |
Makes gfx::Screen an instance, rather than a collection of static methods.
This is in support of supporting separate Screen implementations on Aura for desktop and metro on Windows.
Some callsites are not yet correct, and noted with a reference to the http://crbug.com/133312. As-is those sites will behave the same as before this patch, but may not be correct once desktop/metro can run simultaneously.
BUG=133312
Review URL: https://chromiumcodereview.appspot.com/11030017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161644 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/keyboard_overlay')
-rw-r--r-- | ash/keyboard_overlay/keyboard_overlay_delegate.cc | 9 | ||||
-rw-r--r-- | ash/keyboard_overlay/keyboard_overlay_delegate.h | 4 | ||||
-rw-r--r-- | ash/keyboard_overlay/keyboard_overlay_view.cc | 8 | ||||
-rw-r--r-- | ash/keyboard_overlay/keyboard_overlay_view.h | 4 |
4 files changed, 21 insertions, 4 deletions
diff --git a/ash/keyboard_overlay/keyboard_overlay_delegate.cc b/ash/keyboard_overlay/keyboard_overlay_delegate.cc index e819a98..97ef04a 100644 --- a/ash/keyboard_overlay/keyboard_overlay_delegate.cc +++ b/ash/keyboard_overlay/keyboard_overlay_delegate.cc @@ -6,6 +6,7 @@ #include <algorithm> +#include "ash/shell.h" #include "base/bind.h" #include "base/memory/weak_ptr.h" #include "base/utf_string_conversions.h" @@ -58,6 +59,8 @@ void PaintMessageHandler::DidPaint(const ListValue* args) { } // namespace +namespace ash { + KeyboardOverlayDelegate::KeyboardOverlayDelegate(const string16& title, const GURL& url) : title_(title), @@ -80,7 +83,7 @@ void KeyboardOverlayDelegate::Show(views::WebDialogView* view) { // Show the widget at the bottom of the work area. gfx::Size size; GetDialogSize(&size); - const gfx::Rect& rect = gfx::Screen::GetDisplayNearestWindow( + const gfx::Rect& rect = Shell::GetScreen()->GetDisplayNearestWindow( widget->GetNativeView()).work_area(); gfx::Rect bounds((rect.width() - size.width()) / 2, rect.height() - size.height(), @@ -112,7 +115,7 @@ void KeyboardOverlayDelegate::GetDialogSize( gfx::Size* size) const { using std::min; DCHECK(view_); - gfx::Rect rect = gfx::Screen::GetDisplayNearestWindow( + gfx::Rect rect = ash::Shell::GetScreen()->GetDisplayNearestWindow( view_->GetWidget()->GetNativeView()).bounds(); const int width = min(kBaseWidth, rect.width() - kHorizontalMargin); const int height = width * kBaseHeight / kBaseWidth; @@ -141,3 +144,5 @@ bool KeyboardOverlayDelegate::HandleContextMenu( const content::ContextMenuParams& params) { return true; } + +} // namespace ash diff --git a/ash/keyboard_overlay/keyboard_overlay_delegate.h b/ash/keyboard_overlay/keyboard_overlay_delegate.h index 7a63ee5..48101e0 100644 --- a/ash/keyboard_overlay/keyboard_overlay_delegate.h +++ b/ash/keyboard_overlay/keyboard_overlay_delegate.h @@ -14,6 +14,8 @@ namespace views { class WebDialogView; } +namespace ash { + class KeyboardOverlayDelegate : public ui::WebDialogDelegate { public: KeyboardOverlayDelegate(const string16& title, const GURL& url); @@ -53,4 +55,6 @@ class KeyboardOverlayDelegate : public ui::WebDialogDelegate { DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayDelegate); }; +} // namespace ash + #endif // ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_DELEGATE_H_ diff --git a/ash/keyboard_overlay/keyboard_overlay_view.cc b/ash/keyboard_overlay/keyboard_overlay_view.cc index 37d8353..a52ace1 100644 --- a/ash/keyboard_overlay/keyboard_overlay_view.cc +++ b/ash/keyboard_overlay/keyboard_overlay_view.cc @@ -31,6 +31,8 @@ const struct KeyEventData { } +namespace ash { + KeyboardOverlayView::KeyboardOverlayView( content::BrowserContext* context, WebDialogDelegate* delegate, @@ -42,7 +44,7 @@ KeyboardOverlayView::~KeyboardOverlayView() { } void KeyboardOverlayView::Cancel() { - ash::Shell::GetInstance()->overlay_filter()->Deactivate(); + Shell::GetInstance()->overlay_filter()->Deactivate(); views::Widget* widget = GetWidget(); if (widget) widget->Close(); @@ -75,9 +77,11 @@ void KeyboardOverlayView::ShowDialog( new KeyboardOverlayView(context, delegate, handler); delegate->Show(view); - ash::Shell::GetInstance()->overlay_filter()->Activate(view); + Shell::GetInstance()->overlay_filter()->Activate(view); } void KeyboardOverlayView::WindowClosing() { Cancel(); } + +} // namespace ash diff --git a/ash/keyboard_overlay/keyboard_overlay_view.h b/ash/keyboard_overlay/keyboard_overlay_view.h index 0409d8b..d83cb13 100644 --- a/ash/keyboard_overlay/keyboard_overlay_view.h +++ b/ash/keyboard_overlay/keyboard_overlay_view.h @@ -20,6 +20,8 @@ namespace ui { class WebDialogDelegate; } +namespace ash { + // A customized dialog view for the keyboard overlay. class ASH_EXPORT KeyboardOverlayView : public views::WebDialogView, @@ -47,4 +49,6 @@ class ASH_EXPORT KeyboardOverlayView DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayView); }; +} // namespace ash + #endif // ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_VIEW_H_ |