| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/gpu/three_d_api_observer.h" | 5 #include "chrome/browser/gpu/three_d_api_observer.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "chrome/browser/tab_contents/tab_util.h" | 9 #include "chrome/browser/tab_contents/tab_util.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 DISALLOW_COPY_AND_ASSIGN(ThreeDAPIInfoBarDelegate); | 57 DISALLOW_COPY_AND_ASSIGN(ThreeDAPIInfoBarDelegate); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 // static | 60 // static |
| 61 void ThreeDAPIInfoBarDelegate::Create(InfoBarService* infobar_service, | 61 void ThreeDAPIInfoBarDelegate::Create(InfoBarService* infobar_service, |
| 62 const GURL& url, | 62 const GURL& url, |
| 63 content::ThreeDAPIType requester) { | 63 content::ThreeDAPIType requester) { |
| 64 if (!infobar_service) | 64 if (!infobar_service) |
| 65 return; // NULL for apps. | 65 return; // NULL for apps. |
| 66 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 66 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( |
| 67 scoped_ptr<ConfirmInfoBarDelegate>( | 67 infobar_service, scoped_ptr<ConfirmInfoBarDelegate>( |
| 68 new ThreeDAPIInfoBarDelegate(url, requester)))); | 68 new ThreeDAPIInfoBarDelegate(url, requester)))); |
| 69 } | 69 } |
| 70 | 70 |
| 71 ThreeDAPIInfoBarDelegate::ThreeDAPIInfoBarDelegate( | 71 ThreeDAPIInfoBarDelegate::ThreeDAPIInfoBarDelegate( |
| 72 const GURL& url, | 72 const GURL& url, |
| 73 content::ThreeDAPIType requester) | 73 content::ThreeDAPIType requester) |
| 74 : ConfirmInfoBarDelegate(), | 74 : ConfirmInfoBarDelegate(), |
| 75 url_(url), | 75 url_(url), |
| 76 requester_(requester), | 76 requester_(requester), |
| 77 message_text_queried_(false), | 77 message_text_queried_(false), |
| 78 action_taken_(false) { | 78 action_taken_(false) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 int render_process_id, | 168 int render_process_id, |
| 169 int render_view_id, | 169 int render_view_id, |
| 170 content::ThreeDAPIType requester) { | 170 content::ThreeDAPIType requester) { |
| 171 content::WebContents* web_contents = tab_util::GetWebContentsByID( | 171 content::WebContents* web_contents = tab_util::GetWebContentsByID( |
| 172 render_process_id, render_view_id); | 172 render_process_id, render_view_id); |
| 173 if (!web_contents) | 173 if (!web_contents) |
| 174 return; | 174 return; |
| 175 ThreeDAPIInfoBarDelegate::Create( | 175 ThreeDAPIInfoBarDelegate::Create( |
| 176 InfoBarService::FromWebContents(web_contents), url, requester); | 176 InfoBarService::FromWebContents(web_contents), url, requester); |
| 177 } | 177 } |
| OLD | NEW |