Fix sorting issues in chrome_browser.gypi restructuring
[chromium-blink-merge.git] / chrome / browser / media / webrtc_log_list.cc
blob9d680b9eefeaff10f1dcbf1e2ea1a655f5b3bf89
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/media/webrtc_log_list.h"
7 #include "base/files/file.h"
8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/common/chrome_paths.h"
13 namespace {
15 const char kWebRtcLogDirectory[] = "WebRTC Logs";
16 const char kWebRtcLogListFilename[] = "Log List";
20 // static
21 UploadList* WebRtcLogList::CreateWebRtcLogList(UploadList::Delegate* delegate,
22 Profile* profile) {
23 base::FilePath log_list_path = GetWebRtcLogListFileForDirectory(
24 GetWebRtcLogDirectoryForProfile(profile->GetPath()));
25 return new UploadList(delegate, log_list_path);
28 // static
29 base::FilePath WebRtcLogList::GetWebRtcLogDirectoryForProfile(
30 const base::FilePath& profile_path) {
31 DCHECK(!profile_path.empty());
32 return profile_path.AppendASCII(kWebRtcLogDirectory);
35 // static
36 base::FilePath WebRtcLogList::GetWebRtcLogListFileForDirectory(
37 const base::FilePath& dir) {
38 DCHECK(!dir.empty());
39 return dir.AppendASCII(kWebRtcLogListFilename);