| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer_context_menu/spelling_menu_observer.h" | 5 #include "chrome/browser/renderer_context_menu/spelling_menu_observer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/i18n/case_conversion.h" | 11 #include "base/i18n/case_conversion.h" |
| 12 #include "base/prefs/pref_service.h" | |
| 13 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 14 #include "chrome/app/chrome_command_ids.h" | 13 #include "chrome/app/chrome_command_ids.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 15 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| 17 #include "chrome/browser/renderer_context_menu/spelling_bubble_model.h" | 16 #include "chrome/browser/renderer_context_menu/spelling_bubble_model.h" |
| 18 #include "chrome/browser/spellchecker/feedback_sender.h" | 17 #include "chrome/browser/spellchecker/feedback_sender.h" |
| 19 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 18 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
| 20 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" | 19 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
| 21 #include "chrome/browser/spellchecker/spellcheck_platform.h" | 20 #include "chrome/browser/spellchecker/spellcheck_platform.h" |
| 22 #include "chrome/browser/spellchecker/spellcheck_service.h" | 21 #include "chrome/browser/spellchecker/spellcheck_service.h" |
| 23 #include "chrome/browser/spellchecker/spelling_service_client.h" | 22 #include "chrome/browser/spellchecker/spelling_service_client.h" |
| 24 #include "chrome/browser/ui/confirm_bubble.h" | 23 #include "chrome/browser/ui/confirm_bubble.h" |
| 25 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
| 27 #include "chrome/common/spellcheck_common.h" | 26 #include "chrome/common/spellcheck_common.h" |
| 28 #include "chrome/common/spellcheck_result.h" | 27 #include "chrome/common/spellcheck_result.h" |
| 29 #include "chrome/grit/generated_resources.h" | 28 #include "chrome/grit/generated_resources.h" |
| 29 #include "components/prefs/pref_service.h" |
| 30 #include "content/public/browser/render_view_host.h" | 30 #include "content/public/browser/render_view_host.h" |
| 31 #include "content/public/browser/render_widget_host.h" | 31 #include "content/public/browser/render_widget_host.h" |
| 32 #include "content/public/browser/render_widget_host_view.h" | 32 #include "content/public/browser/render_widget_host_view.h" |
| 33 #include "content/public/browser/web_contents.h" | 33 #include "content/public/browser/web_contents.h" |
| 34 #include "content/public/common/context_menu_params.h" | 34 #include "content/public/common/context_menu_params.h" |
| 35 #include "extensions/browser/view_type_utils.h" | 35 #include "extensions/browser/view_type_utils.h" |
| 36 #include "ui/base/l10n/l10n_util.h" | 36 #include "ui/base/l10n/l10n_util.h" |
| 37 #include "ui/gfx/geometry/rect.h" | 37 #include "ui/gfx/geometry/rect.h" |
| 38 | 38 |
| 39 using content::BrowserThread; | 39 using content::BrowserThread; |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 // Append '.' characters to the end of "Checking". | 362 // Append '.' characters to the end of "Checking". |
| 363 loading_frame_ = (loading_frame_ + 1) & 3; | 363 loading_frame_ = (loading_frame_ + 1) & 3; |
| 364 base::string16 loading_message = | 364 base::string16 loading_message = |
| 365 loading_message_ + base::string16(loading_frame_,'.'); | 365 loading_message_ + base::string16(loading_frame_,'.'); |
| 366 | 366 |
| 367 // Update the menu item with the text. We disable this item to prevent users | 367 // Update the menu item with the text. We disable this item to prevent users |
| 368 // from selecting it. | 368 // from selecting it. |
| 369 proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, false, false, | 369 proxy_->UpdateMenuItem(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, false, false, |
| 370 loading_message); | 370 loading_message); |
| 371 } | 371 } |
| OLD | NEW |