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

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 "base/logging.h"
8 #include "chrome/browser/prefs/pref_service.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/pref_names.h"
11 #include "grit/generated_resources.h"
12 #include "grit/theme_resources.h"
13 #include "ui/base/l10n/l10n_util.h"
14 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/gfx/image/image.h"
16
17 SpellingBubbleModel::SpellingBubbleModel(Profile* profile)
18 : profile_(profile) {
19 }
20
21 SpellingBubbleModel::~SpellingBubbleModel() {
22 }
23
24 string16 SpellingBubbleModel::GetTitle() const {
25 return l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_ASK_GOOGLE);
26 }
27
28 string16 SpellingBubbleModel::GetMessageText() const {
29 return l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT);
30 }
31
32 gfx::Image* SpellingBubbleModel::GetIcon() const {
33 return &ResourceBundle::GetSharedInstance().GetImageNamed(
34 IDR_PRODUCT_LOGO_16);
35 }
36
37 string16 SpellingBubbleModel::GetButtonLabel(BubbleButton button) const {
38 return l10n_util::GetStringUTF16(button == BUTTON_OK ?
39 IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE :
40 IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_DISABLE);
41 }
42
43 void SpellingBubbleModel::Accept() {
44 PrefService* pref = profile_->GetPrefs();
45 DCHECK(pref);
46 pref->SetBoolean(prefs::kSpellCheckUseSpellingService, true);
47 }
48
49 void SpellingBubbleModel::Cancel() {
50 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/spelling_bubble_model.h ('k') | chrome/browser/tab_contents/spelling_menu_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698