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/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
6 | 6 |
7 #include "ash/launcher/launcher_types.h" | 7 #include "ash/launcher/launcher_types.h" |
8 #include "ash/magnifier/magnifier_constants.h" | 8 #include "ash/magnifier/magnifier_constants.h" |
9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
10 #include "ash/wm/stacking_controller.h" | 10 #include "ash/wm/stacking_controller.h" |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 return new ash::StackingController; | 532 return new ash::StackingController; |
533 } | 533 } |
534 | 534 |
535 bool ChromeShellDelegate::IsSearchKeyActingAsFunctionKey() const { | 535 bool ChromeShellDelegate::IsSearchKeyActingAsFunctionKey() const { |
536 #if defined(OS_CHROMEOS) | 536 #if defined(OS_CHROMEOS) |
537 bool chromebook_function_key = CommandLine::ForCurrentProcess()->HasSwitch( | 537 bool chromebook_function_key = CommandLine::ForCurrentProcess()->HasSwitch( |
538 switches::kEnableChromebookFunctionKey); | 538 switches::kEnableChromebookFunctionKey); |
539 if (!chromebook_function_key) | 539 if (!chromebook_function_key) |
540 return false; | 540 return false; |
541 | 541 |
| 542 bool chromeos_keyboard = CommandLine::ForCurrentProcess()->HasSwitch( |
| 543 switches::kHasChromeOSKeyboard); |
| 544 if (!chromeos_keyboard) |
| 545 return false; |
| 546 |
542 Profile* profile = ProfileManager::GetDefaultProfile(); | 547 Profile* profile = ProfileManager::GetDefaultProfile(); |
543 return profile->GetPrefs()->GetBoolean( | 548 return profile->GetPrefs()->GetBoolean( |
544 prefs::kLanguageSearchKeyActsAsFunctionKey); | 549 prefs::kLanguageSearchKeyActsAsFunctionKey); |
545 #else | 550 #else |
546 return false; | 551 return false; |
547 #endif | 552 #endif |
548 } | 553 } |
549 | 554 |
550 void ChromeShellDelegate::Observe(int type, | 555 void ChromeShellDelegate::Observe(int type, |
551 const content::NotificationSource& source, | 556 const content::NotificationSource& source, |
552 const content::NotificationDetails& details) { | 557 const content::NotificationDetails& details) { |
553 #if defined(OS_CHROMEOS) | 558 #if defined(OS_CHROMEOS) |
554 switch (type) { | 559 switch (type) { |
555 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: | 560 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: |
556 ash::Shell::GetInstance()->CreateLauncher(); | 561 ash::Shell::GetInstance()->CreateLauncher(); |
557 break; | 562 break; |
558 case chrome::NOTIFICATION_SESSION_STARTED: | 563 case chrome::NOTIFICATION_SESSION_STARTED: |
559 ash::Shell::GetInstance()->ShowLauncher(); | 564 ash::Shell::GetInstance()->ShowLauncher(); |
560 break; | 565 break; |
561 default: | 566 default: |
562 NOTREACHED() << "Unexpected notification " << type; | 567 NOTREACHED() << "Unexpected notification " << type; |
563 } | 568 } |
564 #else | 569 #else |
565 // MSVC++ warns about switch statements without any cases. | 570 // MSVC++ warns about switch statements without any cases. |
566 NOTREACHED() << "Unexpected notification " << type; | 571 NOTREACHED() << "Unexpected notification " << type; |
567 #endif | 572 #endif |
568 } | 573 } |
OLD | NEW |