| 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);
|
| }
|
|
|