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

Unified Diff: chrome/browser/ui/views/try_chrome_dialog_view.cc

Issue 2992493002: Fix the problem with the TryChromeAgain toast appearing in the wrong place on scale factors other t… (Closed)
Patch Set: The window region for the toast has to be in pixels Created 3 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/try_chrome_dialog_view.cc
diff --git a/chrome/browser/ui/views/try_chrome_dialog_view.cc b/chrome/browser/ui/views/try_chrome_dialog_view.cc
index c410bb9bd164520861266387b3f44a87f0481501..ce234098e88df6e85b5be754359a5fd0e6af632d 100644
--- a/chrome/browser/ui/views/try_chrome_dialog_view.cc
+++ b/chrome/browser/ui/views/try_chrome_dialog_view.cc
@@ -23,6 +23,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/display/screen.h"
+#include "ui/display/win/screen_win.h"
#include "ui/gfx/image/image.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/views/background.h"
@@ -293,7 +294,11 @@ TryChromeDialogView::Result TryChromeDialogView::ShowDialog(
// Carve the toast shape into the window.
HWND toast_window;
toast_window = popup_->GetNativeView()->GetHost()->GetAcceleratedWidget();
- SetToastRegion(toast_window, preferred.width(), preferred.height());
+
+ gfx::Size size_in_pixels = display::win::ScreenWin::DIPToScreenSize(
+ toast_window, preferred);
+ SetToastRegion(toast_window, size_in_pixels.width(),
+ size_in_pixels.height());
// Time to show the window in a modal loop.
popup_->Show();
@@ -320,8 +325,7 @@ gfx::Rect TryChromeDialogView::ComputeWindowPosition(const gfx::Size& size,
origin.set_x(is_RTL ? work_area.x() : work_area.right() - size.width());
origin.set_y(work_area.bottom()- size.height());
- return display::Screen::GetScreen()->ScreenToDIPRectInWindow(
- popup_->GetNativeView(), gfx::Rect(origin, size));
+ return gfx::Rect(origin, size);
}
void TryChromeDialogView::SetToastRegion(HWND window, int w, int h) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698