summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/apps/app_metro_infobar_delegate_win.h
blob: 920654e25c44de11ed60fb4b8bfa1e86ad65be96 (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
49
50
51
52
// Copyright 2013 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_UI_APPS_APP_METRO_INFOBAR_DELEGATE_WIN_H_
#define CHROME_BROWSER_UI_APPS_APP_METRO_INFOBAR_DELEGATE_WIN_H_

#include <string>

#include "chrome/browser/infobars/confirm_infobar_delegate.h"

class InfoBarService;
class Profile;

// This infobar operates by opening a new tab on about:blank, showing an
// infobar offering to relaunch the browser in metro mode, and then relaunching
// in Desktop mode if confirmed.
class AppMetroInfoBarDelegateWin : public ConfirmInfoBarDelegate {
 public:
  enum Mode {
    SHOW_APP_LIST,
    LAUNCH_PACKAGED_APP
  };

  // Creates an app metro infobar delegate, adds it to a new browser tab, then
  // activates Metro mode.
  static void Create(Profile* profile,
                     Mode mode,
                     const std::string& extension_id);

 private:
  AppMetroInfoBarDelegateWin(InfoBarService* infobar_service,
                             Mode mode,
                             const std::string& extension_id);
  virtual ~AppMetroInfoBarDelegateWin();

  // ConfirmInfoBarDelegate overrides:
  virtual int GetIconID() const OVERRIDE;
  virtual string16 GetMessageText() const OVERRIDE;
  virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
  virtual bool Accept() OVERRIDE;
  virtual bool Cancel() OVERRIDE;
  virtual string16 GetLinkText() const OVERRIDE;
  virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;

  Mode mode_;
  std::string extension_id_;

  DISALLOW_COPY_AND_ASSIGN(AppMetroInfoBarDelegateWin);
};

#endif  // CHROME_BROWSER_UI_APPS_APP_METRO_INFOBAR_DELEGATE_WIN_H_