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 #include "chrome/test/chromedriver/alert_commands.h" | 5 #include "chrome/test/chromedriver/alert_commands.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/test/chromedriver/chrome/chrome.h" | 9 #include "chrome/test/chromedriver/chrome/chrome.h" |
10 #include "chrome/test/chromedriver/chrome/devtools_client.h" | 10 #include "chrome/test/chromedriver/chrome/devtools_client.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 Status ExecuteGetAlertText( | 52 Status ExecuteGetAlertText( |
53 Session* session, | 53 Session* session, |
54 WebView* web_view, | 54 WebView* web_view, |
55 const base::DictionaryValue& params, | 55 const base::DictionaryValue& params, |
56 scoped_ptr<base::Value>* value) { | 56 scoped_ptr<base::Value>* value) { |
57 std::string message; | 57 std::string message; |
58 Status status = | 58 Status status = |
59 web_view->GetJavaScriptDialogManager()->GetDialogMessage(&message); | 59 web_view->GetJavaScriptDialogManager()->GetDialogMessage(&message); |
60 if (status.IsError()) | 60 if (status.IsError()) |
61 return status; | 61 return status; |
62 value->reset(base::Value::CreateStringValue(message)); | 62 value->reset(new base::StringValue(message)); |
63 return Status(kOk); | 63 return Status(kOk); |
64 } | 64 } |
65 | 65 |
66 Status ExecuteSetAlertValue( | 66 Status ExecuteSetAlertValue( |
67 Session* session, | 67 Session* session, |
68 WebView* web_view, | 68 WebView* web_view, |
69 const base::DictionaryValue& params, | 69 const base::DictionaryValue& params, |
70 scoped_ptr<base::Value>* value) { | 70 scoped_ptr<base::Value>* value) { |
71 std::string text; | 71 std::string text; |
72 if (!params.GetString("text", &text)) | 72 if (!params.GetString("text", &text)) |
(...skipping 20 matching lines...) Expand all Loading... |
93 Status ExecuteDismissAlert( | 93 Status ExecuteDismissAlert( |
94 Session* session, | 94 Session* session, |
95 WebView* web_view, | 95 WebView* web_view, |
96 const base::DictionaryValue& params, | 96 const base::DictionaryValue& params, |
97 scoped_ptr<base::Value>* value) { | 97 scoped_ptr<base::Value>* value) { |
98 Status status = web_view->GetJavaScriptDialogManager() | 98 Status status = web_view->GetJavaScriptDialogManager() |
99 ->HandleDialog(false, session->prompt_text.get()); | 99 ->HandleDialog(false, session->prompt_text.get()); |
100 session->prompt_text.reset(); | 100 session->prompt_text.reset(); |
101 return status; | 101 return status; |
102 } | 102 } |
OLD | NEW |