|
OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/tab_contents/spelling_bubble_model.h" | |
6 | |
7 #include "chrome/browser/prefs/pref_service.h" | |
8 #include "chrome/browser/profiles/profile.h" | |
9 #include "chrome/common/pref_names.h" | |
10 #include "grit/generated_resources.h" | |
11 #include "grit/theme_resources.h" | |
12 #include "ui/base/resource/resource_bundle.h" | |
13 #include "ui/base/l10n/l10n_util.h" | |
Miranda Callahan
2011/10/31 13:33:46
nit: alpha-order
Hironori Bono
2011/11/01 10:15:09
Done. Thanks for noticing it.
| |
14 #include "ui/gfx/image/image.h" | |
15 | |
16 SpellingBubbleModel::SpellingBubbleModel(Profile* profile) | |
17 : profile_(profile) { | |
18 } | |
19 | |
20 SpellingBubbleModel::~SpellingBubbleModel() { | |
21 } | |
22 | |
23 string16 SpellingBubbleModel::GetTitle() const { | |
24 return l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE); | |
25 } | |
26 | |
27 string16 SpellingBubbleModel::GetMessageText() const { | |
28 return l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT); | |
29 } | |
30 | |
31 gfx::Image* SpellingBubbleModel::GetIcon() const { | |
32 return &ResourceBundle::GetSharedInstance().GetImageNamed( | |
33 IDR_PRODUCT_LOGO_16); | |
34 } | |
35 | |
36 string16 SpellingBubbleModel::GetButtonLabel(BubbleButton button) const { | |
37 return l10n_util::GetStringUTF16(button == BUTTON_OK ? | |
38 IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE : | |
39 IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_DISABLE); | |
40 } | |
41 | |
42 void SpellingBubbleModel::Accept() { | |
43 PrefService* pref = profile_->GetPrefs(); | |
44 if (pref) | |
Miranda Callahan
2011/10/31 13:33:46
Maybe change this to a DCHECK? If a Profile doesn'
Hironori Bono
2011/11/01 10:15:09
Done. Thank you for your explanation. (I did not n
| |
45 pref->SetBoolean(prefs::kSpellCheckUseSpellingService, true); | |
46 } | |
47 | |
48 void SpellingBubbleModel::Cancel() { | |
49 } | |
OLD | NEW |