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

Side by Side Diff: chrome/browser/renderer_context_menu/spelling_bubble_model.cc

Issue 1242383005: Remove unused code in ConfirmBubbleModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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_bubble_model.h" 5 #include "chrome/browser/renderer_context_menu/spelling_bubble_model.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 base::string16 SpellingBubbleModel::GetTitle() const { 36 base::string16 SpellingBubbleModel::GetTitle() const {
37 return l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE); 37 return l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE);
38 } 38 }
39 39
40 base::string16 SpellingBubbleModel::GetMessageText() const { 40 base::string16 SpellingBubbleModel::GetMessageText() const {
41 return l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT); 41 return l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT);
42 } 42 }
43 43
44 gfx::Image* SpellingBubbleModel::GetIcon() const {
45 return &ResourceBundle::GetSharedInstance().GetImageNamed(
46 IDR_PRODUCT_LOGO_16);
47 }
48
49 base::string16 SpellingBubbleModel::GetButtonLabel(BubbleButton button) const { 44 base::string16 SpellingBubbleModel::GetButtonLabel(BubbleButton button) const {
50 return l10n_util::GetStringUTF16(button == BUTTON_OK ? 45 return l10n_util::GetStringUTF16(button == BUTTON_OK ?
51 IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE : 46 IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE :
52 IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_DISABLE); 47 IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_DISABLE);
53 } 48 }
54 49
55 void SpellingBubbleModel::Accept() { 50 void SpellingBubbleModel::Accept() {
56 SetPref(true); 51 SetPref(true);
57 } 52 }
58 53
(...skipping 12 matching lines...) Expand all
71 web_contents_->OpenURL(params); 66 web_contents_->OpenURL(params);
72 } 67 }
73 68
74 void SpellingBubbleModel::SetPref(bool enabled) { 69 void SpellingBubbleModel::SetPref(bool enabled) {
75 PrefService* pref = profile_->GetPrefs(); 70 PrefService* pref = profile_->GetPrefs();
76 DCHECK(pref); 71 DCHECK(pref);
77 pref->SetBoolean(prefs::kSpellCheckUseSpellingService, enabled); 72 pref->SetBoolean(prefs::kSpellCheckUseSpellingService, enabled);
78 if (include_autocorrect_) 73 if (include_autocorrect_)
79 pref->SetBoolean(prefs::kEnableAutoSpellCorrect, enabled); 74 pref->SetBoolean(prefs::kEnableAutoSpellCorrect, enabled);
80 } 75 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_context_menu/spelling_bubble_model.h ('k') | chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698