| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/spelling_menu_observer.h" | 5 #include "chrome/browser/tab_contents/spelling_menu_observer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 12 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
| 13 #include "chrome/browser/spellchecker/spellcheck_host.h" | 13 #include "chrome/browser/spellchecker/spellcheck_host.h" |
| 14 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" | 14 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
| 15 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" | 15 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" |
| 16 #include "chrome/browser/spellchecker/spelling_service_client.h" | 16 #include "chrome/browser/spellchecker/spelling_service_client.h" |
| 17 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 17 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 18 #include "chrome/browser/tab_contents/spelling_bubble_model.h" | 18 #include "chrome/browser/tab_contents/spelling_bubble_model.h" |
| 19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
| 21 #include "chrome/common/spellcheck_result.h" | 21 #include "chrome/common/spellcheck_result.h" |
| 22 #include "content/browser/renderer_host/render_view_host.h" | 22 #include "content/browser/renderer_host/render_view_host.h" |
| 23 #include "content/browser/renderer_host/render_widget_host_view.h" | 23 #include "content/public/browser/render_widget_host_view.h" |
| 24 #include "content/public/common/context_menu_params.h" | 24 #include "content/public/common/context_menu_params.h" |
| 25 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 27 | 27 |
| 28 using content::BrowserThread; | 28 using content::BrowserThread; |
| 29 | 29 |
| 30 SpellingMenuObserver::SpellingMenuObserver(RenderViewContextMenuProxy* proxy) | 30 SpellingMenuObserver::SpellingMenuObserver(RenderViewContextMenuProxy* proxy) |
| 31 : proxy_(proxy), | 31 : proxy_(proxy), |
| 32 loading_frame_(0), | 32 loading_frame_(0), |
| 33 succeeded_(false), | 33 succeeded_(false), |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 loading_frame_ = (loading_frame_ + 1) & 3; | 280 loading_frame_ = (loading_frame_ + 1) & 3; |
| 281 string16 loading_message = loading_message_; | 281 string16 loading_message = loading_message_; |
| 282 for (int i = 0; i < loading_frame_; ++i) | 282 for (int i = 0; i < loading_frame_; ++i) |
| 283 loading_message.push_back('.'); | 283 loading_message.push_back('.'); |
| 284 | 284 |
| 285 // Update the menu item with the text. We disable this item to prevent users | 285 // Update the menu item with the text. We disable this item to prevent users |
| 286 // from selecting it. | 286 // from selecting it. |
| 287 proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, false, false, | 287 proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, false, false, |
| 288 loading_message); | 288 loading_message); |
| 289 } | 289 } |
| OLD | NEW |