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

Unified Diff: chrome/browser/three_d_api_observer.cc

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_tab_helper.cc ('k') | chrome/browser/translate/translate_infobar_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/three_d_api_observer.cc
===================================================================
--- chrome/browser/three_d_api_observer.cc (revision 175396)
+++ chrome/browser/three_d_api_observer.cc (working copy)
@@ -29,12 +29,16 @@
class ThreeDAPIInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
+ // Creates a 3D API delegate and adds it to |infobar_service|.
+ static void Create(InfoBarService* infobar_service,
+ const GURL& url,
+ content::ThreeDAPIType requester);
+
+ private:
ThreeDAPIInfoBarDelegate(
InfoBarService* owner,
const GURL& url,
content::ThreeDAPIType requester);
-
- private:
virtual ~ThreeDAPIInfoBarDelegate();
// ConfirmInfoBarDelegate:
@@ -57,6 +61,14 @@
DISALLOW_COPY_AND_ASSIGN(ThreeDAPIInfoBarDelegate);
};
+// static
+void ThreeDAPIInfoBarDelegate::Create(InfoBarService* infobar_service,
+ const GURL& url,
+ content::ThreeDAPIType requester) {
+ infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
+ new ThreeDAPIInfoBarDelegate(infobar_service, url, requester)));
+}
+
ThreeDAPIInfoBarDelegate::ThreeDAPIInfoBarDelegate(
InfoBarService* owner,
const GURL& url,
@@ -157,6 +169,6 @@
void ThreeDAPIObserver::DidBlock3DAPIs(const GURL& url,
content::ThreeDAPIType requester) {
- InfoBarService* service = InfoBarService::FromWebContents(web_contents());
- service->AddInfoBar(new ThreeDAPIInfoBarDelegate(service, url, requester));
+ ThreeDAPIInfoBarDelegate::Create(
+ InfoBarService::FromWebContents(web_contents()), url, requester);
}
« no previous file with comments | « chrome/browser/ssl/ssl_tab_helper.cc ('k') | chrome/browser/translate/translate_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698