summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents/spelling_bubble_model.h
blob: b91487d0a26e5c39af9c1dc0dd7f80638a6c0fcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_TAB_CONTENTS_SPELLING_BUBBLE_MODEL_H_
#define CHROME_BROWSER_TAB_CONTENTS_SPELLING_BUBBLE_MODEL_H_

#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/browser/ui/confirm_bubble_model.h"

class Profile;

namespace content {
class WebContents;
}

// A class that implements a bubble menu shown when we confirm a user allows
// integrating the spelling service of Google to Chrome.
class SpellingBubbleModel : public ConfirmBubbleModel {
 public:
  SpellingBubbleModel(Profile* profile,
                      content::WebContents* web_contents,
                      bool include_autocorrect);
  virtual ~SpellingBubbleModel();

  // ConfirmBubbleModel implementation.
  virtual string16 GetTitle() const OVERRIDE;
  virtual string16 GetMessageText() const OVERRIDE;
  virtual gfx::Image* GetIcon() const OVERRIDE;
  virtual string16 GetButtonLabel(BubbleButton button) const OVERRIDE;
  virtual void Accept() OVERRIDE;
  virtual void Cancel() OVERRIDE;
  virtual string16 GetLinkText() const OVERRIDE;
  virtual void LinkClicked() OVERRIDE;

 private:
  // Set the profile preferences to enable or disable the feature.
  void SetPref(bool enabled);

  Profile* profile_;
  content::WebContents* web_contents_;
  bool include_autocorrect_;

  DISALLOW_COPY_AND_ASSIGN(SpellingBubbleModel);
};

#endif  // CHROME_BROWSER_TAB_CONTENTS_SPELLING_BUBBLE_MODEL_H_