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 | |
9 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
10 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
11 #include "chrome/browser/extensions/extensions_service.h" | 9 #include "chrome/browser/extensions/extensions_service.h" |
12 #include "chrome/browser/extensions/extensions_quota_service.h" | 10 #include "chrome/browser/extensions/extensions_quota_service.h" |
13 #include "chrome/common/notification_service.h" | 11 #include "chrome/common/notification_service.h" |
14 | 12 |
15 bool ExtensionTestPassFunction::RunImpl() { | 13 bool ExtensionTestPassFunction::RunImpl() { |
16 NotificationService::current()->Notify( | 14 NotificationService::current()->Notify( |
17 NotificationType::EXTENSION_TEST_PASSED, | 15 NotificationType::EXTENSION_TEST_PASSED, |
18 Source<Profile>(dispatcher()->profile()), | 16 Source<Profile>(dispatcher()->profile()), |
(...skipping 26 matching lines...) Expand all Loading... |
45 quota->violators_.clear(); | 43 quota->violators_.clear(); |
46 return true; | 44 return true; |
47 } | 45 } |
48 | 46 |
49 bool ExtensionTestCreateIncognitoTabFunction::RunImpl() { | 47 bool ExtensionTestCreateIncognitoTabFunction::RunImpl() { |
50 std::string url; | 48 std::string url; |
51 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); | 49 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); |
52 Browser::OpenURLOffTheRecord(profile(), GURL(url)); | 50 Browser::OpenURLOffTheRecord(profile(), GURL(url)); |
53 return true; | 51 return true; |
54 } | 52 } |
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 |