| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Support utilities for the JSON automation interface used by PyAuto. | 5 // Support utilities for the JSON automation interface used by PyAuto. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_ | 7 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_ |
| 8 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_ | 8 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 | 14 |
| 15 class AutomationId; |
| 15 class AutomationProvider; | 16 class AutomationProvider; |
| 16 class Browser; | 17 class Browser; |
| 18 class Profile; |
| 19 class RenderViewHost; |
| 17 class TabContents; | 20 class TabContents; |
| 18 | 21 |
| 19 namespace base { | 22 namespace base { |
| 20 class DictionaryValue; | 23 class DictionaryValue; |
| 21 class Value; | 24 class Value; |
| 22 } | 25 } |
| 23 | 26 |
| 24 namespace IPC { | 27 namespace IPC { |
| 25 class Message; | 28 class Message; |
| 26 } | 29 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Gets the browser and tab specified by the given dictionary |args|. |args| | 69 // Gets the browser and tab specified by the given dictionary |args|. |args| |
| 67 // should contain a key 'windex' which refers to the index of the browser and | 70 // should contain a key 'windex' which refers to the index of the browser and |
| 68 // a key 'tab_index' which refers to the index of the tab in that browser. | 71 // a key 'tab_index' which refers to the index of the tab in that browser. |
| 69 // Returns true on success and sets |browser| and |tab|. Otherwise, |error| | 72 // Returns true on success and sets |browser| and |tab|. Otherwise, |error| |
| 70 // will be set. | 73 // will be set. |
| 71 bool GetBrowserAndTabFromJSONArgs(base::DictionaryValue* args, | 74 bool GetBrowserAndTabFromJSONArgs(base::DictionaryValue* args, |
| 72 Browser** browser, | 75 Browser** browser, |
| 73 TabContents** tab, | 76 TabContents** tab, |
| 74 std::string* error) WARN_UNUSED_RESULT; | 77 std::string* error) WARN_UNUSED_RESULT; |
| 75 | 78 |
| 79 // Gets an automation ID from the given value in the given dicitionary |args|. |
| 80 // Returns true on success and sets |id|. Otherwise, |error| will be set. |
| 81 bool GetAutomationIdFromJSONArgs( |
| 82 base::DictionaryValue* args, |
| 83 const std::string& key_name, |
| 84 AutomationId* id, |
| 85 std::string* error) WARN_UNUSED_RESULT; |
| 86 |
| 87 // Gets the render view specified by the given dictionary |args|. |args| |
| 88 // should contain a key 'view_id' which refers to an automation ID for the |
| 89 // render view. Returns true on success and sets |rvh|. Otherwise, |error| |
| 90 // will be set. |
| 91 bool GetRenderViewFromJSONArgs( |
| 92 base::DictionaryValue* args, |
| 93 Profile* profile, |
| 94 RenderViewHost** rvh, |
| 95 std::string* error) WARN_UNUSED_RESULT; |
| 96 |
| 76 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_ | 97 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_JSON_H_ |
| OLD | NEW |