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

Side by Side Diff: chrome/browser/ui/gtk/task_manager_gtk.cc

Issue 6735032: Get rid of PrefService::GetMutableDictionary/GetMutableList (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another windows compile error Created 9 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/auto_reset.h" 14 #include "base/auto_reset.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/utf_string_conversions.h" 17 #include "base/utf_string_conversions.h"
18 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
19 #include "chrome/browser/defaults.h" 19 #include "chrome/browser/defaults.h"
20 #include "chrome/browser/memory_purger.h" 20 #include "chrome/browser/memory_purger.h"
21 #include "chrome/browser/prefs/pref_service.h" 21 #include "chrome/browser/prefs/pref_service.h"
22 #include "chrome/browser/prefs/scoped_user_pref_update.h"
22 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" 23 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h"
23 #include "chrome/browser/ui/gtk/gtk_theme_service.h" 24 #include "chrome/browser/ui/gtk/gtk_theme_service.h"
24 #include "chrome/browser/ui/gtk/gtk_tree.h" 25 #include "chrome/browser/ui/gtk/gtk_tree.h"
25 #include "chrome/browser/ui/gtk/gtk_util.h" 26 #include "chrome/browser/ui/gtk/gtk_util.h"
26 #include "chrome/common/chrome_switches.h" 27 #include "chrome/common/chrome_switches.h"
27 #include "chrome/common/pref_names.h" 28 #include "chrome/common/pref_names.h"
28 #include "grit/app_resources.h" 29 #include "grit/app_resources.h"
29 #include "grit/chromium_strings.h" 30 #include "grit/chromium_strings.h"
30 #include "third_party/skia/include/core/SkBitmap.h" 31 #include "third_party/skia/include/core/SkBitmap.h"
31 #include "ui/base/l10n/l10n_util.h" 32 #include "ui/base/l10n/l10n_util.h"
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 instance_ = NULL; 857 instance_ = NULL;
857 delete this; 858 delete this;
858 } 859 }
859 860
860 void TaskManagerGtk::OnResponse(GtkWidget* dialog, int response_id) { 861 void TaskManagerGtk::OnResponse(GtkWidget* dialog, int response_id) {
861 if (response_id == GTK_RESPONSE_DELETE_EVENT) { 862 if (response_id == GTK_RESPONSE_DELETE_EVENT) {
862 // Store the dialog's size so we can restore it the next time it's opened. 863 // Store the dialog's size so we can restore it the next time it's opened.
863 if (g_browser_process->local_state()) { 864 if (g_browser_process->local_state()) {
864 gfx::Rect dialog_bounds = gtk_util::GetDialogBounds(GTK_WIDGET(dialog)); 865 gfx::Rect dialog_bounds = gtk_util::GetDialogBounds(GTK_WIDGET(dialog));
865 866
866 DictionaryValue* placement_pref = 867 DictionaryPrefUpdate update(g_browser_process->local_state(),
867 g_browser_process->local_state()->GetMutableDictionary( 868 prefs::kTaskManagerWindowPlacement);
868 prefs::kTaskManagerWindowPlacement); 869 DictionaryValue* placement_pref = update.Get();
869 // Note that we store left/top for consistency with Windows, but that we 870 // Note that we store left/top for consistency with Windows, but that we
870 // *don't* restore them. 871 // *don't* restore them.
871 placement_pref->SetInteger("left", dialog_bounds.x()); 872 placement_pref->SetInteger("left", dialog_bounds.x());
872 placement_pref->SetInteger("top", dialog_bounds.y()); 873 placement_pref->SetInteger("top", dialog_bounds.y());
873 placement_pref->SetInteger("right", dialog_bounds.right()); 874 placement_pref->SetInteger("right", dialog_bounds.right());
874 placement_pref->SetInteger("bottom", dialog_bounds.bottom()); 875 placement_pref->SetInteger("bottom", dialog_bounds.bottom());
875 placement_pref->SetBoolean("maximized", false); 876 placement_pref->SetBoolean("maximized", false);
876 } 877 }
877 878
878 instance_ = NULL; 879 instance_ = NULL;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 guint keyval, 986 guint keyval,
986 GdkModifierType modifier) { 987 GdkModifierType modifier) {
987 if (keyval == GDK_w && modifier == GDK_CONTROL_MASK) { 988 if (keyval == GDK_w && modifier == GDK_CONTROL_MASK) {
988 // The GTK_RESPONSE_DELETE_EVENT response must be sent before the widget 989 // The GTK_RESPONSE_DELETE_EVENT response must be sent before the widget
989 // is destroyed. The deleted object will receive gtk signals otherwise. 990 // is destroyed. The deleted object will receive gtk signals otherwise.
990 gtk_dialog_response(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT); 991 gtk_dialog_response(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT);
991 } 992 }
992 993
993 return TRUE; 994 return TRUE;
994 } 995 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/browser_window_gtk.cc ('k') | chrome/browser/ui/views/chrome_views_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698