Current profile path of Google Chrome browser programmatically (in C++) !

855 views
Skip to first unread message

Kumar Gaurav

unread,
Jul 8, 2016, 5:55:39 AM7/8/16
to Chromium-dev

I am looking for current profile path for Google chrome browser. When I am entering URL https://chrome/versions in chrome, it is giving the current profile path but I want it through C++ programming.

Any suggestions will be appreciated.

Thanks

Primiano Tucci

unread,
Jul 8, 2016, 6:00:51 AM7/8/16
to krgau...@gmail.com, Chromium-dev

yupeng zhang

unread,
Jul 12, 2016, 3:33:59 AM7/12/16
to Chromium-dev
You can try find some code in Profile and PrefService

Good luck :)

在 2016年7月8日星期五 UTC+8下午5:55:39,Kumar Gaurav写道:

Kumar Gaurav

unread,
Jul 12, 2016, 8:41:30 AM7/12/16
to Chromium-dev
Hi yupeng,
 Thanks for this kind help,but i want to know when chrome store its data in profile based like default ,profile 1,profile 2 and so on..it makes when someone sign in into the google chrome .and when you sign out and sign in regularly making its profile respectively.(c/user/username/appdata/local/Google/chrome/userdata/Default or profile based)
Now, my question is ,how will i found which profile is active now.and How to get this using c++ ?

Michael

unread,
Jul 13, 2016, 8:49:45 AM7/13/16
to Chromium-dev
Assuming you have a Browser*... Browser*->profile()->GetPath(), returns you a FilePath. file_path.h will show you many ways you can coax a string out of that (such as value()).

Don't have a Browser*? Look at browser_finder.h. This file has namespace functions that can help you find a browser, such as chrome::FindLastActive().

So one way to get the current profile path, (making some assumptions and ignoring some checks) would be: chrome::FindLastActive()->profile()->GetPath()->value(), making sure to include browser_finder.h
Message has been deleted

PhistucK

unread,
Jul 20, 2016, 9:16:05 AM7/20/16
to girishj...@gmail.com, Chromium-dev
Using code search will give you the path -

Chromium is not a library. You can use CEF for that (it is not officially endorsed by the Chromium project) -


PhistucK

On Wed, Jul 20, 2016 at 3:59 PM, Girish Joshi <girishj...@gmail.com> wrote:
Hi Michael,
Thanks for giving me a right way !
But still i stuck on it,1st from where i can include "browser_finder.h" ?
2nd is there any way to include chromium library in my code ? if yes ; then how ?
any other way(link/site) are also be appreciated.
thanks


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Reply all
Reply to author
Forward
0 new messages