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) { |