OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 WIN8_TEST_UI_AUTOMATION_CLIENT_H_ | 5 #ifndef WIN8_TEST_UI_AUTOMATION_CLIENT_H_ |
6 #define WIN8_TEST_UI_AUTOMATION_CLIENT_H_ | 6 #define WIN8_TEST_UI_AUTOMATION_CLIENT_H_ |
7 | 7 |
8 // This file contains UI automation implementation details for the | 8 // This file contains UI automation implementation details for the |
9 // OpenWithDialogController. See that class for consumable entrypoints. | 9 // OpenWithDialogController. See that class for consumable entrypoints. |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 public: | 29 public: |
30 // If the HRESULT argument indicates success, the automation client has been | 30 // If the HRESULT argument indicates success, the automation client has been |
31 // initialized, has installed its Window observer, and is ready to process | 31 // initialized, has installed its Window observer, and is ready to process |
32 // the named window. Otherwise, initialization has failed and ResultCallback | 32 // the named window. Otherwise, initialization has failed and ResultCallback |
33 // will not be invoked. | 33 // will not be invoked. |
34 typedef base::Callback<void(HRESULT)> InitializedCallback; | 34 typedef base::Callback<void(HRESULT)> InitializedCallback; |
35 | 35 |
36 // If the HRESULT argument indicates success, the desired item in the window | 36 // If the HRESULT argument indicates success, the desired item in the window |
37 // was invoked. Otherwise, the string vector (if not empty) contains the list | 37 // was invoked. Otherwise, the string vector (if not empty) contains the list |
38 // of possible items in the window. | 38 // of possible items in the window. |
39 typedef base::Callback<void(HRESULT, std::vector<string16>)> ResultCallback; | 39 typedef base::Callback<void(HRESULT, std::vector<base::string16>)> |
| 40 ResultCallback; |
40 | 41 |
41 UIAutomationClient(); | 42 UIAutomationClient(); |
42 ~UIAutomationClient(); | 43 ~UIAutomationClient(); |
43 | 44 |
44 // Starts the client. Invokes |callback| once the client is ready or upon | 45 // Starts the client. Invokes |callback| once the client is ready or upon |
45 // failure to start, in which case |result_callback| will never be called. | 46 // failure to start, in which case |result_callback| will never be called. |
46 // Otherwise, |result_callback| will be invoked once |item_name| has been | 47 // Otherwise, |result_callback| will be invoked once |item_name| has been |
47 // invoked. | 48 // invoked. |
48 void Begin(const wchar_t* class_name, | 49 void Begin(const wchar_t* class_name, |
49 const string16& item_name, | 50 const base::string16& item_name, |
50 const InitializedCallback& init_callback, | 51 const InitializedCallback& init_callback, |
51 const ResultCallback& result_callback); | 52 const ResultCallback& result_callback); |
52 | 53 |
53 private: | 54 private: |
54 class Context; | 55 class Context; |
55 | 56 |
56 base::ThreadChecker thread_checker_; | 57 base::ThreadChecker thread_checker_; |
57 | 58 |
58 // A thread in the COM MTA in which automation calls are made. | 59 // A thread in the COM MTA in which automation calls are made. |
59 base::Thread automation_thread_; | 60 base::Thread automation_thread_; |
60 | 61 |
61 // A pointer to the context object that lives on the automation thread. | 62 // A pointer to the context object that lives on the automation thread. |
62 base::WeakPtr<Context> context_; | 63 base::WeakPtr<Context> context_; |
63 | 64 |
64 DISALLOW_COPY_AND_ASSIGN(UIAutomationClient); | 65 DISALLOW_COPY_AND_ASSIGN(UIAutomationClient); |
65 }; | 66 }; |
66 | 67 |
67 } // namespace internal | 68 } // namespace internal |
68 } // namespace win8 | 69 } // namespace win8 |
69 | 70 |
70 #endif // WIN8_TEST_UI_AUTOMATION_CLIENT_H_ | 71 #endif // WIN8_TEST_UI_AUTOMATION_CLIENT_H_ |
OLD | NEW |