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

Side by Side Diff: components/autofill/content/browser/content_autofill_driver_factory.cc

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 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 "components/autofill/content/browser/content_autofill_driver_factory.h" 5 #include "components/autofill/content/browser/content_autofill_driver_factory.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 auto mapping = frame_driver_map_.find(render_frame_host); 93 auto mapping = frame_driver_map_.find(render_frame_host);
94 return mapping == frame_driver_map_.end() ? nullptr : mapping->second.get(); 94 return mapping == frame_driver_map_.end() ? nullptr : mapping->second.get();
95 } 95 }
96 96
97 void ContentAutofillDriverFactory::RenderFrameCreated( 97 void ContentAutofillDriverFactory::RenderFrameCreated(
98 content::RenderFrameHost* render_frame_host) { 98 content::RenderFrameHost* render_frame_host) {
99 auto insertion_result = 99 auto insertion_result =
100 frame_driver_map_.insert(std::make_pair(render_frame_host, nullptr)); 100 frame_driver_map_.insert(std::make_pair(render_frame_host, nullptr));
101 // This is called twice for the main frame. 101 // This is called twice for the main frame.
102 if (insertion_result.second) { // This was the first time. 102 if (insertion_result.second) { // This was the first time.
103 insertion_result.first->second = base::WrapUnique(new ContentAutofillDriver( 103 insertion_result.first->second = base::MakeUnique<ContentAutofillDriver>(
104 render_frame_host, client_, app_locale_, enable_download_manager_)); 104 render_frame_host, client_, app_locale_, enable_download_manager_);
105 } 105 }
106 } 106 }
107 107
108 void ContentAutofillDriverFactory::RenderFrameDeleted( 108 void ContentAutofillDriverFactory::RenderFrameDeleted(
109 content::RenderFrameHost* render_frame_host) { 109 content::RenderFrameHost* render_frame_host) {
110 frame_driver_map_.erase(render_frame_host); 110 frame_driver_map_.erase(render_frame_host);
111 } 111 }
112 112
113 void ContentAutofillDriverFactory::DidNavigateAnyFrame( 113 void ContentAutofillDriverFactory::DidNavigateAnyFrame(
114 content::RenderFrameHost* render_frame_host, 114 content::RenderFrameHost* render_frame_host,
115 const content::LoadCommittedDetails& details, 115 const content::LoadCommittedDetails& details,
116 const content::FrameNavigateParams& params) { 116 const content::FrameNavigateParams& params) {
117 frame_driver_map_[render_frame_host]->DidNavigateFrame(details, params); 117 frame_driver_map_[render_frame_host]->DidNavigateFrame(details, params);
118 } 118 }
119 119
120 void ContentAutofillDriverFactory::DidFinishNavigation( 120 void ContentAutofillDriverFactory::DidFinishNavigation(
121 content::NavigationHandle* navigation_handle) { 121 content::NavigationHandle* navigation_handle) {
122 if (navigation_handle->HasCommitted()) 122 if (navigation_handle->HasCommitted())
123 client_->HideAutofillPopup(); 123 client_->HideAutofillPopup();
124 } 124 }
125 125
126 void ContentAutofillDriverFactory::WasHidden() { 126 void ContentAutofillDriverFactory::WasHidden() {
127 client_->HideAutofillPopup(); 127 client_->HideAutofillPopup();
128 } 128 }
129 129
130 } // namespace autofill 130 } // namespace autofill
OLDNEW
« no previous file with comments | « components/arc/bluetooth/arc_bluetooth_bridge.cc ('k') | components/autofill/content/renderer/password_autofill_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698