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

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 693113002: Provide a default role for "bubble" windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index a6f120943f57de515556c227b84f04f8f253b208..0f828f3e804b29de4d2a3a216a1a5d1011de0ace 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -1185,11 +1185,28 @@ void DesktopWindowTreeHostX11::InitX11Window(
ui::SetWindowClassHint(
xdisplay_, xwindow_, params.wm_class_name, params.wm_class_class);
}
- if (!params.wm_role_name.empty() ||
- params.type == Widget::InitParams::TYPE_POPUP) {
- const char kX11WindowRolePopup[] = "popup";
- ui::SetWindowRole(xdisplay_, xwindow_, params.wm_role_name.empty() ?
- std::string(kX11WindowRolePopup) : params.wm_role_name);
+
+ std::string wm_role_name = params.wm_role_name;
sadrul 2014/11/03 17:14:03 Can you use a const char* here instead of making c
mithro-old 2014/11/04 05:48:44 Done.
+ // If the widget isn't overriding the role, provide a default value for popup
+ // and bubble types.
+ if (wm_role_name.empty()) {
+ switch (params.type) {
+ case Widget::InitParams::TYPE_POPUP: {
+ const char kX11WindowRolePopup[] = "popup";
+ wm_role_name = std::string(kX11WindowRolePopup);
Elliot Glaysher 2014/10/31 19:42:15 It should be safe here to just say `wm_role_name =
mithro-old 2014/11/04 05:48:44 Obsolete by sadrul's comments.
+ break;
+ }
+ case Widget::InitParams::TYPE_BUBBLE: {
+ const char kX11WindowRoleBubble[] = "bubble";
+ wm_role_name = std::string(kX11WindowRoleBubble);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ if (!wm_role_name.empty()) {
sadrul 2014/11/03 17:14:03 No {} for single line blocks
mithro-old 2014/11/04 05:48:44 Done.
+ ui::SetWindowRole(xdisplay_, xwindow_, wm_role_name);
}
if (params.remove_standard_frame) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698