OLD | NEW |
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 "chrome/browser/ui/gtk/task_manager_gtk.h" | 5 #include "chrome/browser/ui/gtk/task_manager_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 return std::string(); | 712 return std::string(); |
713 } | 713 } |
714 } | 714 } |
715 | 715 |
716 GdkPixbuf* TaskManagerGtk::GetModelIcon(int row) { | 716 GdkPixbuf* TaskManagerGtk::GetModelIcon(int row) { |
717 SkBitmap icon = model_->GetResourceIcon(row); | 717 SkBitmap icon = model_->GetResourceIcon(row); |
718 if (icon.pixelRef() == | 718 if (icon.pixelRef() == |
719 ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( | 719 ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( |
720 IDR_DEFAULT_FAVICON)->pixelRef()) { | 720 IDR_DEFAULT_FAVICON)->pixelRef()) { |
721 return static_cast<GdkPixbuf*>(g_object_ref( | 721 return static_cast<GdkPixbuf*>(g_object_ref( |
722 GtkThemeService::GetDefaultFavicon(true)->ToGdkPixbuf())); | 722 GtkThemeService::GetDefaultFavicon(true).ToGdkPixbuf())); |
723 } | 723 } |
724 | 724 |
725 return gfx::GdkPixbufFromSkBitmap(icon); | 725 return gfx::GdkPixbufFromSkBitmap(icon); |
726 } | 726 } |
727 | 727 |
728 void TaskManagerGtk::SetRowDataFromModel(int row, GtkTreeIter* iter) { | 728 void TaskManagerGtk::SetRowDataFromModel(int row, GtkTreeIter* iter) { |
729 GdkPixbuf* icon = GetModelIcon(row); | 729 GdkPixbuf* icon = GetModelIcon(row); |
730 std::string task = GetModelText(row, IDS_TASK_MANAGER_TASK_COLUMN); | 730 std::string task = GetModelText(row, IDS_TASK_MANAGER_TASK_COLUMN); |
731 std::string profile_name = | 731 std::string profile_name = |
732 GetModelText(row, IDS_TASK_MANAGER_PROFILE_NAME_COLUMN); | 732 GetModelText(row, IDS_TASK_MANAGER_PROFILE_NAME_COLUMN); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 guint keyval, | 967 guint keyval, |
968 GdkModifierType modifier) { | 968 GdkModifierType modifier) { |
969 if (keyval == GDK_w && modifier == GDK_CONTROL_MASK) { | 969 if (keyval == GDK_w && modifier == GDK_CONTROL_MASK) { |
970 // The GTK_RESPONSE_DELETE_EVENT response must be sent before the widget | 970 // The GTK_RESPONSE_DELETE_EVENT response must be sent before the widget |
971 // is destroyed. The deleted object will receive gtk signals otherwise. | 971 // is destroyed. The deleted object will receive gtk signals otherwise. |
972 gtk_dialog_response(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT); | 972 gtk_dialog_response(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT); |
973 } | 973 } |
974 | 974 |
975 return TRUE; | 975 return TRUE; |
976 } | 976 } |
OLD | NEW |