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

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

Issue 16295003: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
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/test_extension_environment.h" 5 #include "chrome/browser/extensions/test_extension_environment.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if (manifest_extra.GetAsDictionary(&manifest_extra_dict)) { 66 if (manifest_extra.GetAsDictionary(&manifest_extra_dict)) {
67 manifest->MergeDictionary(manifest_extra_dict); 67 manifest->MergeDictionary(manifest_extra_dict);
68 } else { 68 } else {
69 std::string manifest_json; 69 std::string manifest_json;
70 base::JSONWriter::Write(&manifest_extra, &manifest_json); 70 base::JSONWriter::Write(&manifest_extra, &manifest_json);
71 ADD_FAILURE() << "Expected dictionary; got \"" << manifest_json << "\""; 71 ADD_FAILURE() << "Expected dictionary; got \"" << manifest_json << "\"";
72 } 72 }
73 73
74 scoped_refptr<Extension> result = 74 scoped_refptr<Extension> result =
75 ExtensionBuilder().SetManifest(manifest.Pass()).Build(); 75 ExtensionBuilder().SetManifest(manifest.Pass()).Build();
76 GetExtensionService()->AddExtension(result); 76 GetExtensionService()->AddExtension(result.get());
77 return result.get(); 77 return result.get();
78 } 78 }
79 79
80 scoped_ptr<content::WebContents> TestExtensionEnvironment::MakeTab() const { 80 scoped_ptr<content::WebContents> TestExtensionEnvironment::MakeTab() const {
81 scoped_ptr<content::WebContents> contents( 81 scoped_ptr<content::WebContents> contents(
82 content::WebContentsTester::CreateTestWebContents(profile(), NULL)); 82 content::WebContentsTester::CreateTestWebContents(profile(), NULL));
83 // Create a tab id. 83 // Create a tab id.
84 SessionTabHelper::CreateForWebContents(contents.get()); 84 SessionTabHelper::CreateForWebContents(contents.get());
85 return contents.Pass(); 85 return contents.Pass();
86 } 86 }
87 87
88 } // namespace extensions 88 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/startup_helper.cc ('k') | chrome/browser/extensions/test_extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698