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

Unified Diff: ash/keyboard_overlay/keyboard_overlay_delegate.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes Created 8 years, 2 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
Index: ash/keyboard_overlay/keyboard_overlay_delegate.cc
diff --git a/ash/keyboard_overlay/keyboard_overlay_delegate.cc b/ash/keyboard_overlay/keyboard_overlay_delegate.cc
index e819a98147358dd29b87850649f86efb4386b19d..45cad291b7ba2a10576be36fed2e7618e8ccac6b 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::GetAshScreen()->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::GetAshScreen()->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

Powered by Google App Engine
This is Rietveld 408576698