diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser.scons | 6 | ||||
-rw-r--r-- | chrome/browser/browser.vcproj | 8 | ||||
-rw-r--r-- | chrome/browser/cert_store.cc | 1 | ||||
-rw-r--r-- | chrome/browser/password_manager/password_form_manager.cc | 78 | ||||
-rw-r--r-- | chrome/browser/password_manager/password_form_manager_win.cc | 77 | ||||
-rw-r--r-- | chrome/browser/tab_contents/interstitial_page.cc | 6 | ||||
-rw-r--r-- | chrome/browser/tab_contents/interstitial_page.h | 6 | ||||
-rw-r--r-- | chrome/browser/tab_contents/ipc_status_view.cc | 1 | ||||
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/infobars/infobars.cc | 1 | ||||
-rw-r--r-- | chrome/browser/webdata/web_data_service.cc | 69 | ||||
-rw-r--r-- | chrome/browser/webdata/web_data_service.h | 38 | ||||
-rw-r--r-- | chrome/browser/webdata/web_data_service_win.cc | 65 |
13 files changed, 192 insertions, 166 deletions
diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons index cd01283..9728dcb 100644 --- a/chrome/browser/browser.scons +++ b/chrome/browser/browser.scons @@ -732,7 +732,6 @@ if not env.Bit('windows'): 'download/save_page_model.cc', 'drag_utils.cc', 'encoding_menu_controller_delegate.cc', - 'extensions/extension_protocols.cc', 'external_protocol_handler.cc', 'external_tab_container.cc', 'fav_icon_helper.cc', @@ -765,7 +764,6 @@ if not env.Bit('windows'): 'google_update.cc', 'password_manager/encryptor.cc', 'password_manager/ie7_password.cc', - 'password_manager/password_form_manager.cc', 'password_manager/password_manager.cc', 'plugin_installer.cc', 'plugin_process_host.cc', @@ -797,7 +795,6 @@ if not env.Bit('windows'): 'rlz/rlz.cc', 'safe_browsing/protocol_manager.cc', 'safe_browsing/safe_browsing_blocking_page.cc', - 'safe_browsing/safe_browsing_service.cc', 'sandbox_policy.cc', 'search_engines/template_url_fetcher.cc', 'search_engines/template_url_prepopulate_data.cc', @@ -840,15 +837,16 @@ if not env.Bit('windows'): 'web_app.cc', 'web_app_icon_manager.cc', 'web_app_launcher.cc', - 'webdata/web_data_service.cc', 'window_sizer.cc', ) input_files.Remove( 'browser_main_win.cc', 'importer/firefox_profile_lock_win.cc', + 'password_manager/password_form_manager_win.cc', 'render_widget_host_view_win.cc', 'tab_contents/web_contents_view_win.cc', + 'webdata/web_data_service_win.cc', 'webdata/web_database_win.cc', '../tools/build/win/precompiled_wtl.cc', '../tools/build/win/precompiled_wtl.h', diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj index 583d4b4..50c22c2 100644 --- a/chrome/browser/browser.vcproj +++ b/chrome/browser/browser.vcproj @@ -1286,6 +1286,10 @@ > </File> <File + RelativePath=".\webdata\web_data_service_win.cc" + > + </File> + <File RelativePath=".\webdata\web_database.cc" > </File> @@ -1580,6 +1584,10 @@ > </File> <File + RelativePath=".\password_manager\password_form_manager_win.cc" + > + </File> + <File RelativePath=".\password_manager\password_form_manager.h" > </File> diff --git a/chrome/browser/cert_store.cc b/chrome/browser/cert_store.cc index 035fc66..4dc32ee 100644 --- a/chrome/browser/cert_store.cc +++ b/chrome/browser/cert_store.cc @@ -7,6 +7,7 @@ #include <algorithm> #include <functional> +#include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/render_view_host.h" #include "chrome/browser/tab_contents/web_contents.h" #include "chrome/common/stl_util-inl.h" diff --git a/chrome/browser/password_manager/password_form_manager.cc b/chrome/browser/password_manager/password_form_manager.cc index 757dc63..6680bac 100644 --- a/chrome/browser/password_manager/password_form_manager.cc +++ b/chrome/browser/password_manager/password_form_manager.cc @@ -7,7 +7,6 @@ #include <algorithm> #include "base/string_util.h" -#include "chrome/browser/password_manager/ie7_password.h" #include "chrome/browser/password_manager/password_manager.h" #include "chrome/browser/profile.h" #include "webkit/glue/password_form_dom_manager.h" @@ -18,14 +17,14 @@ PasswordFormManager::PasswordFormManager(Profile* profile, PasswordManager* password_manager, const PasswordForm& observed_form, bool ssl_valid) - : observed_form_(observed_form), - password_manager_(password_manager), - profile_(profile), + : best_matches_deleter_(&best_matches_), + observed_form_(observed_form), is_new_login_(true), + password_manager_(password_manager), pending_login_query_(NULL), preferred_match_(NULL), - best_matches_deleter_(&best_matches_), - state_(PRE_MATCHING_PHASE) { + state_(PRE_MATCHING_PHASE), + profile_(profile) { DCHECK(profile_); if (observed_form_.origin.is_valid()) SplitString(observed_form_.origin.path(), '/', &form_path_tokens_); @@ -178,23 +177,6 @@ void PasswordFormManager::FetchMatchingLoginsFromWebDatabase() { pending_login_query_ = web_data_service->GetLogins(observed_form_, this); } -void PasswordFormManager::FetchMatchingIE7LoginFromWebDatabase() { - DCHECK_EQ(state_, PRE_MATCHING_PHASE); - DCHECK(!pending_login_query_); - state_ = MATCHING_PHASE; - WebDataService* web_data_service = - profile_->GetWebDataService(Profile::EXPLICIT_ACCESS); - if (!web_data_service) { - NOTREACHED(); - return; - } - - IE7PasswordInfo info; - std::wstring url = ASCIIToWide(observed_form_.origin.spec()); - info.url_hash = ie7_password::GetUrlHash(url); - pending_login_query_ = web_data_service->GetIE7Login(info, this); -} - bool PasswordFormManager::HasCompletedMatching() { return state_ == POST_MATCHING_PHASE; } @@ -288,56 +270,6 @@ void PasswordFormManager::OnRequestDone(WebDataService::Handle h, } } -void PasswordFormManager::OnIE7RequestDone(WebDataService::Handle h, - const WDTypedResult* result) { - // Get the result from the database into a usable form. - const WDResult<IE7PasswordInfo>* r = - static_cast<const WDResult<IE7PasswordInfo>*>(result); - IE7PasswordInfo result_value = r->GetValue(); - - state_ = POST_MATCHING_PHASE; - - if (!result_value.encrypted_data.empty()) { - // We got a result. - // Delete the entry. If it's good we will add it to the real saved password - // table. - WebDataService* web_data_service = - profile_->GetWebDataService(Profile::EXPLICIT_ACCESS); - if (!web_data_service) { - NOTREACHED(); - return; - } - web_data_service->RemoveIE7Login(result_value); - - std::wstring username; - std::wstring password; - std::wstring url = ASCIIToWide(observed_form_.origin.spec()); - if (!ie7_password::DecryptPassword(url, result_value.encrypted_data, - &username, &password)) { - return; - } - - PasswordForm* auto_fill = new PasswordForm(observed_form_); - auto_fill->username_value = username; - auto_fill->password_value = password; - auto_fill->preferred = true; - auto_fill->ssl_valid = observed_form_.origin.SchemeIsSecure(); - auto_fill->date_created = result_value.date_created; - // Add this PasswordForm to the saved password table. - web_data_service->AddLogin(*auto_fill); - - if (IgnoreResult(*auto_fill)) { - delete auto_fill; - return; - } - - best_matches_[auto_fill->username_value] = auto_fill; - preferred_match_ = auto_fill; - password_manager_->Autofill(observed_form_, best_matches_, - preferred_match_); - } -} - void PasswordFormManager::OnWebDataServiceRequestDone(WebDataService::Handle h, const WDTypedResult* result) { DCHECK_EQ(state_, MATCHING_PHASE); diff --git a/chrome/browser/password_manager/password_form_manager_win.cc b/chrome/browser/password_manager/password_form_manager_win.cc new file mode 100644 index 0000000..a075617 --- /dev/null +++ b/chrome/browser/password_manager/password_form_manager_win.cc @@ -0,0 +1,77 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/password_manager/password_form_manager.h" + +#include "base/string_util.h" +#include "chrome/browser/password_manager/ie7_password.h" +#include "chrome/browser/password_manager/password_manager.h" +#include "chrome/browser/profile.h" + +void PasswordFormManager::FetchMatchingIE7LoginFromWebDatabase() { + DCHECK_EQ(state_, PRE_MATCHING_PHASE); + DCHECK(!pending_login_query_); + state_ = MATCHING_PHASE; + WebDataService* web_data_service = + profile_->GetWebDataService(Profile::EXPLICIT_ACCESS); + if (!web_data_service) { + NOTREACHED(); + return; + } + + IE7PasswordInfo info; + std::wstring url = ASCIIToWide(observed_form_.origin.spec()); + info.url_hash = ie7_password::GetUrlHash(url); + pending_login_query_ = web_data_service->GetIE7Login(info, this); +} + +void PasswordFormManager::OnIE7RequestDone(WebDataService::Handle h, + const WDTypedResult* result) { + // Get the result from the database into a usable form. + const WDResult<IE7PasswordInfo>* r = + static_cast<const WDResult<IE7PasswordInfo>*>(result); + IE7PasswordInfo result_value = r->GetValue(); + + state_ = POST_MATCHING_PHASE; + + if (!result_value.encrypted_data.empty()) { + // We got a result. + // Delete the entry. If it's good we will add it to the real saved password + // table. + WebDataService* web_data_service = + profile_->GetWebDataService(Profile::EXPLICIT_ACCESS); + if (!web_data_service) { + NOTREACHED(); + return; + } + web_data_service->RemoveIE7Login(result_value); + + std::wstring username; + std::wstring password; + std::wstring url = ASCIIToWide(observed_form_.origin.spec()); + if (!ie7_password::DecryptPassword(url, result_value.encrypted_data, + &username, &password)) { + return; + } + + PasswordForm* auto_fill = new PasswordForm(observed_form_); + auto_fill->username_value = username; + auto_fill->password_value = password; + auto_fill->preferred = true; + auto_fill->ssl_valid = observed_form_.origin.SchemeIsSecure(); + auto_fill->date_created = result_value.date_created; + // Add this PasswordForm to the saved password table. + web_data_service->AddLogin(*auto_fill); + + if (IgnoreResult(*auto_fill)) { + delete auto_fill; + return; + } + + best_matches_[auto_fill->username_value] = auto_fill; + preferred_match_ = auto_fill; + password_manager_->Autofill(observed_form_, best_matches_, + preferred_match_); + } +} diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index ca0f226..491b1cc 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -17,12 +17,6 @@ #include "chrome/views/window_delegate.h" #include "net/base/escape.h" -enum ResourceRequestAction { - BLOCK, - RESUME, - CANCEL -}; - namespace { class ResourceRequestTask : public Task { diff --git a/chrome/browser/tab_contents/interstitial_page.h b/chrome/browser/tab_contents/interstitial_page.h index e740fea..9a68f95 100644 --- a/chrome/browser/tab_contents/interstitial_page.h +++ b/chrome/browser/tab_contents/interstitial_page.h @@ -26,7 +26,11 @@ class WebContents; // through a navigation, the WebContents closing them or the tab containing them // being closed. -enum ResourceRequestAction; +enum ResourceRequestAction { + BLOCK, + RESUME, + CANCEL +}; class InterstitialPage : public NotificationObserver, public RenderViewHostDelegate { diff --git a/chrome/browser/tab_contents/ipc_status_view.cc b/chrome/browser/tab_contents/ipc_status_view.cc index 1385898..cd85ee0 100644 --- a/chrome/browser/tab_contents/ipc_status_view.cc +++ b/chrome/browser/tab_contents/ipc_status_view.cc @@ -9,6 +9,7 @@ #include "base/logging.h" #include "base/string_util.h" #include "chrome/app/chrome_dll_resource.h" +#include "chrome/browser/profile.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/ipc_logging.h" #include "chrome/common/plugin_messages.h" diff --git a/chrome/browser/tab_contents/navigation_controller.h b/chrome/browser/tab_contents/navigation_controller.h index 14cf5b0..ab76e7a 100644 --- a/chrome/browser/tab_contents/navigation_controller.h +++ b/chrome/browser/tab_contents/navigation_controller.h @@ -11,13 +11,13 @@ #include "base/ref_counted.h" #include "chrome/browser/sessions/session_id.h" #include "chrome/browser/ssl/ssl_manager.h" -#include "chrome/browser/tab_contents/site_instance.h" #include "chrome/browser/tab_contents/tab_contents_type.h" #include "chrome/common/navigation_types.h" class GURL; class Profile; class TabContents; +class SiteInstance; class WebContents; class TabContentsCollector; class TabNavigation; diff --git a/chrome/browser/views/infobars/infobars.cc b/chrome/browser/views/infobars/infobars.cc index 475b7ea..bee39af 100644 --- a/chrome/browser/views/infobars/infobars.cc +++ b/chrome/browser/views/infobars/infobars.cc @@ -4,6 +4,7 @@ #include "chrome/browser/views/infobars/infobars.h" +#include "base/message_loop.h" #include "chrome/app/theme/theme_resources.h" #include "chrome/browser/views/event_utils.h" #include "chrome/browser/views/infobars/infobar_container.h" diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc index a3f8e55..ced5a6f 100644 --- a/chrome/browser/webdata/web_data_service.cc +++ b/chrome/browser/webdata/web_data_service.cc @@ -2,14 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <windows.h> - #include "chrome/browser/webdata/web_data_service.h" #include "base/file_util.h" #include "base/path_service.h" #include "base/scoped_ptr.h" -#include "chrome/browser/password_manager/ie7_password.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/common/chrome_constants.h" #include "webkit/glue/password_form.h" @@ -23,10 +20,10 @@ using base::Time; -WebDataService::WebDataService() : should_commit_(false), - next_request_handle_(1), - thread_(NULL), - db_(NULL) { +WebDataService::WebDataService() : thread_(NULL), + db_(NULL), + should_commit_(false), + next_request_handle_(1) { } WebDataService::~WebDataService() { @@ -289,15 +286,6 @@ void WebDataService::AddLogin(const PasswordForm& form) { request)); } -void WebDataService::AddIE7Login(const IE7PasswordInfo& info) { - GenericRequest<IE7PasswordInfo>* request = - new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(), NULL, - info); - RegisterRequest(request); - ScheduleTask(NewRunnableMethod(this, &WebDataService::AddIE7LoginImpl, - request)); -} - void WebDataService::UpdateLogin(const PasswordForm& form) { GenericRequest<PasswordForm>* request = new GenericRequest<PasswordForm>(this, GetNextRequestHandle(), @@ -316,15 +304,6 @@ void WebDataService::RemoveLogin(const PasswordForm& form) { request)); } -void WebDataService::RemoveIE7Login(const IE7PasswordInfo& info) { - GenericRequest<IE7PasswordInfo>* request = - new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(), NULL, - info); - RegisterRequest(request); - ScheduleTask(NewRunnableMethod(this, &WebDataService::RemoveIE7LoginImpl, - request)); -} - void WebDataService::RemoveLoginsCreatedBetween(const Time delete_begin, const Time delete_end) { GenericRequest2<Time, Time>* request = @@ -367,18 +346,6 @@ WebDataService::Handle WebDataService::GetLogins( return request->GetHandle(); } -WebDataService::Handle WebDataService::GetIE7Login( - const IE7PasswordInfo& info, - WebDataServiceConsumer* consumer) { - GenericRequest<IE7PasswordInfo>* request = - new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(), - consumer, info); - RegisterRequest(request); - ScheduleTask(NewRunnableMethod(this, &WebDataService::GetIE7LoginImpl, - request)); - return request->GetHandle(); -} - WebDataService::Handle WebDataService::GetAllAutofillableLogins( WebDataServiceConsumer* consumer) { WebDataRequest* request = @@ -517,14 +484,6 @@ void WebDataService::AddLoginImpl(GenericRequest<PasswordForm>* request) { request->RequestComplete(); } -void WebDataService::AddIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request) { - if (db_ && !request->IsCancelled()) { - if (db_->AddIE7Login(request->GetArgument())) - ScheduleCommit(); - } - request->RequestComplete(); -} - void WebDataService::UpdateLoginImpl(GenericRequest<PasswordForm>* request) { if (db_ && !request->IsCancelled()) { if (db_->UpdateLogin(request->GetArgument())) @@ -541,15 +500,6 @@ void WebDataService::RemoveLoginImpl(GenericRequest<PasswordForm>* request) { request->RequestComplete(); } -void WebDataService::RemoveIE7LoginImpl( - GenericRequest<IE7PasswordInfo>* request) { - if (db_ && !request->IsCancelled()) { - if (db_->RemoveIE7Login(request->GetArgument())) - ScheduleCommit(); - } - request->RequestComplete(); -} - void WebDataService::RemoveLoginsCreatedBetweenImpl( GenericRequest2<Time, Time>* request) { if (db_ && !request->IsCancelled()) { @@ -570,17 +520,6 @@ void WebDataService::GetLoginsImpl(GenericRequest<PasswordForm>* request) { request->RequestComplete(); } -void WebDataService::GetIE7LoginImpl( - GenericRequest<IE7PasswordInfo>* request) { - if (db_ && !request->IsCancelled()) { - IE7PasswordInfo result; - db_->GetIE7Login(request->GetArgument(), &result); - request->SetResult( - new WDResult<IE7PasswordInfo>(PASSWORD_IE7_RESULT, result)); - } - request->RequestComplete(); -} - void WebDataService::GetAllAutofillableLoginsImpl(WebDataRequest* request) { if (db_ && !request->IsCancelled()) { std::vector<PasswordForm*> forms; diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h index 053644b..4e2786b 100644 --- a/chrome/browser/webdata/web_data_service.h +++ b/chrome/browser/webdata/web_data_service.h @@ -16,7 +16,9 @@ #include "chrome/common/scoped_vector.h" #include "webkit/glue/autofill_form.h" +#if defined(OS_WIN) struct IE7PasswordInfo; +#endif struct PasswordForm; class GURL; class ShutdownTask; @@ -307,15 +309,9 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> { // Adds |form| to the list of remembered password forms. void AddLogin(const PasswordForm& form); - // Adds |info| to the list of imported passwords from ie7/ie8. - void AddIE7Login(const IE7PasswordInfo& info); - // Removes |form| from the list of remembered password forms. void RemoveLogin(const PasswordForm& form); - // Removes |info| from the list of imported passwords from ie7/ie8. - void RemoveIE7Login(const IE7PasswordInfo& info); - // Removes all logins created in the specified daterange void RemoveLoginsCreatedBetween(const base::Time delete_begin, const base::Time delete_end); @@ -329,13 +325,6 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> { // The result will be null on failure. The |consumer| owns all PasswordForm's. Handle GetLogins(const PasswordForm& form, WebDataServiceConsumer* consumer); - // Get the login matching the information in |info|. |consumer| will be - // notified when the request is done. The result is of type - // WDResult<IE7PasswordInfo>. - // If there is no match, the fields of the IE7PasswordInfo will be empty. - Handle GetIE7Login(const IE7PasswordInfo& info, - WebDataServiceConsumer* consumer); - // Gets the complete list of password forms that have not been blacklisted and // are thus auto-fillable. // |consumer| will be notified when the request is done. The result is of @@ -349,6 +338,21 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> { // The result will be null on failure. The |consumer| owns all PasswordForm's. Handle GetAllLogins(WebDataServiceConsumer* consumer); +#if defined(OS_WIN) + // Adds |info| to the list of imported passwords from ie7/ie8. + void AddIE7Login(const IE7PasswordInfo& info); + + // Removes |info| from the list of imported passwords from ie7/ie8. + void RemoveIE7Login(const IE7PasswordInfo& info); + + // Get the login matching the information in |info|. |consumer| will be + // notified when the request is done. The result is of type + // WDResult<IE7PasswordInfo>. + // If there is no match, the fields of the IE7PasswordInfo will be empty. + Handle GetIE7Login(const IE7PasswordInfo& info, + WebDataServiceConsumer* consumer); +#endif // defined(OS_WIN) + // Cancel any pending request. You need to call this method if your // WebDataServiceConsumer is about to be deleted. void CancelRequest(Handle h); @@ -429,16 +433,18 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> { // ////////////////////////////////////////////////////////////////////////////// void AddLoginImpl(GenericRequest<PasswordForm>* request); - void AddIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); void UpdateLoginImpl(GenericRequest<PasswordForm>* request); void RemoveLoginImpl(GenericRequest<PasswordForm>* request); - void RemoveIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); void RemoveLoginsCreatedBetweenImpl( GenericRequest2<base::Time, base::Time>* request); void GetLoginsImpl(GenericRequest<PasswordForm>* request); - void GetIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); void GetAllAutofillableLoginsImpl(WebDataRequest* request); void GetAllLoginsImpl(WebDataRequest* request); +#if defined(OS_WIN) + void AddIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); + void RemoveIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); + void GetIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); +#endif // defined(OS_WIN) ////////////////////////////////////////////////////////////////////////////// // diff --git a/chrome/browser/webdata/web_data_service_win.cc b/chrome/browser/webdata/web_data_service_win.cc new file mode 100644 index 0000000..7219b82 --- /dev/null +++ b/chrome/browser/webdata/web_data_service_win.cc @@ -0,0 +1,65 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/webdata/web_data_service.h" + +#include "chrome/browser/password_manager/ie7_password.h" + +void WebDataService::AddIE7Login(const IE7PasswordInfo& info) { + GenericRequest<IE7PasswordInfo>* request = + new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(), NULL, + info); + RegisterRequest(request); + ScheduleTask(NewRunnableMethod(this, &WebDataService::AddIE7LoginImpl, + request)); +} + +void WebDataService::RemoveIE7Login(const IE7PasswordInfo& info) { + GenericRequest<IE7PasswordInfo>* request = + new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(), NULL, + info); + RegisterRequest(request); + ScheduleTask(NewRunnableMethod(this, &WebDataService::RemoveIE7LoginImpl, + request)); +} + +WebDataService::Handle WebDataService::GetIE7Login( + const IE7PasswordInfo& info, + WebDataServiceConsumer* consumer) { + GenericRequest<IE7PasswordInfo>* request = + new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(), + consumer, info); + RegisterRequest(request); + ScheduleTask(NewRunnableMethod(this, &WebDataService::GetIE7LoginImpl, + request)); + return request->GetHandle(); +} + +void WebDataService::AddIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request) { + if (db_ && !request->IsCancelled()) { + if (db_->AddIE7Login(request->GetArgument())) + ScheduleCommit(); + } + request->RequestComplete(); +} + +void WebDataService::RemoveIE7LoginImpl( + GenericRequest<IE7PasswordInfo>* request) { + if (db_ && !request->IsCancelled()) { + if (db_->RemoveIE7Login(request->GetArgument())) + ScheduleCommit(); + } + request->RequestComplete(); +} + +void WebDataService::GetIE7LoginImpl( + GenericRequest<IE7PasswordInfo>* request) { + if (db_ && !request->IsCancelled()) { + IE7PasswordInfo result; + db_->GetIE7Login(request->GetArgument(), &result); + request->SetResult( + new WDResult<IE7PasswordInfo>(PASSWORD_IE7_RESULT, result)); + } + request->RequestComplete(); +} |