OLD | NEW |
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 #ifndef IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_H_ | 5 #ifndef IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_H_ |
6 #define IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_H_ | 6 #define IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Creates the main net::URLRequestContextGetter that will be returned by | 121 // Creates the main net::URLRequestContextGetter that will be returned by |
122 // GetRequestContext(). Should only be called once. | 122 // GetRequestContext(). Should only be called once. |
123 virtual net::URLRequestContextGetter* CreateRequestContext( | 123 virtual net::URLRequestContextGetter* CreateRequestContext( |
124 ProtocolHandlerMap* protocol_handlers) = 0; | 124 ProtocolHandlerMap* protocol_handlers) = 0; |
125 | 125 |
126 // Creates a isolated net::URLRequestContextGetter. Should only be called once | 126 // Creates a isolated net::URLRequestContextGetter. Should only be called once |
127 // per partition_path per browser state object. | 127 // per partition_path per browser state object. |
128 virtual net::URLRequestContextGetter* CreateIsolatedRequestContext( | 128 virtual net::URLRequestContextGetter* CreateIsolatedRequestContext( |
129 const base::FilePath& partition_path) = 0; | 129 const base::FilePath& partition_path) = 0; |
130 | 130 |
131 // Returns the current ChromeBrowserState casted as a TestChromeBrowserState | |
132 // or null if it is not a TestChromeBrowserState. | |
133 // TODO(crbug.com/583682): This method should not be used. It is there for | |
134 // supporting a legacy test, and will be removed as soon as the deprecated | |
135 // test is removed. | |
136 virtual TestChromeBrowserState* AsTestChromeBrowserState(); | |
137 | |
138 // web::BrowserState | 131 // web::BrowserState |
139 net::URLRequestContextGetter* GetRequestContext() override; | 132 net::URLRequestContextGetter* GetRequestContext() override; |
140 | 133 |
141 protected: | 134 protected: |
142 ChromeBrowserState(); | 135 ChromeBrowserState(); |
143 | 136 |
144 private: | 137 private: |
145 friend class ::TestChromeBrowserState; | 138 friend class ::TestChromeBrowserState; |
146 friend class ::TestChromeBrowserStateManager; | 139 friend class ::TestChromeBrowserStateManager; |
147 | 140 |
148 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 141 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
149 | 142 |
150 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserState); | 143 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserState); |
151 }; | 144 }; |
152 | 145 |
153 } // namespace ios | 146 } // namespace ios |
154 | 147 |
155 #endif // IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_H_ | 148 #endif // IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_H_ |
OLD | NEW |