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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 TestCreateIncognitoTabFunction:: | 93 TestCreateIncognitoTabFunction:: |
94 ~TestCreateIncognitoTabFunction() {} | 94 ~TestCreateIncognitoTabFunction() {} |
95 | 95 |
96 bool TestCreateIncognitoTabFunction::RunImpl() { | 96 bool TestCreateIncognitoTabFunction::RunImpl() { |
97 scoped_ptr<CreateIncognitoTab::Params> params( | 97 scoped_ptr<CreateIncognitoTab::Params> params( |
98 CreateIncognitoTab::Params::Create(*args_)); | 98 CreateIncognitoTab::Params::Create(*args_)); |
99 EXTENSION_FUNCTION_VALIDATE(params.get()); | 99 EXTENSION_FUNCTION_VALIDATE(params.get()); |
100 chrome::OpenURLOffTheRecord(profile(), GURL(params->url), | 100 chrome::OpenURLOffTheRecord(profile(), GURL(params->url), |
101 chrome::HOST_DESKTOP_TYPE_NATIVE); | 101 chrome::GetActiveDesktop()); |
102 return true; | 102 return true; |
103 } | 103 } |
104 | 104 |
105 bool TestSendMessageFunction::RunImpl() { | 105 bool TestSendMessageFunction::RunImpl() { |
106 scoped_ptr<PassMessage::Params> params( | 106 scoped_ptr<PassMessage::Params> params( |
107 PassMessage::Params::Create(*args_)); | 107 PassMessage::Params::Create(*args_)); |
108 EXTENSION_FUNCTION_VALIDATE(params.get()); | 108 EXTENSION_FUNCTION_VALIDATE(params.get()); |
109 AddRef(); // balanced in Reply | 109 AddRef(); // balanced in Reply |
110 content::NotificationService::current()->Notify( | 110 content::NotificationService::current()->Notify( |
111 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, | 111 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 if (!test_config_state->config_state()) { | 146 if (!test_config_state->config_state()) { |
147 error_ = kNoTestConfigDataError; | 147 error_ = kNoTestConfigDataError; |
148 return false; | 148 return false; |
149 } | 149 } |
150 | 150 |
151 SetResult(test_config_state->config_state()->DeepCopy()); | 151 SetResult(test_config_state->config_state()->DeepCopy()); |
152 return true; | 152 return true; |
153 } | 153 } |
154 | 154 |
155 } // namespace extensions | 155 } // namespace extensions |
OLD | NEW |