OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" | 5 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/prefs/pref_member.h" | 10 #include "chrome/browser/prefs/pref_member.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 rvh->routing_id(), SpellCheckerPlatform::SpellingPanelVisible())); | 200 rvh->routing_id(), SpellCheckerPlatform::SpellingPanelVisible())); |
201 break; | 201 break; |
202 | 202 |
203 #if defined(OS_WIN) | 203 #if defined(OS_WIN) |
204 case IDC_CONTENT_CONTEXT_SPELLING_TOGGLE: | 204 case IDC_CONTENT_CONTEXT_SPELLING_TOGGLE: |
205 // When a user chooses the "Ask Google for spelling suggestions" item, we | 205 // When a user chooses the "Ask Google for spelling suggestions" item, we |
206 // show a bubble to confirm it. On the other hand, when a user chooses the | 206 // show a bubble to confirm it. On the other hand, when a user chooses the |
207 // "Stop asking Google for spelling suggestions" item, we directly update | 207 // "Stop asking Google for spelling suggestions" item, we directly update |
208 // the profile and stop integrating the spelling service immediately. | 208 // the profile and stop integrating the spelling service immediately. |
209 if (!integrate_spelling_service_) { | 209 if (!integrate_spelling_service_) { |
210 gfx::Rect bounds = rvh->view()->GetViewBounds(); | 210 gfx::Rect rect = rvh->view()->GetViewBounds(); |
211 bounds.Inset(bounds.width() / 2, 0); | 211 ConfirmBubbleModel::Show(rvh->view()->GetNativeView(), |
212 ConfirmBubbleModel::Show(rvh->view()->GetNativeView(), bounds.origin(), | 212 gfx::Point(rect.CenterPoint().x(), rect.y()), |
213 new SpellingBubbleModel(proxy_->GetProfile())); | 213 new SpellingBubbleModel(proxy_->GetProfile())); |
214 } else { | 214 } else { |
215 Profile* profile = proxy_->GetProfile(); | 215 Profile* profile = proxy_->GetProfile(); |
216 if (profile) | 216 if (profile) |
217 profile->GetPrefs()->SetBoolean(prefs::kSpellCheckUseSpellingService, | 217 profile->GetPrefs()->SetBoolean(prefs::kSpellCheckUseSpellingService, |
218 false); | 218 false); |
219 } | 219 } |
220 break; | 220 break; |
221 #endif | 221 #endif |
222 } | 222 } |
223 } | 223 } |
OLD | NEW |