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

Side by Side Diff: chrome/browser/ui/apps/app_metro_infobar_delegate_win.h

Issue 190063006: Infobar Componentization Proof of Concept (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 6 years, 9 months 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_UI_APPS_APP_METRO_INFOBAR_DELEGATE_WIN_H_ 5 #ifndef CHROME_BROWSER_UI_APPS_APP_METRO_INFOBAR_DELEGATE_WIN_H_
6 #define CHROME_BROWSER_UI_APPS_APP_METRO_INFOBAR_DELEGATE_WIN_H_ 6 #define CHROME_BROWSER_UI_APPS_APP_METRO_INFOBAR_DELEGATE_WIN_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 10 #include "chrome/browser/infobars/content_confirm_infobar_delegate.h"
11 11
12 class InfoBarService; 12 class InfoBarService;
13 class Profile; 13 class Profile;
14 14
15 // This infobar operates by opening a new tab on about:blank, showing an 15 // This infobar operates by opening a new tab on about:blank, showing an
16 // infobar offering to relaunch the browser in metro mode, and then relaunching 16 // infobar offering to relaunch the browser in metro mode, and then relaunching
17 // in Desktop mode if confirmed. 17 // in Desktop mode if confirmed.
18 class AppMetroInfoBarDelegateWin : public ConfirmInfoBarDelegate { 18 class AppMetroInfoBarDelegateWin : public ContentConfirmInfoBarDelegate {
19 public: 19 public:
20 enum Mode { 20 enum Mode {
21 SHOW_APP_LIST, 21 SHOW_APP_LIST,
22 LAUNCH_PACKAGED_APP 22 LAUNCH_PACKAGED_APP
23 }; 23 };
24 24
25 // Creates an app metro infobar and delegate, adds the infobar to a new 25 // Creates an app metro infobar and delegate, adds the infobar to a new
26 // browser tab, then activates Metro mode. 26 // browser tab, then activates Metro mode.
27 static void Create(Profile* profile, 27 static void Create(Profile* profile,
28 Mode mode, 28 Mode mode,
29 const std::string& extension_id); 29 const std::string& extension_id);
30 30
31 private: 31 private:
32 AppMetroInfoBarDelegateWin(Mode mode, const std::string& extension_id); 32 AppMetroInfoBarDelegateWin(content::WebContents* web_contents,
33 Mode mode,
34 const std::string& extension_id);
33 virtual ~AppMetroInfoBarDelegateWin(); 35 virtual ~AppMetroInfoBarDelegateWin();
34 36
35 // ConfirmInfoBarDelegate overrides: 37 // ConfirmInfoBarDelegate overrides:
36 virtual int GetIconID() const OVERRIDE; 38 virtual int GetIconID() const OVERRIDE;
37 virtual base::string16 GetMessageText() const OVERRIDE; 39 virtual base::string16 GetMessageText() const OVERRIDE;
38 virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; 40 virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
39 virtual bool Accept() OVERRIDE; 41 virtual bool Accept() OVERRIDE;
40 virtual bool Cancel() OVERRIDE; 42 virtual bool Cancel() OVERRIDE;
41 virtual base::string16 GetLinkText() const OVERRIDE; 43 virtual base::string16 GetLinkText() const OVERRIDE;
42 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; 44 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
43 45
44 Mode mode_; 46 Mode mode_;
45 std::string extension_id_; 47 std::string extension_id_;
46 48
47 DISALLOW_COPY_AND_ASSIGN(AppMetroInfoBarDelegateWin); 49 DISALLOW_COPY_AND_ASSIGN(AppMetroInfoBarDelegateWin);
48 }; 50 };
49 51
50 #endif // CHROME_BROWSER_UI_APPS_APP_METRO_INFOBAR_DELEGATE_WIN_H_ 52 #endif // CHROME_BROWSER_UI_APPS_APP_METRO_INFOBAR_DELEGATE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698