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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 1138343003: Only update icon if the new one is not null. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
6 6
7 #include <X11/extensions/shape.h> 7 #include <X11/extensions/shape.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/Xregion.h> 10 #include <X11/Xregion.h>
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 // 786 //
787 // All of this could be made much, much better. 787 // All of this could be made much, much better.
788 std::vector<unsigned long> data; 788 std::vector<unsigned long> data;
789 789
790 if (window_icon.HasRepresentation(1.0f)) 790 if (window_icon.HasRepresentation(1.0f))
791 SerializeImageRepresentation(window_icon.GetRepresentation(1.0f), &data); 791 SerializeImageRepresentation(window_icon.GetRepresentation(1.0f), &data);
792 792
793 if (app_icon.HasRepresentation(1.0f)) 793 if (app_icon.HasRepresentation(1.0f))
794 SerializeImageRepresentation(app_icon.GetRepresentation(1.0f), &data); 794 SerializeImageRepresentation(app_icon.GetRepresentation(1.0f), &data);
795 795
796 if (data.empty()) 796 if (!data.empty())
797 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("_NET_WM_ICON"));
798 else
799 ui::SetAtomArrayProperty(xwindow_, "_NET_WM_ICON", "CARDINAL", data); 797 ui::SetAtomArrayProperty(xwindow_, "_NET_WM_ICON", "CARDINAL", data);
800 } 798 }
801 799
802 void DesktopWindowTreeHostX11::InitModalType(ui::ModalType modal_type) { 800 void DesktopWindowTreeHostX11::InitModalType(ui::ModalType modal_type) {
803 switch (modal_type) { 801 switch (modal_type) {
804 case ui::MODAL_TYPE_NONE: 802 case ui::MODAL_TYPE_NONE:
805 break; 803 break;
806 default: 804 default:
807 // TODO(erg): Figure out under what situations |modal_type| isn't 805 // TODO(erg): Figure out under what situations |modal_type| isn't
808 // none. The comment in desktop_native_widget_aura.cc suggests that this 806 // none. The comment in desktop_native_widget_aura.cc suggests that this
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 if (linux_ui) { 1985 if (linux_ui) {
1988 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); 1986 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window);
1989 if (native_theme) 1987 if (native_theme)
1990 return native_theme; 1988 return native_theme;
1991 } 1989 }
1992 1990
1993 return ui::NativeTheme::instance(); 1991 return ui::NativeTheme::instance();
1994 } 1992 }
1995 1993
1996 } // namespace views 1994 } // namespace views
OLDNEW
« 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