How to hide minimize and maximize button from chromium browser?

2,046 views
Skip to first unread message

Mohan Pandit

unread,
Apr 20, 2017, 4:27:30 AM4/20/17
to Chromium-dev
I am new to chromium. I have requirement to hide the minimize and maximize button from chromium browser.
So can you tell me what code in which file needs to be modified to achieve this requirement?

Asesh Shrestha

unread,
Apr 20, 2017, 10:00:45 AM4/20/17
to Chromium-dev
What operating system are you using? I know how to do it on Windows not sure if Chromium has native and cross platform APIs for doing so

Asesh Shrestha

unread,
Apr 20, 2017, 10:11:09 AM4/20/17
to Chromium-dev
Can you try returning false from these two methods from here: https://cs.chromium.org/chromium/src/ash/wm_window.cc?q=maximize+package:%5Echromium$&dr=CSs&l=517

Return false from CanMaximize and CanMinimize. Not sure if that's the method Chromium calls for enabling/disabling minimize and maximize buttons. 

The other way to do it is using Windows API: GetSystemMenu, EnableMenuItem etc. You will need the main window handle ie the handle of browser process to do so.


On Thursday, April 20, 2017 at 2:12:30 PM UTC+5:45, Mohan Pandit wrote:

djhaoyisi

unread,
Apr 20, 2017, 10:23:54 AM4/20/17
to Chromium-dev
chromium api key

PhistucK

unread,
Apr 20, 2017, 1:06:16 PM4/20/17
to djha...@gmail.com, Chromium-dev
Please, do not hijack threads with unrelated posts. See this page for API keys.


PhistucK

On Thu, Apr 20, 2017 at 5:23 PM, djhaoyisi <djha...@gmail.com> wrote:
chromium api key

--
--
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+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/9c34e936-4bad-4191-84f0-2cfa45548c04%40chromium.org.

Simon Hong

unread,
Apr 20, 2017, 8:01:35 PM4/20/17
to phis...@gmail.com, djha...@gmail.com, Chromium-dev

you can see that kinds of buttons in XXXBrowserFrameView.
In chromium, subclass of NonClientFrameView manages them.


2017년 4월 21일 (금) 오전 2:05, PhistucK <phis...@gmail.com>님이 작성:
Please, do not hijack threads with unrelated posts. See this page for API keys.


PhistucK

On Thu, Apr 20, 2017 at 5:23 PM, djhaoyisi <djha...@gmail.com> wrote:
chromium api key

--
--
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.
--
--
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.

Mohan Pandit

unread,
Apr 21, 2017, 12:19:52 AM4/21/17
to Chromium-dev
Yes I am using windows OS.

Mohan Pandit

unread,
Apr 21, 2017, 12:31:28 AM4/21/17
to Chromium-dev
@Asesh can you mention the file name with relevant changes?

Asesh Shrestha

unread,
Apr 21, 2017, 9:47:58 AM4/21/17
to Chromium-dev
You should follow Simon's answer instead. The one that I guessed might not be correct. Just click that link that I have posted, it will show you the name of that file and path too. But then again if it won't work then you should follow Simon's answer

Mohan Pandit

unread,
Apr 24, 2017, 11:49:26 PM4/24/17
to Chromium-dev
Can it be possible to disable/hide the control button(minimize and maximize) externally without getting into code? 

Asesh Shrestha

unread,
Apr 25, 2017, 12:01:38 AM4/25/17
to Chromium-dev
Well, if the Windows were created using dialog box templates then it could be done by modifying rc script but Chromium uses views and they are all done by code. So you will have to modify the code to do so. BTW did you try what we told you and what was the output?

Mohan Pandit

unread,
Apr 25, 2017, 12:08:52 AM4/25/17
to Chromium-dev
I have updated above approach to developer team for investigating. But just to achieve above one, modifying code would be costly. That's why I am looking some external approach. Like using some command line argument, switch flag etc.
If there is any way please update me Thanks.

Asesh Shrestha

unread,
Apr 25, 2017, 12:28:17 AM4/25/17
to Chromium-dev
You can find Chromium switches here in this file: src\chrome\common\chrome_switches.cc

Looks like it can't be done by using command line flags.

PhistucK

unread,
Apr 25, 2017, 2:08:03 AM4/25/17
to Mohan Pandit, Chromium-dev
You should look into the Windows API, there may be ways to get an external window and change their controls, some interception of some kind. It will still require code, but external one which may be easier to maintain.
Obviously, out of scope for this discussion.


PhistucK

--
--
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+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/f8b2ca27-3420-42ed-9c4f-47c4ae4231fb%40chromium.org.

Asesh Shrestha

unread,
Apr 25, 2017, 2:41:24 AM4/25/17
to Chromium-dev, mohanp...@gmail.com
SetWindowLongPtr is the API to do so. The most efficient way to do so is to modify the windows style of the browser process before it's created but you will have to dig through Chromium source code to do so.


PhistucK

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