| 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 // This implements a browser-side endpoint for UI automation activity. | 5 // This implements a browser-side endpoint for UI automation activity. |
| 6 // The client-side endpoint is implemented by AutomationProxy. | 6 // The client-side endpoint is implemented by AutomationProxy. |
| 7 // The entire lifetime of this object should be contained within that of | 7 // The entire lifetime of this object should be contained within that of |
| 8 // the BrowserProcess, and in particular the NotificationService that's | 8 // the BrowserProcess, and in particular the NotificationService that's |
| 9 // hung off of it. | 9 // hung off of it. |
| 10 | 10 |
| 11 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ | 11 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ |
| 12 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ | 12 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ |
| 13 #pragma once | 13 #pragma once |
| 14 | 14 |
| 15 #include <list> | 15 #include <list> |
| 16 #include <map> | 16 #include <map> |
| 17 #include <string> | 17 #include <string> |
| 18 #include <vector> | 18 #include <vector> |
| 19 | 19 |
| 20 #include "base/basictypes.h" | 20 #include "base/basictypes.h" |
| 21 #include "base/compiler_specific.h" | 21 #include "base/compiler_specific.h" |
| 22 #include "base/memory/scoped_ptr.h" | 22 #include "base/memory/scoped_ptr.h" |
| 23 #include "base/memory/weak_ptr.h" | 23 #include "base/memory/weak_ptr.h" |
| 24 #include "base/message_loop_helpers.h" |
| 24 #include "base/observer_list.h" | 25 #include "base/observer_list.h" |
| 25 #include "base/string16.h" | 26 #include "base/string16.h" |
| 26 #include "chrome/browser/autofill/field_types.h" | 27 #include "chrome/browser/autofill/field_types.h" |
| 27 #include "chrome/browser/cancelable_request.h" | 28 #include "chrome/browser/cancelable_request.h" |
| 28 #include "chrome/common/automation_constants.h" | 29 #include "chrome/common/automation_constants.h" |
| 29 #include "chrome/common/content_settings.h" | 30 #include "chrome/common/content_settings.h" |
| 30 #include "content/browser/trace_controller.h" | 31 #include "content/browser/trace_controller.h" |
| 31 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
| 32 #include "content/public/browser/notification_observer.h" | 33 #include "content/public/browser/notification_observer.h" |
| 33 #include "ipc/ipc_channel.h" | 34 #include "ipc/ipc_channel.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 #endif | 154 #endif |
| 154 | 155 |
| 155 // Get the DictionaryValue equivalent for a download item. Caller owns the | 156 // Get the DictionaryValue equivalent for a download item. Caller owns the |
| 156 // DictionaryValue. | 157 // DictionaryValue. |
| 157 base::DictionaryValue* GetDictionaryFromDownloadItem( | 158 base::DictionaryValue* GetDictionaryFromDownloadItem( |
| 158 const content::DownloadItem* download); | 159 const content::DownloadItem* download); |
| 159 | 160 |
| 160 protected: | 161 protected: |
| 161 friend struct content::BrowserThread::DeleteOnThread< | 162 friend struct content::BrowserThread::DeleteOnThread< |
| 162 content::BrowserThread::UI>; | 163 content::BrowserThread::UI>; |
| 163 friend class DeleteTask<AutomationProvider>; | 164 friend class base::DeleteHelper<AutomationProvider>; |
| 164 virtual ~AutomationProvider(); | 165 virtual ~AutomationProvider(); |
| 165 | 166 |
| 166 // Helper function to find the browser window that contains a given | 167 // Helper function to find the browser window that contains a given |
| 167 // NavigationController and activate that tab. | 168 // NavigationController and activate that tab. |
| 168 // Returns the Browser if found. | 169 // Returns the Browser if found. |
| 169 Browser* FindAndActivateTab(NavigationController* contents); | 170 Browser* FindAndActivateTab(NavigationController* contents); |
| 170 | 171 |
| 171 // Convert a tab handle into a WebContents. If |tab| is non-NULL a pointer | 172 // Convert a tab handle into a WebContents. If |tab| is non-NULL a pointer |
| 172 // to the tab is also returned. Returns NULL in case of failure or if the tab | 173 // to the tab is also returned. Returns NULL in case of failure or if the tab |
| 173 // is not of the WebContents type. | 174 // is not of the WebContents type. |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 std::string channel_id_; | 411 std::string channel_id_; |
| 411 | 412 |
| 412 // Trace data that has been collected but not flushed to the automation | 413 // Trace data that has been collected but not flushed to the automation |
| 413 // client. | 414 // client. |
| 414 TracingData tracing_data_; | 415 TracingData tracing_data_; |
| 415 | 416 |
| 416 DISALLOW_COPY_AND_ASSIGN(AutomationProvider); | 417 DISALLOW_COPY_AND_ASSIGN(AutomationProvider); |
| 417 }; | 418 }; |
| 418 | 419 |
| 419 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ | 420 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ |
| OLD | NEW |