| OLD | NEW |
| 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/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/message_loop_helpers.h" |
| 19 #include "base/synchronization/waitable_event.h" | 20 #include "base/synchronization/waitable_event.h" |
| 20 #include "base/values.h" | 21 #include "base/values.h" |
| 21 #include "chrome/browser/autofill/personal_data_manager.h" | 22 #include "chrome/browser/autofill/personal_data_manager.h" |
| 22 #include "chrome/browser/autofill/personal_data_manager_observer.h" | 23 #include "chrome/browser/autofill/personal_data_manager_observer.h" |
| 23 #include "chrome/browser/automation/automation_provider_json.h" | 24 #include "chrome/browser/automation/automation_provider_json.h" |
| 24 #include "chrome/browser/automation/automation_tab_helper.h" | 25 #include "chrome/browser/automation/automation_tab_helper.h" |
| 25 #include "chrome/browser/bookmarks/bookmark_model_observer.h" | 26 #include "chrome/browser/bookmarks/bookmark_model_observer.h" |
| 26 #include "chrome/browser/browsing_data_remover.h" | 27 #include "chrome/browser/browsing_data_remover.h" |
| 27 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
| 28 #include "chrome/browser/chromeos/cros/network_library.h" | 29 #include "chrome/browser/chromeos/cros/network_library.h" |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 virtual void Init(); | 1248 virtual void Init(); |
| 1248 | 1249 |
| 1249 // content::NotificationObserver interface. | 1250 // content::NotificationObserver interface. |
| 1250 virtual void Observe(int type, | 1251 virtual void Observe(int type, |
| 1251 const content::NotificationSource& source, | 1252 const content::NotificationSource& source, |
| 1252 const content::NotificationDetails& details); | 1253 const content::NotificationDetails& details); |
| 1253 | 1254 |
| 1254 private: | 1255 private: |
| 1255 friend struct content::BrowserThread::DeleteOnThread< | 1256 friend struct content::BrowserThread::DeleteOnThread< |
| 1256 content::BrowserThread::UI>; | 1257 content::BrowserThread::UI>; |
| 1257 friend class DeleteTask<PasswordStoreLoginsChangedObserver>; | 1258 friend class base::DeleteHelper<PasswordStoreLoginsChangedObserver>; |
| 1258 | 1259 |
| 1259 // Registers the appropriate observers. Called on the DB thread. | 1260 // Registers the appropriate observers. Called on the DB thread. |
| 1260 void RegisterObserversTask(); | 1261 void RegisterObserversTask(); |
| 1261 | 1262 |
| 1262 // Sends the |reply_message_| to |automation_| indicating we're done. Called | 1263 // Sends the |reply_message_| to |automation_| indicating we're done. Called |
| 1263 // on the UI thread. | 1264 // on the UI thread. |
| 1264 void IndicateDone(); | 1265 void IndicateDone(); |
| 1265 | 1266 |
| 1266 // Sends an error reply to |automation_|. Called on the UI thread. | 1267 // Sends an error reply to |automation_|. Called on the UI thread. |
| 1267 void IndicateError(const std::string& error); | 1268 void IndicateError(const std::string& error); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 virtual void Init(); | 1472 virtual void Init(); |
| 1472 | 1473 |
| 1473 // content::NotificationObserver interface. | 1474 // content::NotificationObserver interface. |
| 1474 virtual void Observe(int type, | 1475 virtual void Observe(int type, |
| 1475 const content::NotificationSource& source, | 1476 const content::NotificationSource& source, |
| 1476 const content::NotificationDetails& details); | 1477 const content::NotificationDetails& details); |
| 1477 | 1478 |
| 1478 private: | 1479 private: |
| 1479 friend struct content::BrowserThread::DeleteOnThread< | 1480 friend struct content::BrowserThread::DeleteOnThread< |
| 1480 content::BrowserThread::UI>; | 1481 content::BrowserThread::UI>; |
| 1481 friend class DeleteTask<AutofillChangedObserver>; | 1482 friend class base::DeleteHelper<AutofillChangedObserver>; |
| 1482 | 1483 |
| 1483 // Registers the appropriate observers. Called on the DB thread. | 1484 // Registers the appropriate observers. Called on the DB thread. |
| 1484 void RegisterObserversTask(); | 1485 void RegisterObserversTask(); |
| 1485 | 1486 |
| 1486 // Sends the |reply_message_| to |automation_| indicating we're done. Called | 1487 // Sends the |reply_message_| to |automation_| indicating we're done. Called |
| 1487 // on the UI thread. | 1488 // on the UI thread. |
| 1488 void IndicateDone(); | 1489 void IndicateDone(); |
| 1489 | 1490 |
| 1490 base::WeakPtr<AutomationProvider> automation_; | 1491 base::WeakPtr<AutomationProvider> automation_; |
| 1491 scoped_ptr<IPC::Message> reply_message_; | 1492 scoped_ptr<IPC::Message> reply_message_; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 : public base::RefCountedThreadSafe< | 1713 : public base::RefCountedThreadSafe< |
| 1713 WaitForProcessLauncherThreadToGoIdleObserver, | 1714 WaitForProcessLauncherThreadToGoIdleObserver, |
| 1714 content::BrowserThread::DeleteOnUIThread> { | 1715 content::BrowserThread::DeleteOnUIThread> { |
| 1715 public: | 1716 public: |
| 1716 WaitForProcessLauncherThreadToGoIdleObserver( | 1717 WaitForProcessLauncherThreadToGoIdleObserver( |
| 1717 AutomationProvider* automation, IPC::Message* reply_message); | 1718 AutomationProvider* automation, IPC::Message* reply_message); |
| 1718 | 1719 |
| 1719 private: | 1720 private: |
| 1720 friend struct content::BrowserThread::DeleteOnThread< | 1721 friend struct content::BrowserThread::DeleteOnThread< |
| 1721 content::BrowserThread::UI>; | 1722 content::BrowserThread::UI>; |
| 1722 friend class DeleteTask<WaitForProcessLauncherThreadToGoIdleObserver>; | 1723 friend class base::DeleteHelper<WaitForProcessLauncherThreadToGoIdleObserver>; |
| 1723 | 1724 |
| 1724 virtual ~WaitForProcessLauncherThreadToGoIdleObserver(); | 1725 virtual ~WaitForProcessLauncherThreadToGoIdleObserver(); |
| 1725 | 1726 |
| 1726 // Schedules a task on the PROCESS_LAUNCHER thread to execute | 1727 // Schedules a task on the PROCESS_LAUNCHER thread to execute |
| 1727 // |RunOnProcessLauncherThread2|. By the time the task is executed the | 1728 // |RunOnProcessLauncherThread2|. By the time the task is executed the |
| 1728 // PROCESS_LAUNCHER thread should be some what idle. | 1729 // PROCESS_LAUNCHER thread should be some what idle. |
| 1729 void RunOnProcessLauncherThread(); | 1730 void RunOnProcessLauncherThread(); |
| 1730 | 1731 |
| 1731 // When executed the PROCESS_LAUNCHER thread should have processed any pending | 1732 // When executed the PROCESS_LAUNCHER thread should have processed any pending |
| 1732 // tasks. Schedules a task on the UI thread that sends the message saying | 1733 // tasks. Schedules a task on the UI thread that sends the message saying |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1863 private: | 1864 private: |
| 1864 base::WeakPtr<AutomationProvider> automation_; | 1865 base::WeakPtr<AutomationProvider> automation_; |
| 1865 scoped_ptr<IPC::Message> reply_message_; | 1866 scoped_ptr<IPC::Message> reply_message_; |
| 1866 std::string extension_id_; | 1867 std::string extension_id_; |
| 1867 content::NotificationRegistrar registrar_; | 1868 content::NotificationRegistrar registrar_; |
| 1868 | 1869 |
| 1869 DISALLOW_COPY_AND_ASSIGN(ExtensionPopupObserver); | 1870 DISALLOW_COPY_AND_ASSIGN(ExtensionPopupObserver); |
| 1870 }; | 1871 }; |
| 1871 | 1872 |
| 1872 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 1873 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
| OLD | NEW |