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

Side by Side Diff: ios/public/provider/chrome/browser/browser_state/chrome_browser_state.cc

Issue 1667733002: Move chrome_browser_state.{cc,h} to ios/chrome/browser/browser_state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test_support_ios
Patch Set: Created 4 years, 10 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
« no previous file with comments | « ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state. h"
6
7 #include "base/files/file_path.h"
8 #include "ios/public/provider/web/web_ui_ios.h"
9 #include "ios/web/public/web_state/web_state.h"
10
11 namespace ios {
12
13 // static
14 ChromeBrowserState* ChromeBrowserState::FromBrowserState(
15 web::BrowserState* browser_state) {
16 // This is safe; this is the only implementation of BrowserState.
17 return static_cast<ChromeBrowserState*>(browser_state);
18 }
19
20 // static
21 ChromeBrowserState* ChromeBrowserState::FromWebUIIOS(web::WebUIIOS* web_ui) {
22 return FromBrowserState(web_ui->GetWebState()->GetBrowserState());
23 }
24
25 std::string ChromeBrowserState::GetDebugName() {
26 // The debug name is based on the state path of the original browser state
27 // to keep in sync with the meaning on other platforms.
28 std::string name =
29 GetOriginalChromeBrowserState()->GetStatePath().BaseName().MaybeAsASCII();
30 if (name.empty()) {
31 name = "UnknownBrowserState";
32 }
33 return name;
34 }
35
36 } // namespace ios
OLDNEW
« no previous file with comments | « ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698