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

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

Issue 345002: In ~BrowserToolbarGtk, remove notifications we added in the ctor.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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
« 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_toolbar_gtk.h" 5 #include "chrome/browser/gtk/browser_toolbar_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <X11/XF86keysym.h> 8 #include <X11/XF86keysym.h>
9 9
10 #include "app/gfx/gtk_util.h" 10 #include "app/gfx/gtk_util.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 browser_->command_updater()->AddCommandObserver(IDC_RELOAD, this); 86 browser_->command_updater()->AddCommandObserver(IDC_RELOAD, this);
87 browser_->command_updater()->AddCommandObserver(IDC_HOME, this); 87 browser_->command_updater()->AddCommandObserver(IDC_HOME, this);
88 browser_->command_updater()->AddCommandObserver(IDC_BOOKMARK_PAGE, this); 88 browser_->command_updater()->AddCommandObserver(IDC_BOOKMARK_PAGE, this);
89 89
90 registrar_.Add(this, 90 registrar_.Add(this,
91 NotificationType::BROWSER_THEME_CHANGED, 91 NotificationType::BROWSER_THEME_CHANGED,
92 NotificationService::AllSources()); 92 NotificationService::AllSources());
93 } 93 }
94 94
95 BrowserToolbarGtk::~BrowserToolbarGtk() { 95 BrowserToolbarGtk::~BrowserToolbarGtk() {
96 browser_->command_updater()->RemoveCommandObserver(IDC_BACK, this);
97 browser_->command_updater()->RemoveCommandObserver(IDC_FORWARD, this);
98 browser_->command_updater()->RemoveCommandObserver(IDC_RELOAD, this);
99 browser_->command_updater()->RemoveCommandObserver(IDC_HOME, this);
100 browser_->command_updater()->RemoveCommandObserver(IDC_BOOKMARK_PAGE, this);
101
96 offscreen_entry_.Destroy(); 102 offscreen_entry_.Destroy();
97 103
98 // When we created our MenuGtk objects, we pass them a pointer to our accel 104 // When we created our MenuGtk objects, we pass them a pointer to our accel
99 // group. Make sure to tear them down before |accel_group_|. 105 // group. Make sure to tear them down before |accel_group_|.
100 page_menu_.reset(); 106 page_menu_.reset();
101 app_menu_.reset(); 107 app_menu_.reset();
102 page_menu_button_.Destroy(); 108 page_menu_button_.Destroy();
103 app_menu_button_.Destroy(); 109 app_menu_button_.Destroy();
104 g_object_unref(accel_group_); 110 g_object_unref(accel_group_);
105 } 111 }
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 menu->PopupAsFromKeyEvent(button); 696 menu->PopupAsFromKeyEvent(button);
691 menu_bar_helper_.MenuStartedShowing(button, menu->widget()); 697 menu_bar_helper_.MenuStartedShowing(button, menu->widget());
692 } 698 }
693 699
694 void BrowserToolbarGtk::PopupForButtonNextTo(GtkWidget* button, 700 void BrowserToolbarGtk::PopupForButtonNextTo(GtkWidget* button,
695 GtkMenuDirectionType dir) { 701 GtkMenuDirectionType dir) {
696 GtkWidget* other_button = button == page_menu_button_.get() ? 702 GtkWidget* other_button = button == page_menu_button_.get() ?
697 app_menu_button_.get() : page_menu_button_.get(); 703 app_menu_button_.get() : page_menu_button_.get();
698 PopupForButton(other_button); 704 PopupForButton(other_button);
699 } 705 }
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