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

Side by Side Diff: content/shell/browser/shell_browser_context.cc

Issue 1874903002: Convert //content from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix indent Created 4 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell_browser_context.h" 5 #include "content/shell/browser/shell_browser_context.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 ignore_certificate_errors_ = true; 74 ignore_certificate_errors_ = true;
75 if (cmd_line->HasSwitch(switches::kContentShellDataPath)) { 75 if (cmd_line->HasSwitch(switches::kContentShellDataPath)) {
76 path_ = cmd_line->GetSwitchValuePath(switches::kContentShellDataPath); 76 path_ = cmd_line->GetSwitchValuePath(switches::kContentShellDataPath);
77 BrowserContext::Initialize(this, path_); 77 BrowserContext::Initialize(this, path_);
78 return; 78 return;
79 } 79 }
80 #if defined(OS_WIN) 80 #if defined(OS_WIN)
81 CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &path_)); 81 CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &path_));
82 path_ = path_.Append(std::wstring(L"content_shell")); 82 path_ = path_.Append(std::wstring(L"content_shell"));
83 #elif defined(OS_LINUX) 83 #elif defined(OS_LINUX)
84 scoped_ptr<base::Environment> env(base::Environment::Create()); 84 std::unique_ptr<base::Environment> env(base::Environment::Create());
85 base::FilePath config_dir( 85 base::FilePath config_dir(
86 base::nix::GetXDGDirectory(env.get(), 86 base::nix::GetXDGDirectory(env.get(),
87 base::nix::kXdgConfigHomeEnvVar, 87 base::nix::kXdgConfigHomeEnvVar,
88 base::nix::kDotConfigDir)); 88 base::nix::kDotConfigDir));
89 path_ = config_dir.Append("content_shell"); 89 path_ = config_dir.Append("content_shell");
90 #elif defined(OS_MACOSX) 90 #elif defined(OS_MACOSX)
91 CHECK(PathService::Get(base::DIR_APP_DATA, &path_)); 91 CHECK(PathService::Get(base::DIR_APP_DATA, &path_));
92 path_ = path_.Append("Chromium Content Shell"); 92 path_ = path_.Append("Chromium Content Shell");
93 #elif defined(OS_ANDROID) 93 #elif defined(OS_ANDROID)
94 CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &path_)); 94 CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &path_));
95 path_ = path_.Append(FILE_PATH_LITERAL("content_shell")); 95 path_ = path_.Append(FILE_PATH_LITERAL("content_shell"));
96 #else 96 #else
97 NOTIMPLEMENTED(); 97 NOTIMPLEMENTED();
98 #endif 98 #endif
99 99
100 if (!base::PathExists(path_)) 100 if (!base::PathExists(path_))
101 base::CreateDirectory(path_); 101 base::CreateDirectory(path_);
102 BrowserContext::Initialize(this, path_); 102 BrowserContext::Initialize(this, path_);
103 } 103 }
104 104
105 scoped_ptr<ZoomLevelDelegate> ShellBrowserContext::CreateZoomLevelDelegate( 105 std::unique_ptr<ZoomLevelDelegate> ShellBrowserContext::CreateZoomLevelDelegate(
106 const base::FilePath&) { 106 const base::FilePath&) {
107 return scoped_ptr<ZoomLevelDelegate>(); 107 return std::unique_ptr<ZoomLevelDelegate>();
108 } 108 }
109 109
110 base::FilePath ShellBrowserContext::GetPath() const { 110 base::FilePath ShellBrowserContext::GetPath() const {
111 return path_; 111 return path_;
112 } 112 }
113 113
114 bool ShellBrowserContext::IsOffTheRecord() const { 114 bool ShellBrowserContext::IsOffTheRecord() const {
115 return off_the_record_; 115 return off_the_record_;
116 } 116 }
117 117
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 return permission_manager_.get(); 203 return permission_manager_.get();
204 } 204 }
205 205
206 BackgroundSyncController* ShellBrowserContext::GetBackgroundSyncController() { 206 BackgroundSyncController* ShellBrowserContext::GetBackgroundSyncController() {
207 if (!background_sync_controller_) 207 if (!background_sync_controller_)
208 background_sync_controller_.reset(new MockBackgroundSyncController()); 208 background_sync_controller_.reset(new MockBackgroundSyncController());
209 return background_sync_controller_.get(); 209 return background_sync_controller_.get();
210 } 210 }
211 211
212 } // namespace content 212 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_browser_context.h ('k') | content/shell/browser/shell_browser_main.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698