OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser/extensions/extension_test_api.h" | 5 #include "chrome/browser/extensions/extension_test_api.h" |
6 | 6 |
| 7 #include <string> |
| 8 |
7 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
9 #include "chrome/browser/extensions/extensions_service.h" | 11 #include "chrome/browser/extensions/extensions_service.h" |
10 #include "chrome/browser/extensions/extensions_quota_service.h" | 12 #include "chrome/browser/extensions/extensions_quota_service.h" |
11 #include "chrome/common/notification_service.h" | 13 #include "chrome/common/notification_service.h" |
12 | 14 |
13 bool ExtensionTestPassFunction::RunImpl() { | 15 bool ExtensionTestPassFunction::RunImpl() { |
14 NotificationService::current()->Notify( | 16 NotificationService::current()->Notify( |
15 NotificationType::EXTENSION_TEST_PASSED, | 17 NotificationType::EXTENSION_TEST_PASSED, |
16 Source<Profile>(dispatcher()->profile()), | 18 Source<Profile>(dispatcher()->profile()), |
(...skipping 26 matching lines...) Expand all Loading... |
43 quota->violators_.clear(); | 45 quota->violators_.clear(); |
44 return true; | 46 return true; |
45 } | 47 } |
46 | 48 |
47 bool ExtensionTestCreateIncognitoTabFunction::RunImpl() { | 49 bool ExtensionTestCreateIncognitoTabFunction::RunImpl() { |
48 std::string url; | 50 std::string url; |
49 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); | 51 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); |
50 Browser::OpenURLOffTheRecord(profile(), GURL(url)); | 52 Browser::OpenURLOffTheRecord(profile(), GURL(url)); |
51 return true; | 53 return true; |
52 } | 54 } |
| 55 |
| 56 bool ExtensionTestSendMessageFunction::RunImpl() { |
| 57 std::string message; |
| 58 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &message)); |
| 59 std::string id = extension_id(); |
| 60 NotificationService::current()->Notify( |
| 61 NotificationType::EXTENSION_TEST_MESSAGE, |
| 62 Source<std::string>(&id), |
| 63 Details<std::string>(&message)); |
| 64 return true; |
| 65 } |
OLD | NEW |