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

Unified Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 857043002: <webview>: Cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment Created 5 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 | « extensions/browser/guest_view/guest_view_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/guest_view/web_view/web_view_guest.cc
diff --git a/extensions/browser/guest_view/web_view/web_view_guest.cc b/extensions/browser/guest_view/web_view/web_view_guest.cc
index d4849436b400d202265d30f2a5a01b0b0e9dc2e7..0ce4c6546ae8b964bedc3d8ba2600834e8a92c62 100644
--- a/extensions/browser/guest_view/web_view/web_view_guest.cc
+++ b/extensions/browser/guest_view/web_view/web_view_guest.cc
@@ -202,8 +202,7 @@ int WebViewGuest::GetOrGenerateRulesRegistryID(
if (it != web_view_key_to_id_map.Get().end())
return it->second;
- content::RenderProcessHost* rph =
- content::RenderProcessHost::FromID(embedder_process_id);
+ auto rph = content::RenderProcessHost::FromID(embedder_process_id);
int rules_registry_id =
RulesRegistryService::Get(rph->GetBrowserContext())->
GetNextRulesRegistryID();
@@ -213,7 +212,7 @@ int WebViewGuest::GetOrGenerateRulesRegistryID(
// static
int WebViewGuest::GetViewInstanceId(WebContents* contents) {
- WebViewGuest* guest = FromWebContents(contents);
+ auto guest = FromWebContents(contents);
if (!guest)
return guestview::kInstanceIDNone;
@@ -260,9 +259,8 @@ void WebViewGuest::CreateWebContents(
// If we already have a webview tag in the same app using the same storage
// partition, we should use the same SiteInstance so the existing tag and
// the new tag can script each other.
- GuestViewManager* guest_view_manager =
- GuestViewManager::FromBrowserContext(
- owner_render_process_host->GetBrowserContext());
+ auto guest_view_manager = GuestViewManager::FromBrowserContext(
+ owner_render_process_host->GetBrowserContext());
content::SiteInstance* guest_site_instance =
guest_view_manager->GetGuestSiteInstance(guest_site);
if (!guest_site_instance) {
@@ -997,8 +995,7 @@ void WebViewGuest::ApplyAttributes(const base::DictionaryValue& params) {
// the time the WebContents was created and the time it was attached.
// We also need to do an initial navigation if a RenderView was never
// created for the new window in cases where there is no referrer.
- PendingWindowMap::iterator it =
- GetOpener()->pending_new_windows_.find(this);
+ auto it = GetOpener()->pending_new_windows_.find(this);
if (it != GetOpener()->pending_new_windows_.end()) {
const NewWindowInfo& new_window_info = it->second;
if (new_window_info.changed || !web_contents()->HasOpener())
@@ -1037,7 +1034,7 @@ void WebViewGuest::SetName(const std::string& name) {
}
void WebViewGuest::SetZoom(double zoom_factor) {
- ui_zoom::ZoomController* zoom_controller =
+ auto zoom_controller =
ui_zoom::ZoomController::FromWebContents(web_contents());
DCHECK(zoom_controller);
double zoom_level = content::ZoomFactorToZoomLevel(zoom_factor);
@@ -1137,8 +1134,7 @@ content::WebContents* WebViewGuest::OpenURLFromTab(
// until attachment.
if (!attached()) {
WebViewGuest* opener = GetOpener();
- PendingWindowMap::iterator it =
- opener->pending_new_windows_.find(this);
+ auto it = opener->pending_new_windows_.find(this);
if (it == opener->pending_new_windows_.end())
return NULL;
const NewWindowInfo& info = it->second;
@@ -1162,7 +1158,7 @@ void WebViewGuest::WebContentsCreated(WebContents* source_contents,
const base::string16& frame_name,
const GURL& target_url,
content::WebContents* new_contents) {
- WebViewGuest* guest = WebViewGuest::FromWebContents(new_contents);
+ auto guest = WebViewGuest::FromWebContents(new_contents);
CHECK(guest);
guest->SetOpener(this);
std::string guest_name = base::UTF16ToUTF8(frame_name);
@@ -1191,10 +1187,10 @@ void WebViewGuest::RequestNewWindowPermission(
const gfx::Rect& initial_bounds,
bool user_gesture,
content::WebContents* new_contents) {
- WebViewGuest* guest = WebViewGuest::FromWebContents(new_contents);
+ auto guest = WebViewGuest::FromWebContents(new_contents);
if (!guest)
return;
- PendingWindowMap::iterator it = pending_new_windows_.find(guest);
+ auto it = pending_new_windows_.find(guest);
if (it == pending_new_windows_.end())
return;
const NewWindowInfo& new_window_info = it->second;
@@ -1242,7 +1238,7 @@ void WebViewGuest::OnWebViewNewWindowResponse(
int new_window_instance_id,
bool allow,
const std::string& user_input) {
- WebViewGuest* guest =
+ auto guest =
WebViewGuest::From(owner_web_contents()->GetRenderProcessHost()->GetID(),
new_window_instance_id);
if (!guest)
« no previous file with comments | « extensions/browser/guest_view/guest_view_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698