OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "ios/chrome/browser/application_context_impl.h" | 5 #include "ios/chrome/browser/application_context_impl.h" |
6 | 6 |
| 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "components/net_log/chrome_net_log.h" |
8 #include "components/translate/core/browser/translate_download_manager.h" | 11 #include "components/translate/core/browser/translate_download_manager.h" |
| 12 #include "ios/chrome/common/channel_info.h" |
9 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 13 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
| 14 #include "net/log/net_log_capture_mode.h" |
10 | 15 |
11 ApplicationContextImpl::ApplicationContextImpl() { | 16 ApplicationContextImpl::ApplicationContextImpl( |
| 17 const base::CommandLine& command_line) { |
12 DCHECK(!GetApplicationContext()); | 18 DCHECK(!GetApplicationContext()); |
13 SetApplicationContext(this); | 19 SetApplicationContext(this); |
| 20 |
| 21 net_log_.reset(new net_log::ChromeNetLog( |
| 22 base::FilePath(), net::NetLogCaptureMode::Default(), |
| 23 command_line.GetCommandLineString(), GetChannelString())); |
14 } | 24 } |
15 | 25 |
16 ApplicationContextImpl::~ApplicationContextImpl() { | 26 ApplicationContextImpl::~ApplicationContextImpl() { |
17 DCHECK_EQ(this, GetApplicationContext()); | 27 DCHECK_EQ(this, GetApplicationContext()); |
18 SetApplicationContext(nullptr); | 28 SetApplicationContext(nullptr); |
19 } | 29 } |
20 | 30 |
21 PrefService* ApplicationContextImpl::GetLocalState() { | 31 PrefService* ApplicationContextImpl::GetLocalState() { |
22 DCHECK(thread_checker_.CalledOnValidThread()); | 32 DCHECK(thread_checker_.CalledOnValidThread()); |
23 return ios::GetChromeBrowserProvider()->GetLocalState(); | 33 return ios::GetChromeBrowserProvider()->GetLocalState(); |
(...skipping 28 matching lines...) Expand all Loading... |
52 } | 62 } |
53 | 63 |
54 policy::BrowserPolicyConnector* | 64 policy::BrowserPolicyConnector* |
55 ApplicationContextImpl::GetBrowserPolicyConnector() { | 65 ApplicationContextImpl::GetBrowserPolicyConnector() { |
56 return ios::GetChromeBrowserProvider()->GetBrowserPolicyConnector(); | 66 return ios::GetChromeBrowserProvider()->GetBrowserPolicyConnector(); |
57 } | 67 } |
58 | 68 |
59 rappor::RapporService* ApplicationContextImpl::GetRapporService() { | 69 rappor::RapporService* ApplicationContextImpl::GetRapporService() { |
60 return ios::GetChromeBrowserProvider()->GetRapporService(); | 70 return ios::GetChromeBrowserProvider()->GetRapporService(); |
61 } | 71 } |
| 72 |
| 73 net_log::ChromeNetLog* ApplicationContextImpl::GetNetLog() { |
| 74 return net_log_.get(); |
| 75 } |
OLD | NEW |