| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 if ((key_code == ui::VKEY_BROWSER_BACK && command_id == IDC_BACK) || | 280 if ((key_code == ui::VKEY_BROWSER_BACK && command_id == IDC_BACK) || |
| 281 (key_code == ui::VKEY_BROWSER_FORWARD && command_id == IDC_FORWARD) || | 281 (key_code == ui::VKEY_BROWSER_FORWARD && command_id == IDC_FORWARD) || |
| 282 (key_code == ui::VKEY_BROWSER_REFRESH && command_id == IDC_RELOAD)) { | 282 (key_code == ui::VKEY_BROWSER_REFRESH && command_id == IDC_RELOAD)) { |
| 283 return true; | 283 return true; |
| 284 } | 284 } |
| 285 #endif | 285 #endif |
| 286 | 286 |
| 287 if (window()->IsFullscreen() && command_id == IDC_FULLSCREEN) | 287 if (window()->IsFullscreen() && command_id == IDC_FULLSCREEN) |
| 288 return true; | 288 return true; |
| 289 | 289 |
| 290 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(TOOLKIT_GTK) | 290 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 291 // If this key was registered by the user as a content editing hotkey, then | 291 // If this key was registered by the user as a content editing hotkey, then |
| 292 // it is not reserved. | 292 // it is not reserved. |
| 293 ui::TextEditKeyBindingsDelegateAuraLinux* delegate = | 293 ui::TextEditKeyBindingsDelegateAuraLinux* delegate = |
| 294 ui::GetTextEditKeyBindingsDelegate(); | 294 ui::GetTextEditKeyBindingsDelegate(); |
| 295 if (delegate && event.os_event && delegate->MatchEvent(*event.os_event, NULL)) | 295 if (delegate && event.os_event && delegate->MatchEvent(*event.os_event, NULL)) |
| 296 return false; | 296 return false; |
| 297 #endif | 297 #endif |
| 298 | 298 |
| 299 return command_id == IDC_CLOSE_TAB || | 299 return command_id == IDC_CLOSE_TAB || |
| 300 command_id == IDC_CLOSE_WINDOW || | 300 command_id == IDC_CLOSE_WINDOW || |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 // mechanism to pass accelerators back into Ash. http://crbug.com/285308 | 477 // mechanism to pass accelerators back into Ash. http://crbug.com/285308 |
| 478 #endif | 478 #endif |
| 479 | 479 |
| 480 #if defined(OS_CHROMEOS) | 480 #if defined(OS_CHROMEOS) |
| 481 case IDC_VISIT_DESKTOP_OF_LRU_USER_2: | 481 case IDC_VISIT_DESKTOP_OF_LRU_USER_2: |
| 482 case IDC_VISIT_DESKTOP_OF_LRU_USER_3: | 482 case IDC_VISIT_DESKTOP_OF_LRU_USER_3: |
| 483 ExecuteVisitDesktopCommand(id, browser_->window()->GetNativeWindow()); | 483 ExecuteVisitDesktopCommand(id, browser_->window()->GetNativeWindow()); |
| 484 break; | 484 break; |
| 485 #endif | 485 #endif |
| 486 | 486 |
| 487 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(TOOLKIT_GTK) | 487 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 488 case IDC_USE_SYSTEM_TITLE_BAR: { | 488 case IDC_USE_SYSTEM_TITLE_BAR: { |
| 489 PrefService* prefs = browser_->profile()->GetPrefs(); | 489 PrefService* prefs = browser_->profile()->GetPrefs(); |
| 490 prefs->SetBoolean(prefs::kUseCustomChromeFrame, | 490 prefs->SetBoolean(prefs::kUseCustomChromeFrame, |
| 491 !prefs->GetBoolean(prefs::kUseCustomChromeFrame)); | 491 !prefs->GetBoolean(prefs::kUseCustomChromeFrame)); |
| 492 break; | 492 break; |
| 493 } | 493 } |
| 494 #endif | 494 #endif |
| 495 | 495 |
| 496 #if defined(OS_WIN) | 496 #if defined(OS_WIN) |
| 497 // Windows 8 specific commands. | 497 // Windows 8 specific commands. |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 chrome::HOST_DESKTOP_TYPE_NATIVE != chrome::HOST_DESKTOP_TYPE_ASH) | 907 chrome::HOST_DESKTOP_TYPE_NATIVE != chrome::HOST_DESKTOP_TYPE_ASH) |
| 908 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_ASH_DESKTOP, true); | 908 command_updater_.UpdateCommandEnabled(IDC_TOGGLE_ASH_DESKTOP, true); |
| 909 #endif | 909 #endif |
| 910 #if defined(USE_ASH) | 910 #if defined(USE_ASH) |
| 911 command_updater_.UpdateCommandEnabled(IDC_MINIMIZE_WINDOW, true); | 911 command_updater_.UpdateCommandEnabled(IDC_MINIMIZE_WINDOW, true); |
| 912 #endif | 912 #endif |
| 913 #if defined(OS_CHROMEOS) | 913 #if defined(OS_CHROMEOS) |
| 914 command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_2, true); | 914 command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_2, true); |
| 915 command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_3, true); | 915 command_updater_.UpdateCommandEnabled(IDC_VISIT_DESKTOP_OF_LRU_USER_3, true); |
| 916 #endif | 916 #endif |
| 917 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(TOOLKIT_GTK) | 917 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 918 command_updater_.UpdateCommandEnabled(IDC_USE_SYSTEM_TITLE_BAR, true); | 918 command_updater_.UpdateCommandEnabled(IDC_USE_SYSTEM_TITLE_BAR, true); |
| 919 #endif | 919 #endif |
| 920 | 920 |
| 921 // Page-related commands | 921 // Page-related commands |
| 922 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); | 922 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); |
| 923 command_updater_.UpdateCommandEnabled(IDC_BOOKMARK_PAGE_FROM_STAR, true); | 923 command_updater_.UpdateCommandEnabled(IDC_BOOKMARK_PAGE_FROM_STAR, true); |
| 924 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); | 924 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); |
| 925 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); | 925 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); |
| 926 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true); | 926 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true); |
| 927 command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88591, true); | 927 command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88591, true); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1365 | 1365 |
| 1366 BrowserWindow* BrowserCommandController::window() { | 1366 BrowserWindow* BrowserCommandController::window() { |
| 1367 return browser_->window(); | 1367 return browser_->window(); |
| 1368 } | 1368 } |
| 1369 | 1369 |
| 1370 Profile* BrowserCommandController::profile() { | 1370 Profile* BrowserCommandController::profile() { |
| 1371 return browser_->profile(); | 1371 return browser_->profile(); |
| 1372 } | 1372 } |
| 1373 | 1373 |
| 1374 } // namespace chrome | 1374 } // namespace chrome |
| OLD | NEW |