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

Unified Diff: components/autofill/browser/autofill_manager.cc

Issue 16286020: Abstract WebContentsObserver from Autofill shared code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Nits Created 7 years, 6 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
Index: components/autofill/browser/autofill_manager.cc
diff --git a/components/autofill/browser/autofill_manager.cc b/components/autofill/browser/autofill_manager.cc
index 35b703c59e24d9735bef6341499e06ab1d54e0a4..f1a350fb849cf5b56a5e5f2094e2dfc0c8986e2f 100644
--- a/components/autofill/browser/autofill_manager.cc
+++ b/components/autofill/browser/autofill_manager.cc
@@ -50,6 +50,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
+#include "content/public/common/frame_navigate_params.h"
#include "content/public/common/url_constants.h"
#include "googleurl/src/gurl.h"
#include "grit/component_resources.h"
@@ -205,7 +206,7 @@ AutofillManager::AutofillManager(
autofill::AutofillManagerDelegate* delegate,
const std::string& app_locale,
AutofillDownloadManagerState enable_download_manager)
- : content::WebContentsObserver(web_contents),
+ : web_contents_(web_contents),
manager_delegate_(delegate),
app_locale_(app_locale),
personal_data_(delegate->GetPersonalDataManager()),
@@ -311,6 +312,8 @@ bool AutofillManager::OnMessageReceived(const IPC::Message& message) {
OnClickFailed)
IPC_MESSAGE_HANDLER(AutofillHostMsg_MaybeShowAutocheckoutBubble,
OnMaybeShowAutocheckoutBubble)
+ IPC_MESSAGE_HANDLER(AutofillHostMsg_RemoveAutocompleteEntry,
+ RemoveAutocompleteEntry)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -325,7 +328,7 @@ bool AutofillManager::OnFormSubmitted(const FormData& form,
if (!IsAutofillEnabled())
return false;
- if (web_contents()->GetBrowserContext()->IsOffTheRecord())
+ if (web_contents_->GetBrowserContext()->IsOffTheRecord())
return false;
// Don't save data that was submitted through JavaScript.
@@ -404,7 +407,7 @@ void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms,
if (is_post_document_load)
Reset();
- RenderViewHost* host = web_contents()->GetRenderViewHost();
+ RenderViewHost* host = web_contents_->GetRenderViewHost();
if (!host)
return;
@@ -712,7 +715,7 @@ void AutofillManager::RemoveAutocompleteEntry(const base::string16& name,
}
content::WebContents* AutofillManager::GetWebContents() const {
- return web_contents();
+ return web_contents_;
}
const std::vector<FormStructure*>& AutofillManager::GetFormStructures() {
@@ -784,12 +787,12 @@ void AutofillManager::OnRequestAutocomplete(
void AutofillManager::ReturnAutocompleteResult(
WebFormElement::AutocompleteResult result, const FormData& form_data) {
- // web_contents() will be NULL when the interactive autocomplete is closed due
+ // web_contents_ will be NULL when the interactive autocomplete is closed due
blundell 2013/06/04 17:30:48 Hmm, I missed this comment. I had thought that rep
Evan Stade 2013/06/04 18:06:36 so I guess you need to pipe through destruction no
blundell 2013/06/11 15:35:47 Added in an interface whereby the shared code can
// to a tab or browser window closing.
- if (!web_contents())
+ if (!web_contents_)
return;
- RenderViewHost* host = web_contents()->GetRenderViewHost();
+ RenderViewHost* host = web_contents_->GetRenderViewHost();
if (!host)
return;
@@ -822,7 +825,7 @@ void AutofillManager::OnLoadedServerPredictions(
*metric_logger_);
if (page_meta_data->IsInAutofillableFlow()) {
- RenderViewHost* host = web_contents()->GetRenderViewHost();
+ RenderViewHost* host = web_contents_->GetRenderViewHost();
if (host)
host->Send(new AutofillMsg_AutocheckoutSupported(host->GetRoutingID()));
}
@@ -861,13 +864,13 @@ void AutofillManager::OnMaybeShowAutocheckoutBubble(
}
std::string AutofillManager::GetAutocheckoutURLPrefix() const {
- if (!web_contents())
+ if (!web_contents_)
return std::string();
autofill::autocheckout::WhitelistManager* whitelist_manager =
manager_delegate_->GetAutocheckoutWhitelistManager();
- return whitelist_manager->GetMatchedURLPrefix(web_contents()->GetURL());
+ return whitelist_manager->GetMatchedURLPrefix(web_contents_->GetURL());
}
bool AutofillManager::IsAutofillEnabled() const {
@@ -880,7 +883,7 @@ void AutofillManager::SendAutofillTypePredictions(
switches::kShowAutofillTypePredictions))
return;
- RenderViewHost* host = web_contents()->GetRenderViewHost();
+ RenderViewHost* host = web_contents_->GetRenderViewHost();
if (!host)
return;
@@ -965,7 +968,7 @@ void AutofillManager::Reset() {
AutofillManager::AutofillManager(content::WebContents* web_contents,
autofill::AutofillManagerDelegate* delegate,
PersonalDataManager* personal_data)
- : content::WebContentsObserver(web_contents),
+ : web_contents_(web_contents),
manager_delegate_(delegate),
app_locale_("en-US"),
personal_data_(personal_data),
@@ -999,7 +1002,7 @@ bool AutofillManager::GetHost(RenderViewHost** host) const {
return false;
}
- *host = web_contents()->GetRenderViewHost();
+ *host = web_contents_->GetRenderViewHost();
if (!*host)
return false;

Powered by Google App Engine
This is Rietveld 408576698