OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/api/test/test_api.h" | 5 #include "chrome/browser/extensions/api/test/test_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 quota->violation_errors_.clear(); | 83 quota->violation_errors_.clear(); |
84 return true; | 84 return true; |
85 } | 85 } |
86 | 86 |
87 TestCreateIncognitoTabFunction:: | 87 TestCreateIncognitoTabFunction:: |
88 ~TestCreateIncognitoTabFunction() {} | 88 ~TestCreateIncognitoTabFunction() {} |
89 | 89 |
90 bool TestCreateIncognitoTabFunction::RunImpl() { | 90 bool TestCreateIncognitoTabFunction::RunImpl() { |
91 std::string url; | 91 std::string url; |
92 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); | 92 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); |
93 chrome::OpenURLOffTheRecord(profile(), GURL(url)); | 93 chrome::OpenURLOffTheRecord(profile(), GURL(url), |
| 94 chrome::HOST_DESKTOP_TYPE_NATIVE); |
94 return true; | 95 return true; |
95 } | 96 } |
96 | 97 |
97 bool TestSendMessageFunction::RunImpl() { | 98 bool TestSendMessageFunction::RunImpl() { |
98 std::string message; | 99 std::string message; |
99 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &message)); | 100 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &message)); |
100 AddRef(); // balanced in Reply | 101 AddRef(); // balanced in Reply |
101 content::NotificationService::current()->Notify( | 102 content::NotificationService::current()->Notify( |
102 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, | 103 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, |
103 content::Source<TestSendMessageFunction>(this), | 104 content::Source<TestSendMessageFunction>(this), |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 if (!test_config_state->config_state()) { | 137 if (!test_config_state->config_state()) { |
137 error_ = kNoTestConfigDataError; | 138 error_ = kNoTestConfigDataError; |
138 return false; | 139 return false; |
139 } | 140 } |
140 | 141 |
141 SetResult(test_config_state->config_state()->DeepCopy()); | 142 SetResult(test_config_state->config_state()->DeepCopy()); |
142 return true; | 143 return true; |
143 } | 144 } |
144 | 145 |
145 } // namespace extensions | 146 } // namespace extensions |
OLD | NEW |