1 // Copyright (c) 2015 The Chromium Embedded Framework Authors. 2 // Portions copyright (c) 2012 The Chromium Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 6 // This class gathers state related to a single user profile. 7 8 #ifndef CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_ALLOY_H_ 9 #define CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_ALLOY_H_ 10 11 #include "chrome/browser/profiles/profile.h" 12 13 // This file provides a stub implementation of Chrome's Profile object for use 14 // as an interop layer between CEF and files that live in chrome/. 15 16 class ChromeProfileAlloy : public Profile { 17 public: 18 ChromeProfileAlloy(); 19 20 ChromeProfileAlloy(const ChromeProfileAlloy&) = delete; 21 ChromeProfileAlloy& operator=(const ChromeProfileAlloy&) = delete; 22 23 ~ChromeProfileAlloy() override; 24 25 protected: 26 // Profile methods. 27 bool IsOffTheRecord() override; 28 bool IsOffTheRecord() const override; 29 const OTRProfileID& GetOTRProfileID() const override; 30 variations::VariationsClient* GetVariationsClient() override; 31 scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner() override; 32 std::string GetProfileUserName() const override; 33 Profile* GetOffTheRecordProfile(const Profile::OTRProfileID& otr_profile_id, 34 bool create_if_needed) override; 35 std::vector<Profile*> GetAllOffTheRecordProfiles() override; 36 void DestroyOffTheRecordProfile(Profile* otr_profile) override; 37 bool HasOffTheRecordProfile( 38 const Profile::OTRProfileID& otr_profile_id) override; 39 bool HasAnyOffTheRecordProfile() override; 40 Profile* GetOriginalProfile() override; 41 const Profile* GetOriginalProfile() const override; 42 bool IsChild() const override; 43 ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override; 44 bool IsSameOrParent(Profile* profile) override; 45 base::Time GetStartTime() const override; 46 base::FilePath last_selected_directory() override; 47 void set_last_selected_directory(const base::FilePath& path) override; 48 GURL GetHomePage() override; 49 bool WasCreatedByVersionOrLater(const std::string& version) override; 50 base::Time GetCreationTime() const override; 51 void SetCreationTimeForTesting(base::Time creation_time) override; 52 void RecordPrimaryMainFrameNavigation() override; 53 bool IsSignedIn() override; 54 55 private: 56 std::unique_ptr<variations::VariationsClient> variations_client_; 57 }; 58 59 #endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_PROFILE_ALLOY_H_ 60