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

Unified Diff: chrome/browser/three_d_api_observer.cc

Issue 12319119: Fix layering violation in content\browser\renderer_host. That directory shouldn't be including web_… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 10 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/three_d_api_observer.h ('k') | chrome/browser/ui/browser_tab_contents.cc » ('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 184684)
+++ chrome/browser/three_d_api_observer.cc (working copy)
@@ -7,13 +7,14 @@
#include "base/metrics/histogram.h"
#include "chrome/browser/api/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/api/infobars/infobar_service.h"
+#include "chrome/browser/tab_contents/tab_util.h"
#include "content/public/browser/gpu_data_manager.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/common/three_d_api_types.h"
+#include "googleurl/src/gurl.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(ThreeDAPIObserver);
-
namespace {
enum ThreeDInfobarDismissalHistogram {
@@ -162,13 +163,20 @@
// ThreeDAPIObserver ----------------------------------------------------
-ThreeDAPIObserver::ThreeDAPIObserver(content::WebContents* web_contents)
- : WebContentsObserver(web_contents) {}
+ThreeDAPIObserver::ThreeDAPIObserver() {
+ content::GpuDataManager::GetInstance()->AddObserver(this);
+}
-ThreeDAPIObserver::~ThreeDAPIObserver() {}
+ThreeDAPIObserver::~ThreeDAPIObserver() {
+ content::GpuDataManager::GetInstance()->RemoveObserver(this);
+}
void ThreeDAPIObserver::DidBlock3DAPIs(const GURL& url,
+ int render_process_id,
+ int render_view_id,
content::ThreeDAPIType requester) {
+ content::WebContents* web_contents = tab_util::GetWebContentsByID(
+ render_process_id, render_view_id);
ThreeDAPIInfoBarDelegate::Create(
- InfoBarService::FromWebContents(web_contents()), url, requester);
+ InfoBarService::FromWebContents(web_contents), url, requester);
}
« no previous file with comments | « chrome/browser/three_d_api_observer.h ('k') | chrome/browser/ui/browser_tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698