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

Unified Diff: chrome/browser/views/info_bubble.cc

Issue 118102: Fixes a couple of bugs encountered in getting info bubbles to work:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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 | views/widget/widget_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/info_bubble.cc
===================================================================
--- chrome/browser/views/info_bubble.cc (revision 17379)
+++ chrome/browser/views/info_bubble.cc (working copy)
@@ -9,6 +9,7 @@
#include "app/resource_bundle.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/views/frame/browser_view.h"
+#include "chrome/browser/window_sizer.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/notification_type.h"
#include "grit/theme_resources.h"
@@ -16,7 +17,6 @@
#include "views/window/window.h"
#if defined(OS_WIN)
-#include "app/win_util.h"
#include "base/win_util.h"
#endif
@@ -83,7 +83,7 @@
#if defined(OS_WIN)
window->ShowWindow(SW_SHOW);
#else
- NOTREACHED();
+ static_cast<WidgetGtk*>(window)->Show();
#endif
return window;
}
@@ -134,6 +134,8 @@
#if defined(OS_WIN)
WidgetWin::Init(parent->GetNativeWindow(), bounds, true);
+#else
+ WidgetGtk::Init(GTK_WIDGET(parent->GetNativeWindow()), bounds, true);
#endif
SetContentsView(content_view_);
// The preferred size may differ when parented. Ask for the bounds again
@@ -148,8 +150,6 @@
SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOZORDER);
// Invoke ChangeSize, otherwise layered window isn't updated correctly.
ChangeSize(0, CSize(parented_bounds.width(), parented_bounds.height()));
-#else
- NOTIMPLEMENTED();
#endif
}
@@ -254,12 +254,10 @@
gfx::Rect InfoBubble::ContentView::CalculateWindowBoundsAndAjust(
const gfx::Rect& position_relative_to) {
-#if defined(OS_WIN)
- gfx::Rect monitor_bounds = win_util::GetMonitorBoundsForRect(
- position_relative_to);
-#else
- gfx::Rect monitor_bounds;
-#endif
+ scoped_ptr<WindowSizer::MonitorInfoProvider> monitor_provider(
+ WindowSizer::CreateDefaultMonitorInfoProvider());
+ gfx::Rect monitor_bounds(
+ monitor_provider->GetMonitorWorkAreaMatching(position_relative_to));
// Calculate the bounds using TOP_LEFT (the default).
gfx::Rect window_bounds = CalculateWindowBounds(position_relative_to);
if (monitor_bounds.IsEmpty() || monitor_bounds.Contains(window_bounds))
« no previous file with comments | « no previous file | views/widget/widget_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698