OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_command_controller.h" | 5 #include "chrome/browser/ui/browser_command_controller.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
467 // mechanism to pass accelerators back into Ash. http://crbug.com/285308 | 467 // mechanism to pass accelerators back into Ash. http://crbug.com/285308 |
468 #endif | 468 #endif |
469 | 469 |
470 #if defined(OS_CHROMEOS) | 470 #if defined(OS_CHROMEOS) |
471 case IDC_VISIT_DESKTOP_OF_LRU_USER_2: | 471 case IDC_VISIT_DESKTOP_OF_LRU_USER_2: |
472 case IDC_VISIT_DESKTOP_OF_LRU_USER_3: | 472 case IDC_VISIT_DESKTOP_OF_LRU_USER_3: |
473 ExecuteVisitDesktopCommand(id, browser_->window()->GetNativeWindow()); | 473 ExecuteVisitDesktopCommand(id, browser_->window()->GetNativeWindow()); |
474 break; | 474 break; |
475 #endif | 475 #endif |
476 | 476 |
477 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | |
msw
2014/02/06 00:50:27
nit: && !defined(TOOLKIT_GTK)?
Matt Giuca
2014/02/11 04:57:43
Done.
| |
478 case IDC_USE_SYSTEM_TITLE_BAR: { | |
479 PrefService* prefs = browser_->profile()->GetPrefs(); | |
480 prefs->SetBoolean(prefs::kUseCustomChromeFrame, | |
481 !prefs->GetBoolean(prefs::kUseCustomChromeFrame)); | |
482 break; | |
483 } | |
484 #endif | |
485 | |
477 #if defined(OS_WIN) | 486 #if defined(OS_WIN) |
478 // Windows 8 specific commands. | 487 // Windows 8 specific commands. |
479 case IDC_METRO_SNAP_ENABLE: | 488 case IDC_METRO_SNAP_ENABLE: |
480 browser_->SetMetroSnapMode(true); | 489 browser_->SetMetroSnapMode(true); |
481 break; | 490 break; |
482 case IDC_METRO_SNAP_DISABLE: | 491 case IDC_METRO_SNAP_DISABLE: |
483 browser_->SetMetroSnapMode(false); | 492 browser_->SetMetroSnapMode(false); |
484 break; | 493 break; |
485 case IDC_WIN8_DESKTOP_RESTART: | 494 case IDC_WIN8_DESKTOP_RESTART: |
486 if (!VerifyMetroSwitchForApps(window()->GetNativeWindow(), id)) | 495 if (!VerifyMetroSwitchForApps(window()->GetNativeWindow(), id)) |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
888 chrome::HOST_DESKTOP_TYPE_NATIVE != chrome::HOST_DESKTOP_TYPE_ASH) | 897 chrome::HOST_DESKTOP_TYPE_NATIVE != chrome::HOST_DESKTOP_TYPE_ASH) |
889 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_ASH_DESKTOP, true); | 898 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_ASH_DESKTOP, true); |
890 #endif | 899 #endif |
891 #if defined(USE_ASH) | 900 #if defined(USE_ASH) |
892 command_updater_.UpdateCommandEnabled(IDC_MINIMIZE_WINDOW, true); | 901 command_updater_.UpdateCommandEnabled(IDC_MINIMIZE_WINDOW, true); |
893 #endif | 902 #endif |
894 #if defined(OS_CHROMEOS) | 903 #if defined(OS_CHROMEOS) |
895 command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_2, true); | 904 command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_2, true); |
896 command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_3, true); | 905 command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_3, true); |
897 #endif | 906 #endif |
907 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | |
msw
2014/02/06 00:50:27
nit: && !defined(TOOLKIT_GTK)?
Matt Giuca
2014/02/11 04:57:43
Done.
| |
908 command_updater_.UpdateCommandEnabled(IDC_USE_SYSTEM_TITLE_BAR, true); | |
909 #endif | |
898 | 910 |
899 // Page-related commands | 911 // Page-related commands |
900 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); | 912 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); |
901 command_updater_.UpdateCommandEnabled(IDC_BOOKMARK_PAGE_FROM_STAR, true); | 913 command_updater_.UpdateCommandEnabled(IDC_BOOKMARK_PAGE_FROM_STAR, true); |
902 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); | 914 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); |
903 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); | 915 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); |
904 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true); | 916 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true); |
905 command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88591, true); | 917 command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88591, true); |
906 command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1252, true); | 918 command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1252, true); |
907 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GBK, true); | 919 command_updater_.UpdateCommandEnabled(IDC_ENCODING_GBK, true); |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1340 | 1352 |
1341 BrowserWindow* BrowserCommandController::window() { | 1353 BrowserWindow* BrowserCommandController::window() { |
1342 return browser_->window(); | 1354 return browser_->window(); |
1343 } | 1355 } |
1344 | 1356 |
1345 Profile* BrowserCommandController::profile() { | 1357 Profile* BrowserCommandController::profile() { |
1346 return browser_->profile(); | 1358 return browser_->profile(); |
1347 } | 1359 } |
1348 | 1360 |
1349 } // namespace chrome | 1361 } // namespace chrome |
OLD | NEW |