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

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

Issue 2847763003: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 auto new_factory = base::WrapUnique(new ContentAutofillDriverFactory( 48 auto new_factory = base::WrapUnique(new ContentAutofillDriverFactory(
49 contents, client, app_locale, enable_download_manager)); 49 contents, client, app_locale, enable_download_manager));
50 const std::vector<content::RenderFrameHost*> frames = 50 const std::vector<content::RenderFrameHost*> frames =
51 contents->GetAllFrames(); 51 contents->GetAllFrames();
52 for (content::RenderFrameHost* frame : frames) { 52 for (content::RenderFrameHost* frame : frames) {
53 if (frame->IsRenderFrameLive()) 53 if (frame->IsRenderFrameLive())
54 new_factory->RenderFrameCreated(frame); 54 new_factory->RenderFrameCreated(frame);
55 } 55 }
56 56
57 contents->SetUserData(kContentAutofillDriverFactoryWebContentsUserDataKey, 57 contents->SetUserData(kContentAutofillDriverFactoryWebContentsUserDataKey,
58 new_factory.release()); 58 std::move(new_factory));
59 } 59 }
60 60
61 // static 61 // static
62 ContentAutofillDriverFactory* ContentAutofillDriverFactory::FromWebContents( 62 ContentAutofillDriverFactory* ContentAutofillDriverFactory::FromWebContents(
63 content::WebContents* contents) { 63 content::WebContents* contents) {
64 return static_cast<ContentAutofillDriverFactory*>(contents->GetUserData( 64 return static_cast<ContentAutofillDriverFactory*>(contents->GetUserData(
65 kContentAutofillDriverFactoryWebContentsUserDataKey)); 65 kContentAutofillDriverFactoryWebContentsUserDataKey));
66 } 66 }
67 67
68 // static 68 // static
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 NavigationFinished(); 127 NavigationFinished();
128 DriverForFrame(navigation_handle->GetRenderFrameHost()) 128 DriverForFrame(navigation_handle->GetRenderFrameHost())
129 ->DidNavigateFrame(navigation_handle); 129 ->DidNavigateFrame(navigation_handle);
130 } 130 }
131 131
132 void ContentAutofillDriverFactory::WasHidden() { 132 void ContentAutofillDriverFactory::WasHidden() {
133 TabHidden(); 133 TabHidden();
134 } 134 }
135 135
136 } // namespace autofill 136 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698