Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: chrome/browser/extensions/extension_function_test_utils.cc

Issue 666153002: Standardize usage of virtual/override/final in chrome/browser/extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/extension_function_test_utils.h" 5 #include "chrome/browser/extensions/extension_function_test_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 14 matching lines...) Expand all
25 using extensions::Manifest; 25 using extensions::Manifest;
26 namespace keys = extensions::tabs_constants; 26 namespace keys = extensions::tabs_constants;
27 27
28 namespace { 28 namespace {
29 29
30 class TestFunctionDispatcherDelegate 30 class TestFunctionDispatcherDelegate
31 : public extensions::ExtensionFunctionDispatcher::Delegate { 31 : public extensions::ExtensionFunctionDispatcher::Delegate {
32 public: 32 public:
33 explicit TestFunctionDispatcherDelegate(Browser* browser) : 33 explicit TestFunctionDispatcherDelegate(Browser* browser) :
34 browser_(browser) {} 34 browser_(browser) {}
35 virtual ~TestFunctionDispatcherDelegate() {} 35 ~TestFunctionDispatcherDelegate() override {}
36 36
37 private: 37 private:
38 virtual extensions::WindowController* GetExtensionWindowController() 38 extensions::WindowController* GetExtensionWindowController() const override {
39 const override {
40 return browser_->extension_window_controller(); 39 return browser_->extension_window_controller();
41 } 40 }
42 41
43 virtual WebContents* GetAssociatedWebContents() const override { 42 WebContents* GetAssociatedWebContents() const override { return NULL; }
44 return NULL;
45 }
46 43
47 Browser* browser_; 44 Browser* browser_;
48 }; 45 };
49 46
50 } // namespace 47 } // namespace
51 48
52 namespace extension_function_test_utils { 49 namespace extension_function_test_utils {
53 50
54 base::Value* ParseJSON(const std::string& data) { 51 base::Value* ParseJSON(const std::string& data) {
55 return base::JSONReader::Read(data); 52 return base::JSONReader::Read(data);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 199
203 bool HasResponse() { 200 bool HasResponse() {
204 return response_.get() != NULL; 201 return response_.get() != NULL;
205 } 202 }
206 203
207 bool GetResponse() { 204 bool GetResponse() {
208 EXPECT_TRUE(HasResponse()); 205 EXPECT_TRUE(HasResponse());
209 return *response_.get(); 206 return *response_.get();
210 } 207 }
211 208
212 virtual void OnSendResponse(UIThreadExtensionFunction* function, 209 void OnSendResponse(UIThreadExtensionFunction* function,
213 bool success, 210 bool success,
214 bool bad_message) override { 211 bool bad_message) override {
215 ASSERT_FALSE(bad_message); 212 ASSERT_FALSE(bad_message);
216 ASSERT_FALSE(HasResponse()); 213 ASSERT_FALSE(HasResponse());
217 response_.reset(new bool); 214 response_.reset(new bool);
218 *response_ = success; 215 *response_ = success;
219 if (should_post_quit_) { 216 if (should_post_quit_) {
220 base::MessageLoopForUI::current()->Quit(); 217 base::MessageLoopForUI::current()->Quit();
221 } 218 }
222 } 219 }
223 220
224 private: 221 private:
(...skipping 23 matching lines...) Expand all
248 // only one place. See crbug.com/394840. 245 // only one place. See crbug.com/394840.
249 return extensions::api_test_utils::RunFunction( 246 return extensions::api_test_utils::RunFunction(
250 function, 247 function,
251 args.Pass(), 248 args.Pass(),
252 browser->profile(), 249 browser->profile(),
253 dispatcher.Pass(), 250 dispatcher.Pass(),
254 static_cast<extensions::api_test_utils::RunFunctionFlags>(flags)); 251 static_cast<extensions::api_test_utils::RunFunctionFlags>(flags));
255 } 252 }
256 253
257 } // namespace extension_function_test_utils 254 } // namespace extension_function_test_utils
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_error_ui_default.h ('k') | chrome/browser/extensions/extension_garbage_collector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698