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

Side by Side Diff: chrome/browser/automation/automation_provider_observers.h

Issue 6646051: Fix DCHECK, memory leak, and refactor PasswordStore to use CancelableRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include password_store_consumer.h in mac/win unittests. Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "base/scoped_ptr.h" 16 #include "base/scoped_ptr.h"
17 #include "base/weak_ptr.h" 17 #include "base/weak_ptr.h"
18 #include "chrome/browser/automation/automation_provider_json.h" 18 #include "chrome/browser/automation/automation_provider_json.h"
19 #include "chrome/browser/bookmarks/bookmark_model_observer.h" 19 #include "chrome/browser/bookmarks/bookmark_model_observer.h"
20 #include "chrome/browser/browsing_data_remover.h" 20 #include "chrome/browser/browsing_data_remover.h"
21 #if defined(OS_CHROMEOS) 21 #if defined(OS_CHROMEOS)
22 #include "chrome/browser/chromeos/cros/network_library.h" 22 #include "chrome/browser/chromeos/cros/network_library.h"
23 #endif // defined(OS_CHROMEOS) 23 #endif // defined(OS_CHROMEOS)
24 #include "chrome/browser/download/download_item.h" 24 #include "chrome/browser/download/download_item.h"
25 #include "chrome/browser/download/download_manager.h" 25 #include "chrome/browser/download/download_manager.h"
26 #include "chrome/browser/history/history.h" 26 #include "chrome/browser/history/history.h"
27 #include "chrome/browser/history/history_types.h" 27 #include "chrome/browser/history/history_types.h"
28 #include "chrome/browser/importer/importer_data_types.h" 28 #include "chrome/browser/importer/importer_data_types.h"
29 #include "chrome/browser/importer/importer_progress_observer.h" 29 #include "chrome/browser/importer/importer_progress_observer.h"
30 #include "chrome/browser/password_manager/password_store.h" 30 #include "chrome/browser/password_manager/password_store_consumer.h"
31 #include "chrome/browser/search_engines/template_url_model_observer.h" 31 #include "chrome/browser/search_engines/template_url_model_observer.h"
32 #include "chrome/browser/tabs/tab_strip_model.h" 32 #include "chrome/browser/tabs/tab_strip_model.h"
33 #include "chrome/common/automation_constants.h" 33 #include "chrome/common/automation_constants.h"
34 #include "content/browser/cancelable_request.h" 34 #include "content/browser/cancelable_request.h"
35 #include "content/common/notification_observer.h" 35 #include "content/common/notification_observer.h"
36 #include "content/common/notification_registrar.h" 36 #include "content/common/notification_registrar.h"
37 #include "content/common/notification_type.h" 37 #include "content/common/notification_type.h"
38 #include "ui/gfx/size.h" 38 #include "ui/gfx/size.h"
39 39
40 class AutocompleteEditModel; 40 class AutocompleteEditModel;
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE; 860 virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE;
861 virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE; 861 virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE;
862 virtual void ImportEnded() OVERRIDE; 862 virtual void ImportEnded() OVERRIDE;
863 863
864 private: 864 private:
865 base::WeakPtr<AutomationProvider> provider_; 865 base::WeakPtr<AutomationProvider> provider_;
866 scoped_ptr<IPC::Message> reply_message_; 866 scoped_ptr<IPC::Message> reply_message_;
867 }; 867 };
868 868
869 // Allows automation provider to wait for getting passwords to finish. 869 // Allows automation provider to wait for getting passwords to finish.
870 class AutomationProviderGetPasswordsObserver 870 class AutomationProviderGetPasswordsObserver : public PasswordStoreConsumer {
871 : public PasswordStoreConsumer {
872 public: 871 public:
873 AutomationProviderGetPasswordsObserver( 872 AutomationProviderGetPasswordsObserver(
874 AutomationProvider* provider, 873 AutomationProvider* provider,
875 IPC::Message* reply_message); 874 IPC::Message* reply_message);
876 virtual ~AutomationProviderGetPasswordsObserver(); 875 virtual ~AutomationProviderGetPasswordsObserver();
877 876
878 virtual void OnPasswordStoreRequestDone( 877 virtual void OnPasswordStoreRequestDone(
879 int handle, const std::vector<webkit_glue::PasswordForm*>& result); 878 CancelableRequestProvider::Handle handle,
879 const std::vector<webkit_glue::PasswordForm*>& result);
880 880
881 private: 881 private:
882 base::WeakPtr<AutomationProvider> provider_; 882 base::WeakPtr<AutomationProvider> provider_;
883 scoped_ptr<IPC::Message> reply_message_; 883 scoped_ptr<IPC::Message> reply_message_;
884 }; 884 };
885 885
886 // Allows the automation provider to wait for clearing browser data to finish. 886 // Allows the automation provider to wait for clearing browser data to finish.
887 class AutomationProviderBrowsingDataObserver 887 class AutomationProviderBrowsingDataObserver
888 : public BrowsingDataRemover::Observer { 888 : public BrowsingDataRemover::Observer {
889 public: 889 public:
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 // Sends the |reply_message_| to |automation_| indicating we're done. 1177 // Sends the |reply_message_| to |automation_| indicating we're done.
1178 void RunOnUIThread(); 1178 void RunOnUIThread();
1179 1179
1180 base::WeakPtr<AutomationProvider> automation_; 1180 base::WeakPtr<AutomationProvider> automation_;
1181 scoped_ptr<IPC::Message> reply_message_; 1181 scoped_ptr<IPC::Message> reply_message_;
1182 1182
1183 DISALLOW_COPY_AND_ASSIGN(WaitForProcessLauncherThreadToGoIdleObserver); 1183 DISALLOW_COPY_AND_ASSIGN(WaitForProcessLauncherThreadToGoIdleObserver);
1184 }; 1184 };
1185 1185
1186 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 1186 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698