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

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

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « chrome/browser/ui/gtk/browser_titlebar.cc ('k') | chrome/browser/ui/gtk/browser_window_gtk.cc » ('j') | 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) 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/browser_toolbar_gtk.h" 5 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h"
6 6
7 #include <X11/XF86keysym.h> 7 #include <X11/XF86keysym.h>
8 #include <gdk/gdkkeysyms.h> 8 #include <gdk/gdkkeysyms.h>
9 #include <gtk/gtk.h> 9 #include <gtk/gtk.h>
10 10
(...skipping 26 matching lines...) Expand all
37 #include "chrome/browser/ui/gtk/rounded_window.h" 37 #include "chrome/browser/ui/gtk/rounded_window.h"
38 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" 38 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h"
39 #include "chrome/browser/ui/gtk/view_id_util.h" 39 #include "chrome/browser/ui/gtk/view_id_util.h"
40 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" 40 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
41 #include "chrome/browser/upgrade_detector.h" 41 #include "chrome/browser/upgrade_detector.h"
42 #include "chrome/common/chrome_notification_types.h" 42 #include "chrome/common/chrome_notification_types.h"
43 #include "chrome/common/pref_names.h" 43 #include "chrome/common/pref_names.h"
44 #include "chrome/common/url_constants.h" 44 #include "chrome/common/url_constants.h"
45 #include "content/browser/tab_contents/tab_contents.h" 45 #include "content/browser/tab_contents/tab_contents.h"
46 #include "content/browser/user_metrics.h" 46 #include "content/browser/user_metrics.h"
47 #include "content/common/notification_service.h" 47 #include "content/public/browser/notification_service.h"
48 #include "content/public/browser/notification_details.h" 48 #include "content/public/browser/notification_details.h"
49 #include "grit/chromium_strings.h" 49 #include "grit/chromium_strings.h"
50 #include "grit/generated_resources.h" 50 #include "grit/generated_resources.h"
51 #include "grit/theme_resources.h" 51 #include "grit/theme_resources.h"
52 #include "grit/theme_resources_standard.h" 52 #include "grit/theme_resources_standard.h"
53 #include "ui/base/dragdrop/gtk_dnd_util.h" 53 #include "ui/base/dragdrop/gtk_dnd_util.h"
54 #include "ui/base/l10n/l10n_util.h" 54 #include "ui/base/l10n/l10n_util.h"
55 #include "ui/base/models/accelerator_gtk.h" 55 #include "ui/base/models/accelerator_gtk.h"
56 #include "ui/gfx/canvas_skia_paint.h" 56 #include "ui/gfx/canvas_skia_paint.h"
57 #include "ui/gfx/gtk_util.h" 57 #include "ui/gfx/gtk_util.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 window_(window) { 95 window_(window) {
96 wrench_menu_model_.reset(new WrenchMenuModel(this, browser_)); 96 wrench_menu_model_.reset(new WrenchMenuModel(this, browser_));
97 97
98 browser_->command_updater()->AddCommandObserver(IDC_BACK, this); 98 browser_->command_updater()->AddCommandObserver(IDC_BACK, this);
99 browser_->command_updater()->AddCommandObserver(IDC_FORWARD, this); 99 browser_->command_updater()->AddCommandObserver(IDC_FORWARD, this);
100 browser_->command_updater()->AddCommandObserver(IDC_HOME, this); 100 browser_->command_updater()->AddCommandObserver(IDC_HOME, this);
101 browser_->command_updater()->AddCommandObserver(IDC_BOOKMARK_PAGE, this); 101 browser_->command_updater()->AddCommandObserver(IDC_BOOKMARK_PAGE, this);
102 102
103 registrar_.Add(this, 103 registrar_.Add(this,
104 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, 104 chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
105 NotificationService::AllSources()); 105 content::NotificationService::AllSources());
106 registrar_.Add(this, 106 registrar_.Add(this,
107 chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED, 107 chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED,
108 content::Source<Profile>(browser_->profile())); 108 content::Source<Profile>(browser_->profile()));
109 } 109 }
110 110
111 BrowserToolbarGtk::~BrowserToolbarGtk() { 111 BrowserToolbarGtk::~BrowserToolbarGtk() {
112 browser_->command_updater()->RemoveCommandObserver(IDC_BACK, this); 112 browser_->command_updater()->RemoveCommandObserver(IDC_BACK, this);
113 browser_->command_updater()->RemoveCommandObserver(IDC_FORWARD, this); 113 browser_->command_updater()->RemoveCommandObserver(IDC_FORWARD, this);
114 browser_->command_updater()->RemoveCommandObserver(IDC_HOME, this); 114 browser_->command_updater()->RemoveCommandObserver(IDC_HOME, this);
115 browser_->command_updater()->RemoveCommandObserver(IDC_BOOKMARK_PAGE, this); 115 browser_->command_updater()->RemoveCommandObserver(IDC_BOOKMARK_PAGE, this);
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 int x_offset = base::i18n::IsRTL() ? 0 : 665 int x_offset = base::i18n::IsRTL() ? 0 :
666 sender->allocation.width - badge->width(); 666 sender->allocation.width - badge->width();
667 int y_offset = 0; 667 int y_offset = 0;
668 canvas.DrawBitmapInt( 668 canvas.DrawBitmapInt(
669 *badge, 669 *badge,
670 sender->allocation.x + x_offset, 670 sender->allocation.x + x_offset,
671 sender->allocation.y + y_offset); 671 sender->allocation.y + y_offset);
672 672
673 return FALSE; 673 return FALSE;
674 } 674 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/browser_titlebar.cc ('k') | chrome/browser/ui/gtk/browser_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698