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

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

Issue 14742002: Render opaque border with no shadow for web contents modal dialogs under Views/Win32 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing USE_AURA check Created 7 years, 8 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 | ui/views/bubble/bubble_border.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/constrained_window_views.cc
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc
index 925167303f534283a3e70817f05bbe67d32150db..6e83fc7aeb553927042e6ad9aebf129e52b67f8d 100644
--- a/chrome/browser/ui/views/constrained_window_views.cc
+++ b/chrome/browser/ui/views/constrained_window_views.cc
@@ -35,6 +35,7 @@
#include "ui/gfx/path.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/screen.h"
+#include "ui/views/border.h"
#include "ui/views/color_constants.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/focus/focus_manager.h"
@@ -114,6 +115,15 @@ class WebContentsModalDialogHostObserverViews
virtual void OnPositionRequiresUpdate() OVERRIDE {
gfx::Size size = target_widget_->GetWindowBoundsInScreen().size();
gfx::Point position = host_->GetDialogPosition(size);
+ views::Border *border =
Ben Goodger (Google) 2013/05/02 19:38:31 views::Border*
Mike Wittman 2013/05/02 20:37:06 Done.
+ target_widget_->non_client_view()->frame_view()->border();
+ // Border may be null during widget initialization.
+ if (border) {
+ // Align the first row of pixels inside the border. This is the apparent
+ // top of the dialog.
+ gfx::Insets border_insets = border->GetInsets();
+ position -= gfx::Vector2d(border_insets.left(), border_insets.top());
+ }
target_widget_->SetBounds(gfx::Rect(position, size));
}
@@ -661,8 +671,15 @@ views::Widget* CreateWebContentsModalDialogViews(
views::NonClientFrameView* CreateConstrainedStyleNonClientFrameView(
views::Widget* widget,
content::BrowserContext* browser_context) {
- if (views::DialogDelegate::UseNewStyle())
- return views::DialogDelegate::CreateNewStyleFrameView(widget);
+ if (views::DialogDelegate::UseNewStyle()) {
+#if defined(USE_AURA)
+ const bool force_opaque_border = false;
+#else
+ const bool force_opaque_border = true;
+#endif
+ return views::DialogDelegate::CreateNewStyleFrameView(widget,
+ force_opaque_border);
+ }
#if defined(USE_ASH)
ConstrainedWindowFrameViewAsh* frame = new ConstrainedWindowFrameViewAsh;
frame->Init(widget);
« no previous file with comments | « no previous file | ui/views/bubble/bubble_border.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698