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

Side by Side Diff: chrome/browser/plugin_installer_infobar_delegate.h

Issue 8851007: WIP / Do not commit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/plugin_installer.cc ('k') | chrome/browser/plugin_installer_infobar_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_BROWSER_PLUGIN_INSTALLER_INFOBAR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_PLUGIN_INSTALLER_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_PLUGIN_INSTALLER_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_PLUGIN_INSTALLER_INFOBAR_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "chrome/browser/plugin_installer_observer.h"
10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" 11 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
11 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
12 13
13 // The main purpose for this class is to popup/close the infobar when there is 14 // The main purpose for this class is to popup/close the infobar when there is
14 // a missing plugin. 15 // a missing plugin.
15 class PluginInstallerInfoBarDelegate : public ConfirmInfoBarDelegate { 16 class PluginInstallerInfoBarDelegate : public ConfirmInfoBarDelegate,
17 public PluginInstallerObserver {
16 public: 18 public:
17 // Shows an infobar asking whether to install the plugin with the name 19 // Shows an infobar asking whether to install the plugin with the name
18 // |plugin_name|. When the user accepts, |callback| is called. 20 // |plugin_name|. When the user accepts, |callback| is called.
19 PluginInstallerInfoBarDelegate(InfoBarTabHelper* infobar_helper, 21 // If |installer| is not NULL, registers itself as its observer.
22 PluginInstallerInfoBarDelegate(PluginInstaller* installer,
23 InfoBarTabHelper* infobar_helper,
20 const string16& plugin_name, 24 const string16& plugin_name,
21 const GURL& learn_more_url, 25 const GURL& learn_more_url,
22 const base::Closure& callback); 26 const base::Closure& callback);
23 27
24 private: 28 private:
25 virtual ~PluginInstallerInfoBarDelegate(); 29 virtual ~PluginInstallerInfoBarDelegate();
26 30
27 // ConfirmInfoBarDelegate: 31 // ConfirmInfoBarDelegate:
28 virtual gfx::Image* GetIcon() const OVERRIDE; 32 virtual gfx::Image* GetIcon() const OVERRIDE;
29 virtual PluginInstallerInfoBarDelegate* 33 virtual PluginInstallerInfoBarDelegate*
30 AsPluginInstallerInfoBarDelegate() OVERRIDE; 34 AsPluginInstallerInfoBarDelegate() OVERRIDE;
31 virtual string16 GetMessageText() const OVERRIDE; 35 virtual string16 GetMessageText() const OVERRIDE;
32 virtual int GetButtons() const OVERRIDE; 36 virtual int GetButtons() const OVERRIDE;
33 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; 37 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
34 virtual bool Accept() OVERRIDE; 38 virtual bool Accept() OVERRIDE;
35 virtual string16 GetLinkText() const OVERRIDE; 39 virtual string16 GetLinkText() const OVERRIDE;
36 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; 40 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
37 41
42 // PluginInstallerObserver:
43 virtual void DidStartDownload() OVERRIDE;
44
38 string16 plugin_name_; 45 string16 plugin_name_;
39 GURL learn_more_url_; 46 GURL learn_more_url_;
40 base::Closure callback_; 47 base::Closure callback_;
41 48
42 DISALLOW_COPY_AND_ASSIGN(PluginInstallerInfoBarDelegate); 49 DISALLOW_COPY_AND_ASSIGN(PluginInstallerInfoBarDelegate);
43 }; 50 };
44 51
45 #endif // CHROME_BROWSER_PLUGIN_INSTALLER_INFOBAR_DELEGATE_H_ 52 #endif // CHROME_BROWSER_PLUGIN_INSTALLER_INFOBAR_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/plugin_installer.cc ('k') | chrome/browser/plugin_installer_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698