Index: chrome/browser/renderer_context_menu/spelling_menu_observer.cc |
diff --git a/chrome/browser/renderer_context_menu/spelling_menu_observer.cc b/chrome/browser/renderer_context_menu/spelling_menu_observer.cc |
index 114206986fafc500c35e3453459e1d530161a882..5cdc005e5a459d4f9a410391de2698622f623d07 100644 |
--- a/chrome/browser/renderer_context_menu/spelling_menu_observer.cc |
+++ b/chrome/browser/renderer_context_menu/spelling_menu_observer.cc |
@@ -303,11 +303,13 @@ void SpellingMenuObserver::ExecuteCommand(int command_id) { |
if (!integrate_spelling_service_.GetValue()) { |
content::RenderViewHost* rvh = proxy_->GetRenderViewHost(); |
gfx::Rect rect = rvh->GetView()->GetViewBounds(); |
+ scoped_ptr<SpellingBubbleModel> model( |
+ new SpellingBubbleModel(profile, proxy_->GetWebContents(), false)); |
chrome::ShowConfirmBubble( |
proxy_->GetWebContents()->GetTopLevelNativeWindow(), |
rvh->GetView()->GetNativeView(), |
gfx::Point(rect.CenterPoint().x(), rect.y()), |
- new SpellingBubbleModel(profile, proxy_->GetWebContents(), false)); |
+ model.Pass()); |
} else { |
if (profile) { |
profile->GetPrefs()->SetBoolean(prefs::kSpellCheckUseSpellingService, |
@@ -327,11 +329,13 @@ void SpellingMenuObserver::ExecuteCommand(int command_id) { |
if (!integrate_spelling_service_.GetValue()) { |
content::RenderViewHost* rvh = proxy_->GetRenderViewHost(); |
gfx::Rect rect = rvh->GetView()->GetViewBounds(); |
+ scoped_ptr<SpellingBubbleModel> model( |
+ new SpellingBubbleModel(profile, proxy_->GetWebContents(), true)); |
chrome::ShowConfirmBubble( |
proxy_->GetWebContents()->GetTopLevelNativeWindow(), |
rvh->GetView()->GetNativeView(), |
gfx::Point(rect.CenterPoint().x(), rect.y()), |
- new SpellingBubbleModel(profile, proxy_->GetWebContents(), true)); |
+ model.Pass()); |
} else { |
if (profile) { |
bool current_value = autocorrect_spelling_.GetValue(); |