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

Side by Side Diff: chrome/browser/gtk/browser_window_gtk.cc

Issue 5711001: Add a new GetInstance() method for remaining files with singleton classes under chrome/browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/gtk/browser_window_gtk.h" 5 #include "chrome/browser/gtk/browser_window_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 656
657 // We're going to destroy the window, make sure the tab strip isn't running 657 // We're going to destroy the window, make sure the tab strip isn't running
658 // any animations which may still reference GtkWidgets. 658 // any animations which may still reference GtkWidgets.
659 tabstrip_->StopAnimation(); 659 tabstrip_->StopAnimation();
660 660
661 SaveWindowPosition(); 661 SaveWindowPosition();
662 662
663 if (accel_group_) { 663 if (accel_group_) {
664 // Disconnecting the keys we connected to our accelerator group frees the 664 // Disconnecting the keys we connected to our accelerator group frees the
665 // closures allocated in ConnectAccelerators. 665 // closures allocated in ConnectAccelerators.
666 AcceleratorsGtk* accelerators = Singleton<AcceleratorsGtk>().get(); 666 AcceleratorsGtk* accelerators = AcceleratorsGtk::GetInstance();
667 for (AcceleratorsGtk::const_iterator iter = accelerators->begin(); 667 for (AcceleratorsGtk::const_iterator iter = accelerators->begin();
668 iter != accelerators->end(); ++iter) { 668 iter != accelerators->end(); ++iter) {
669 gtk_accel_group_disconnect_key(accel_group_, 669 gtk_accel_group_disconnect_key(accel_group_,
670 iter->second.GetGdkKeyCode(), 670 iter->second.GetGdkKeyCode(),
671 static_cast<GdkModifierType>(iter->second.modifiers())); 671 static_cast<GdkModifierType>(iter->second.modifiers()));
672 } 672 }
673 gtk_window_remove_accel_group(window_, accel_group_); 673 gtk_window_remove_accel_group(window_, accel_group_);
674 g_object_unref(accel_group_); 674 g_object_unref(accel_group_);
675 accel_group_ = NULL; 675 accel_group_ = NULL;
676 } 676 }
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 gdk_window_shape_combine_region(GTK_WIDGET(window_)->window, NULL, 0, 0); 1714 gdk_window_shape_combine_region(GTK_WIDGET(window_)->window, NULL, 0, 0);
1715 } 1715 }
1716 gtk_alignment_set_padding(GTK_ALIGNMENT(window_container_), 0, 0, 0, 0); 1716 gtk_alignment_set_padding(GTK_ALIGNMENT(window_container_), 0, 0, 0, 0);
1717 } 1717 }
1718 } 1718 }
1719 1719
1720 void BrowserWindowGtk::ConnectAccelerators() { 1720 void BrowserWindowGtk::ConnectAccelerators() {
1721 accel_group_ = gtk_accel_group_new(); 1721 accel_group_ = gtk_accel_group_new();
1722 gtk_window_add_accel_group(window_, accel_group_); 1722 gtk_window_add_accel_group(window_, accel_group_);
1723 1723
1724 AcceleratorsGtk* accelerators = Singleton<AcceleratorsGtk>().get(); 1724 AcceleratorsGtk* accelerators = AcceleratorsGtk::GetInstance();
1725 for (AcceleratorsGtk::const_iterator iter = accelerators->begin(); 1725 for (AcceleratorsGtk::const_iterator iter = accelerators->begin();
1726 iter != accelerators->end(); ++iter) { 1726 iter != accelerators->end(); ++iter) {
1727 gtk_accel_group_connect( 1727 gtk_accel_group_connect(
1728 accel_group_, 1728 accel_group_,
1729 iter->second.GetGdkKeyCode(), 1729 iter->second.GetGdkKeyCode(),
1730 static_cast<GdkModifierType>(iter->second.modifiers()), 1730 static_cast<GdkModifierType>(iter->second.modifiers()),
1731 GtkAccelFlags(0), 1731 GtkAccelFlags(0),
1732 g_cclosure_new(G_CALLBACK(OnGtkAccelerator), 1732 g_cclosure_new(G_CALLBACK(OnGtkAccelerator),
1733 GINT_TO_POINTER(iter->first), NULL)); 1733 GINT_TO_POINTER(iter->first), NULL));
1734 } 1734 }
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
2234 // special-case the ones where the custom frame should be used. These names 2234 // special-case the ones where the custom frame should be used. These names
2235 // are taken from the WMs' source code. 2235 // are taken from the WMs' source code.
2236 return (wm_name == "Blackbox" || 2236 return (wm_name == "Blackbox" ||
2237 wm_name == "compiz" || 2237 wm_name == "compiz" ||
2238 wm_name == "e16" || // Enlightenment DR16 2238 wm_name == "e16" || // Enlightenment DR16
2239 wm_name == "Metacity" || 2239 wm_name == "Metacity" ||
2240 wm_name == "Mutter" || 2240 wm_name == "Mutter" ||
2241 wm_name == "Openbox" || 2241 wm_name == "Openbox" ||
2242 wm_name == "Xfwm4"); 2242 wm_name == "Xfwm4");
2243 } 2243 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698