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

Side by Side Diff: chrome/browser/ui/toolbar/wrench_menu_model.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
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/toolbar/wrench_menu_model.h" 5 #include "chrome/browser/ui/toolbar/wrench_menu_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/ui/global_error_service.h" 28 #include "chrome/browser/ui/global_error_service.h"
29 #include "chrome/browser/ui/global_error_service_factory.h" 29 #include "chrome/browser/ui/global_error_service_factory.h"
30 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" 30 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
31 #include "chrome/browser/upgrade_detector.h" 31 #include "chrome/browser/upgrade_detector.h"
32 #include "chrome/common/chrome_paths.h" 32 #include "chrome/common/chrome_paths.h"
33 #include "chrome/common/chrome_switches.h" 33 #include "chrome/common/chrome_switches.h"
34 #include "chrome/common/pref_names.h" 34 #include "chrome/common/pref_names.h"
35 #include "chrome/common/profiling.h" 35 #include "chrome/common/profiling.h"
36 #include "content/browser/tab_contents/tab_contents.h" 36 #include "content/browser/tab_contents/tab_contents.h"
37 #include "content/browser/user_metrics.h" 37 #include "content/browser/user_metrics.h"
38 #include "content/common/notification_service.h" 38 #include "content/public/browser/notification_service.h"
39 #include "content/public/browser/notification_source.h" 39 #include "content/public/browser/notification_source.h"
40 #include "content/public/browser/notification_types.h" 40 #include "content/public/browser/notification_types.h"
41 #include "grit/chromium_strings.h" 41 #include "grit/chromium_strings.h"
42 #include "grit/generated_resources.h" 42 #include "grit/generated_resources.h"
43 #include "grit/theme_resources.h" 43 #include "grit/theme_resources.h"
44 #include "ui/base/l10n/l10n_util.h" 44 #include "ui/base/l10n/l10n_util.h"
45 #include "ui/base/models/button_menu_item_model.h" 45 #include "ui/base/models/button_menu_item_model.h"
46 #include "ui/base/resource/resource_bundle.h" 46 #include "ui/base/resource/resource_bundle.h"
47 #include "ui/gfx/image/image.h" 47 #include "ui/gfx/image/image.h"
48 48
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 tabstrip_model_(browser_->tabstrip_model()) { 204 tabstrip_model_(browser_->tabstrip_model()) {
205 Build(); 205 Build();
206 UpdateZoomControls(); 206 UpdateZoomControls();
207 207
208 tabstrip_model_->AddObserver(this); 208 tabstrip_model_->AddObserver(this);
209 209
210 registrar_.Add( 210 registrar_.Add(
211 this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, 211 this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
212 content::Source<HostZoomMap>(browser_->profile()->GetHostZoomMap())); 212 content::Source<HostZoomMap>(browser_->profile()->GetHostZoomMap()));
213 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, 213 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
214 NotificationService::AllSources()); 214 content::NotificationService::AllSources());
215 } 215 }
216 216
217 WrenchMenuModel::~WrenchMenuModel() { 217 WrenchMenuModel::~WrenchMenuModel() {
218 if (tabstrip_model_) 218 if (tabstrip_model_)
219 tabstrip_model_->RemoveObserver(this); 219 tabstrip_model_->RemoveObserver(this);
220 } 220 }
221 221
222 bool WrenchMenuModel::DoesCommandIdDismissMenu(int command_id) const { 222 bool WrenchMenuModel::DoesCommandIdDismissMenu(int command_id) const {
223 return command_id != IDC_ZOOM_MINUS && command_id != IDC_ZOOM_PLUS; 223 return command_id != IDC_ZOOM_MINUS && command_id != IDC_ZOOM_PLUS;
224 } 224 }
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 &enable_increment, &enable_decrement); 595 &enable_increment, &enable_decrement);
596 } 596 }
597 zoom_label_ = l10n_util::GetStringFUTF16( 597 zoom_label_ = l10n_util::GetStringFUTF16(
598 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); 598 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent));
599 } 599 }
600 600
601 string16 WrenchMenuModel::GetSyncMenuLabel() const { 601 string16 WrenchMenuModel::GetSyncMenuLabel() const {
602 return sync_ui_util::GetSyncMenuLabel( 602 return sync_ui_util::GetSyncMenuLabel(
603 browser_->profile()->GetOriginalProfile()->GetProfileSyncService()); 603 browser_->profile()->GetOriginalProfile()->GetProfileSyncService());
604 } 604 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698