OLD | NEW |
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 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLING_BUBBLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLING_BUBBLE_MODEL_H_ |
6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLING_BUBBLE_MODEL_H_ | 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLING_BUBBLE_MODEL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "chrome/browser/ui/confirm_bubble_model.h" | 10 #include "chrome/browser/ui/confirm_bubble_model.h" |
11 | 11 |
12 class Profile; | 12 class Profile; |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 class WebContents; | 15 class WebContents; |
16 } | 16 } |
17 | 17 |
18 // A class that implements a bubble menu shown when we confirm a user allows | 18 // A class that implements a bubble menu shown when we confirm a user allows |
19 // integrating the spelling service of Google to Chrome. | 19 // integrating the spelling service of Google to Chrome. |
20 class SpellingBubbleModel : public ConfirmBubbleModel { | 20 class SpellingBubbleModel : public ConfirmBubbleModel { |
21 public: | 21 public: |
22 SpellingBubbleModel(Profile* profile, | 22 SpellingBubbleModel(Profile* profile, |
23 content::WebContents* web_contents, | 23 content::WebContents* web_contents, |
24 bool include_autocorrect); | 24 bool include_autocorrect); |
25 ~SpellingBubbleModel() override; | 25 ~SpellingBubbleModel() override; |
26 | 26 |
27 // ConfirmBubbleModel implementation. | 27 // ConfirmBubbleModel implementation. |
28 base::string16 GetTitle() const override; | 28 base::string16 GetTitle() const override; |
29 base::string16 GetMessageText() const override; | 29 base::string16 GetMessageText() const override; |
30 gfx::Image* GetIcon() const override; | |
31 base::string16 GetButtonLabel(BubbleButton button) const override; | 30 base::string16 GetButtonLabel(BubbleButton button) const override; |
32 void Accept() override; | 31 void Accept() override; |
33 void Cancel() override; | 32 void Cancel() override; |
34 base::string16 GetLinkText() const override; | 33 base::string16 GetLinkText() const override; |
35 void LinkClicked() override; | 34 void LinkClicked() override; |
36 | 35 |
37 private: | 36 private: |
38 // Set the profile preferences to enable or disable the feature. | 37 // Set the profile preferences to enable or disable the feature. |
39 void SetPref(bool enabled); | 38 void SetPref(bool enabled); |
40 | 39 |
41 Profile* profile_; | 40 Profile* profile_; |
42 content::WebContents* web_contents_; | 41 content::WebContents* web_contents_; |
43 bool include_autocorrect_; | 42 bool include_autocorrect_; |
44 | 43 |
45 DISALLOW_COPY_AND_ASSIGN(SpellingBubbleModel); | 44 DISALLOW_COPY_AND_ASSIGN(SpellingBubbleModel); |
46 }; | 45 }; |
47 | 46 |
48 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLING_BUBBLE_MODEL_H_ | 47 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_SPELLING_BUBBLE_MODEL_H_ |
OLD | NEW |