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

Side by Side Diff: chrome/browser/gpu/three_d_api_observer.cc

Issue 2561983002: NavigationController: Reload methods migration (Closed)
Patch Set: merge master Created 4 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
OLDNEW
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/macros.h" 7 #include "base/macros.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "chrome/browser/infobars/infobar_service.h" 9 #include "chrome/browser/infobars/infobar_service.h"
10 #include "chrome/browser/tab_contents/tab_util.h" 10 #include "chrome/browser/tab_contents/tab_util.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 DISMISSAL_MAX); 139 DISMISSAL_MAX);
140 return true; 140 return true;
141 } 141 }
142 142
143 bool ThreeDAPIInfoBarDelegate::Cancel() { 143 bool ThreeDAPIInfoBarDelegate::Cancel() {
144 action_taken_ = true; 144 action_taken_ = true;
145 UMA_HISTOGRAM_ENUMERATION("GPU.ThreeDAPIInfoBarDismissal", RELOADED, 145 UMA_HISTOGRAM_ENUMERATION("GPU.ThreeDAPIInfoBarDismissal", RELOADED,
146 DISMISSAL_MAX); 146 DISMISSAL_MAX);
147 content::GpuDataManager::GetInstance()->UnblockDomainFrom3DAPIs(url_); 147 content::GpuDataManager::GetInstance()->UnblockDomainFrom3DAPIs(url_);
148 InfoBarService::WebContentsFromInfoBar(infobar())->GetController().Reload( 148 InfoBarService::WebContentsFromInfoBar(infobar())->GetController().Reload(
149 true); 149 content::ReloadType::NORMAL, true);
150 return true; 150 return true;
151 } 151 }
152 152
153 // ThreeDAPIObserver ---------------------------------------------------------- 153 // ThreeDAPIObserver ----------------------------------------------------------
154 154
155 ThreeDAPIObserver::ThreeDAPIObserver() { 155 ThreeDAPIObserver::ThreeDAPIObserver() {
156 content::GpuDataManager::GetInstance()->AddObserver(this); 156 content::GpuDataManager::GetInstance()->AddObserver(this);
157 } 157 }
158 158
159 ThreeDAPIObserver::~ThreeDAPIObserver() { 159 ThreeDAPIObserver::~ThreeDAPIObserver() {
160 content::GpuDataManager::GetInstance()->RemoveObserver(this); 160 content::GpuDataManager::GetInstance()->RemoveObserver(this);
161 } 161 }
162 162
163 void ThreeDAPIObserver::DidBlock3DAPIs(const GURL& top_origin_url, 163 void ThreeDAPIObserver::DidBlock3DAPIs(const GURL& top_origin_url,
164 int render_process_id, 164 int render_process_id,
165 int render_frame_id, 165 int render_frame_id,
166 content::ThreeDAPIType requester) { 166 content::ThreeDAPIType requester) {
167 content::WebContents* web_contents = tab_util::GetWebContentsByFrameID( 167 content::WebContents* web_contents = tab_util::GetWebContentsByFrameID(
168 render_process_id, render_frame_id); 168 render_process_id, render_frame_id);
169 if (!web_contents) 169 if (!web_contents)
170 return; 170 return;
171 ThreeDAPIInfoBarDelegate::Create( 171 ThreeDAPIInfoBarDelegate::Create(
172 InfoBarService::FromWebContents(web_contents), top_origin_url, requester); 172 InfoBarService::FromWebContents(web_contents), top_origin_url, requester);
173 } 173 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/navigation_observer.cc ('k') | chrome/browser/history/history_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698