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

Unified Diff: chrome/browser/tab_contents/spelling_menu_observer.cc

Issue 12222003: Rebase ConfirmBubbleViews on DialogDelegateView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ConfirmBubbleViewsTest and remove moot checks. Created 7 years, 10 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: chrome/browser/tab_contents/spelling_menu_observer.cc
diff --git a/chrome/browser/tab_contents/spelling_menu_observer.cc b/chrome/browser/tab_contents/spelling_menu_observer.cc
index 4481acadfef7b2a696453e4309147294a9975406..0303c27cb8bf52bb9f199623759bbb3c457e5cfe 100644
--- a/chrome/browser/tab_contents/spelling_menu_observer.cc
+++ b/chrome/browser/tab_contents/spelling_menu_observer.cc
@@ -24,6 +24,8 @@
#include "chrome/common/spellcheck_result.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_view.h"
#include "content/public/common/context_menu_params.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -265,12 +267,16 @@ void SpellingMenuObserver::ExecuteCommand(int command_id) {
if (!integrate_spelling_service_.GetValue()) {
content::RenderViewHost* rvh = proxy_->GetRenderViewHost();
gfx::Rect rect = rvh->GetView()->GetViewBounds();
- chrome::ShowConfirmBubble(rvh->GetView()->GetNativeView(),
- gfx::Point(rect.CenterPoint().x(), rect.y()),
- new SpellingBubbleModel(
- proxy_->GetProfile(),
- proxy_->GetWebContents(),
- false));
+ chrome::ShowConfirmBubble(
+#if defined(TOOLKIT_VIEWS)
+ proxy_->GetWebContents()->GetView()->GetTopLevelNativeWindow(),
+#else
+ rvh->GetView()->GetNativeView(),
+#endif
+ gfx::Point(rect.CenterPoint().x(), rect.y()),
+ new SpellingBubbleModel(proxy_->GetProfile(),
+ proxy_->GetWebContents(),
+ false));
} else {
Profile* profile = proxy_->GetProfile();
if (profile)

Powered by Google App Engine
This is Rietveld 408576698