Chromium Code Reviews| 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_UTIL_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_UTIL_H_ |
| 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_UTIL_H_ | 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "chrome/common/chrome_view_type.h" | |
| 12 | 13 |
| 14 class AutomationId; | |
| 13 class AutomationProvider; | 15 class AutomationProvider; |
| 14 class Browser; | 16 class Browser; |
| 17 class Extension; | |
| 18 class ExtensionHost; | |
| 15 class GURL; | 19 class GURL; |
| 20 class Profile; | |
| 21 class RenderViewHost; | |
| 16 class TabContents; | 22 class TabContents; |
| 23 class TabContentsWrapper; | |
| 17 | 24 |
| 18 namespace base { | 25 namespace base { |
| 19 class DictionaryValue; | 26 class DictionaryValue; |
| 20 } | 27 } |
| 21 | 28 |
| 22 namespace IPC { | 29 namespace IPC { |
| 23 class Message; | 30 class Message; |
| 24 } | 31 } |
| 25 | 32 |
| 26 // This file contains automation utility functions. | 33 // This file contains automation utility functions. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 70 // See |TestingAutomationProvider| for example input. | 77 // See |TestingAutomationProvider| for example input. |
| 71 void SetCookieJSON(AutomationProvider* provider, | 78 void SetCookieJSON(AutomationProvider* provider, |
| 72 base::DictionaryValue* args, | 79 base::DictionaryValue* args, |
| 73 IPC::Message* reply_message); | 80 IPC::Message* reply_message); |
| 74 | 81 |
| 75 // Sends a JSON error reply if an app modal dialog is active. Returns whether | 82 // Sends a JSON error reply if an app modal dialog is active. Returns whether |
| 76 // an error reply was sent. | 83 // an error reply was sent. |
| 77 bool SendErrorIfModalDialogActive(AutomationProvider* provider, | 84 bool SendErrorIfModalDialogActive(AutomationProvider* provider, |
| 78 IPC::Message* message); | 85 IPC::Message* message); |
| 79 | 86 |
| 87 // Returns a valid automation ID for the given tab. | |
| 88 AutomationId GetIdForTab(const TabContentsWrapper* tab); | |
| 89 | |
| 90 // Returns a valid automation ID for the extension host. | |
| 91 AutomationId GetIdForExtensionView(const ExtensionHost* ext_host); | |
| 92 | |
| 93 // Returns a valid automation ID for the extension. | |
| 94 AutomationId GetIdForExtension(const Extension* extension); | |
| 95 | |
| 96 // Gets the tab for the given ID. Returns true on success. | |
| 97 bool GetTabForId(const AutomationId& id, TabContents** tab); | |
| 98 | |
| 99 // Gets the render view for the given ID. Returns true on success. | |
| 100 bool GetRenderViewForId( | |
| 101 const AutomationId& id, | |
| 102 Profile* profile, | |
| 103 RenderViewHost** rvh); | |
| 104 | |
| 105 // Returns whether the given ID refers to a actual automation entity. | |
|
dennis_jeffrey
2011/12/03 00:19:37
nit: 'a actual' --> 'an actual'
kkania
2011/12/03 00:34:31
Done.
| |
| 106 bool DoesObjectWithIdExist(const AutomationId& id, Profile* profile); | |
| 107 | |
| 80 } // namespace automation_util | 108 } // namespace automation_util |
| 81 | 109 |
| 82 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_UTIL_H_ | 110 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_UTIL_H_ |
| OLD | NEW |