OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/tab_contents/spelling_bubble_model.h" | 5 #include "chrome/browser/tab_contents/spelling_bubble_model.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/google/google_util.h" |
8 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/ui/browser_list.h" |
10 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 13 #include "chrome/common/url_constants.h" |
| 14 #include "googleurl/src/gurl.h" |
11 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
12 #include "grit/theme_resources.h" | 16 #include "grit/theme_resources.h" |
13 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
14 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/gfx/image/image.h" | 19 #include "ui/gfx/image/image.h" |
16 | 20 |
17 SpellingBubbleModel::SpellingBubbleModel(Profile* profile) | 21 SpellingBubbleModel::SpellingBubbleModel(Profile* profile) |
18 : profile_(profile) { | 22 : profile_(profile) { |
19 } | 23 } |
20 | 24 |
(...skipping 20 matching lines...) Expand all Loading... |
41 } | 45 } |
42 | 46 |
43 void SpellingBubbleModel::Accept() { | 47 void SpellingBubbleModel::Accept() { |
44 PrefService* pref = profile_->GetPrefs(); | 48 PrefService* pref = profile_->GetPrefs(); |
45 DCHECK(pref); | 49 DCHECK(pref); |
46 pref->SetBoolean(prefs::kSpellCheckUseSpellingService, true); | 50 pref->SetBoolean(prefs::kSpellCheckUseSpellingService, true); |
47 } | 51 } |
48 | 52 |
49 void SpellingBubbleModel::Cancel() { | 53 void SpellingBubbleModel::Cancel() { |
50 } | 54 } |
| 55 |
| 56 string16 SpellingBubbleModel::GetLinkText() const { |
| 57 return l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_LINK); |
| 58 } |
| 59 |
| 60 void SpellingBubbleModel::LinkClicked() { |
| 61 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); |
| 62 browser->OpenURL( |
| 63 google_util::AppendGoogleLocaleParam(GURL(chrome::kPrivacyLearnMoreURL)), |
| 64 GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK); |
| 65 } |
OLD | NEW |