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

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

Issue 8422006: Adds a bubble that asks a user whether to integrate the Spelling service. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698