| 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/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
| 9 #include "ash/wm/stacking_controller.h" | 9 #include "ash/wm/stacking_controller.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 return new ash::StackingController; | 493 return new ash::StackingController; |
| 494 } | 494 } |
| 495 | 495 |
| 496 bool ChromeShellDelegate::IsSearchKeyActingAsFunctionKey() const { | 496 bool ChromeShellDelegate::IsSearchKeyActingAsFunctionKey() const { |
| 497 #if defined(OS_CHROMEOS) | 497 #if defined(OS_CHROMEOS) |
| 498 bool chromebook_function_key = CommandLine::ForCurrentProcess()->HasSwitch( | 498 bool chromebook_function_key = CommandLine::ForCurrentProcess()->HasSwitch( |
| 499 switches::kEnableChromebookFunctionKey); | 499 switches::kEnableChromebookFunctionKey); |
| 500 if (!chromebook_function_key) | 500 if (!chromebook_function_key) |
| 501 return false; | 501 return false; |
| 502 | 502 |
| 503 bool chromeos_keyboard = CommandLine::ForCurrentProcess()->HasSwitch( |
| 504 switches::kHasChromeOSKeyboard); |
| 505 if (!chromeos_keyboard) |
| 506 return false; |
| 507 |
| 503 Profile* profile = ProfileManager::GetDefaultProfile(); | 508 Profile* profile = ProfileManager::GetDefaultProfile(); |
| 504 return profile->GetPrefs()->GetBoolean( | 509 return profile->GetPrefs()->GetBoolean( |
| 505 prefs::kLanguageSearchKeyActsAsFunctionKey); | 510 prefs::kLanguageSearchKeyActsAsFunctionKey); |
| 506 #else | 511 #else |
| 507 return false; | 512 return false; |
| 508 #endif | 513 #endif |
| 509 } | 514 } |
| 510 | 515 |
| 511 void ChromeShellDelegate::Observe(int type, | 516 void ChromeShellDelegate::Observe(int type, |
| 512 const content::NotificationSource& source, | 517 const content::NotificationSource& source, |
| 513 const content::NotificationDetails& details) { | 518 const content::NotificationDetails& details) { |
| 514 #if defined(OS_CHROMEOS) | 519 #if defined(OS_CHROMEOS) |
| 515 switch (type) { | 520 switch (type) { |
| 516 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: | 521 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: |
| 517 ash::Shell::GetInstance()->CreateLauncher(); | 522 ash::Shell::GetInstance()->CreateLauncher(); |
| 518 break; | 523 break; |
| 519 case chrome::NOTIFICATION_SESSION_STARTED: | 524 case chrome::NOTIFICATION_SESSION_STARTED: |
| 520 ash::Shell::GetInstance()->ShowLauncher(); | 525 ash::Shell::GetInstance()->ShowLauncher(); |
| 521 break; | 526 break; |
| 522 default: | 527 default: |
| 523 NOTREACHED() << "Unexpected notification " << type; | 528 NOTREACHED() << "Unexpected notification " << type; |
| 524 } | 529 } |
| 525 #else | 530 #else |
| 526 // MSVC++ warns about switch statements without any cases. | 531 // MSVC++ warns about switch statements without any cases. |
| 527 NOTREACHED() << "Unexpected notification " << type; | 532 NOTREACHED() << "Unexpected notification " << type; |
| 528 #endif | 533 #endif |
| 529 } | 534 } |
| OLD | NEW |