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

Side by Side Diff: chrome/browser/wrench_menu_model.cc

Issue 4524002: First cut of the about:conflicts page, listing all DLLs loaded in the Chrome ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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
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/wrench_menu_model.h" 5 #include "chrome/browser/wrench_menu_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 #if defined(OS_MACOSX) 43 #if defined(OS_MACOSX)
44 #include "chrome/browser/browser_window.h" 44 #include "chrome/browser/browser_window.h"
45 #endif 45 #endif
46 46
47 #if defined(OS_CHROMEOS) 47 #if defined(OS_CHROMEOS)
48 #include "chrome/browser/chromeos/cros/cros_library.h" 48 #include "chrome/browser/chromeos/cros/cros_library.h"
49 #include "chrome/browser/chromeos/cros/update_library.h" 49 #include "chrome/browser/chromeos/cros/update_library.h"
50 #endif 50 #endif
51 51
52 #if defined(OS_WIN)
53 #include "chrome/browser/enumerate_modules_model_win.h"
54 #endif
55
52 //////////////////////////////////////////////////////////////////////////////// 56 ////////////////////////////////////////////////////////////////////////////////
53 // EncodingMenuModel 57 // EncodingMenuModel
54 58
55 EncodingMenuModel::EncodingMenuModel(Browser* browser) 59 EncodingMenuModel::EncodingMenuModel(Browser* browser)
56 : ALLOW_THIS_IN_INITIALIZER_LIST(menus::SimpleMenuModel(this)), 60 : ALLOW_THIS_IN_INITIALIZER_LIST(menus::SimpleMenuModel(this)),
57 browser_(browser) { 61 browser_(browser) {
58 Build(); 62 Build();
59 } 63 }
60 64
61 EncodingMenuModel::~EncodingMenuModel() { 65 EncodingMenuModel::~EncodingMenuModel() {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 } 267 }
264 268
265 bool WrenchMenuModel::IsCommandIdVisible(int command_id) const { 269 bool WrenchMenuModel::IsCommandIdVisible(int command_id) const {
266 if (command_id == IDC_UPGRADE_DIALOG) { 270 if (command_id == IDC_UPGRADE_DIALOG) {
267 #if defined(OS_CHROMEOS) 271 #if defined(OS_CHROMEOS)
268 return (chromeos::CrosLibrary::Get()->GetUpdateLibrary()->status().status 272 return (chromeos::CrosLibrary::Get()->GetUpdateLibrary()->status().status
269 == chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT); 273 == chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT);
270 #else 274 #else
271 return Singleton<UpgradeDetector>::get()->notify_upgrade(); 275 return Singleton<UpgradeDetector>::get()->notify_upgrade();
272 #endif 276 #endif
277 } else if (command_id == IDC_VIEW_INCOMPATIBILITIES) {
278 #if defined(OS_WIN)
279 EnumerateModulesModel* loaded_modules =
280 EnumerateModulesModel::GetSingleton();
281 return loaded_modules->confirmed_bad_modules_detected() > 0;
282 #else
283 return false;
284 #endif
273 } 285 }
286
274 return true; 287 return true;
275 } 288 }
276 289
277 bool WrenchMenuModel::GetAcceleratorForCommandId( 290 bool WrenchMenuModel::GetAcceleratorForCommandId(
278 int command_id, 291 int command_id,
279 menus::Accelerator* accelerator) { 292 menus::Accelerator* accelerator) {
280 return provider_->GetAcceleratorForCommandId(command_id, accelerator); 293 return provider_->GetAcceleratorForCommandId(command_id, accelerator);
281 } 294 }
282 295
283 void WrenchMenuModel::TabSelectedAt(TabContents* old_contents, 296 void WrenchMenuModel::TabSelectedAt(TabContents* old_contents,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 const string16 product_name = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); 413 const string16 product_name = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
401 #endif 414 #endif
402 // On Mac, there is no About item. 415 // On Mac, there is no About item.
403 if (browser_defaults::kShowAboutMenuItem) { 416 if (browser_defaults::kShowAboutMenuItem) {
404 AddItem(IDC_ABOUT, l10n_util::GetStringFUTF16( 417 AddItem(IDC_ABOUT, l10n_util::GetStringFUTF16(
405 IDS_ABOUT, product_name)); 418 IDS_ABOUT, product_name));
406 } 419 }
407 420
408 AddItem(IDC_UPGRADE_DIALOG, l10n_util::GetStringFUTF16( 421 AddItem(IDC_UPGRADE_DIALOG, l10n_util::GetStringFUTF16(
409 IDS_UPDATE_NOW, product_name)); 422 IDS_UPDATE_NOW, product_name));
423 AddItem(IDC_VIEW_INCOMPATIBILITIES, l10n_util::GetStringUTF16(
424 IDS_VIEW_INCOMPATIBILITIES));
425
410 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 426 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
411 SetIcon(GetIndexOfCommandId(IDC_UPGRADE_DIALOG), 427 SetIcon(GetIndexOfCommandId(IDC_UPGRADE_DIALOG),
412 *rb.GetBitmapNamed(IDR_UPDATE_AVAILABLE)); 428 *rb.GetBitmapNamed(IDR_UPDATE_AVAILABLE));
413 429
414 AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); 430 AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE);
415 if (browser_defaults::kShowExitMenuItem) { 431 if (browser_defaults::kShowExitMenuItem) {
416 AddSeparator(); 432 AddSeparator();
417 #if defined(OS_CHROMEOS) 433 #if defined(OS_CHROMEOS)
418 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { 434 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) {
419 AddItemWithStringId(IDC_EXIT, IDS_EXIT_GUEST_MODE); 435 AddItemWithStringId(IDC_EXIT, IDS_EXIT_GUEST_MODE);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 &enable_increment, &enable_decrement); 467 &enable_increment, &enable_decrement);
452 } 468 }
453 zoom_label_ = l10n_util::GetStringFUTF16( 469 zoom_label_ = l10n_util::GetStringFUTF16(
454 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); 470 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent));
455 } 471 }
456 472
457 string16 WrenchMenuModel::GetSyncMenuLabel() const { 473 string16 WrenchMenuModel::GetSyncMenuLabel() const {
458 return sync_ui_util::GetSyncMenuLabel( 474 return sync_ui_util::GetSyncMenuLabel(
459 browser_->profile()->GetOriginalProfile()->GetProfileSyncService()); 475 browser_->profile()->GetOriginalProfile()->GetProfileSyncService());
460 } 476 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698