| 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 "apps/native_app_window.h" | 7 #include "apps/native_app_window.h" |
| 8 #include "apps/shell_window.h" | 8 #include "apps/shell_window.h" |
| 9 #include "apps/shell_window_registry.h" | 9 #include "apps/shell_window_registry.h" |
| 10 #include "ash/host/root_window_host_factory.h" | 10 #include "ash/host/root_window_host_factory.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 launcher_delegate_->Init(); | 271 launcher_delegate_->Init(); |
| 272 } | 272 } |
| 273 return launcher_delegate_; | 273 return launcher_delegate_; |
| 274 } | 274 } |
| 275 | 275 |
| 276 aura::client::UserActionClient* ChromeShellDelegate::CreateUserActionClient() { | 276 aura::client::UserActionClient* ChromeShellDelegate::CreateUserActionClient() { |
| 277 return new UserActionHandler; | 277 return new UserActionHandler; |
| 278 } | 278 } |
| 279 | 279 |
| 280 void ChromeShellDelegate::OpenFeedbackPage() { | 280 void ChromeShellDelegate::OpenFeedbackPage() { |
| 281 chrome::OpenFeedbackDialog(GetTargetBrowser()); | 281 chrome::OpenFeedbackDialog(GetTargetBrowserIfAvailable()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void ChromeShellDelegate::RecordUserMetricsAction( | 284 void ChromeShellDelegate::RecordUserMetricsAction( |
| 285 ash::UserMetricsAction action) { | 285 ash::UserMetricsAction action) { |
| 286 switch (action) { | 286 switch (action) { |
| 287 case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6: | 287 case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6: |
| 288 content::RecordAction( | 288 content::RecordAction( |
| 289 content::UserMetricsAction("Accel_KeyboardBrightnessDown_F6")); | 289 content::UserMetricsAction("Accel_KeyboardBrightnessDown_F6")); |
| 290 break; | 290 break; |
| 291 case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7: | 291 case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7: |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 | 442 |
| 443 ash::RootWindowHostFactory* ChromeShellDelegate::CreateRootWindowHostFactory() { | 443 ash::RootWindowHostFactory* ChromeShellDelegate::CreateRootWindowHostFactory() { |
| 444 return ash::RootWindowHostFactory::Create(); | 444 return ash::RootWindowHostFactory::Create(); |
| 445 } | 445 } |
| 446 | 446 |
| 447 string16 ChromeShellDelegate::GetProductName() const { | 447 string16 ChromeShellDelegate::GetProductName() const { |
| 448 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 448 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
| 449 } | 449 } |
| 450 | 450 |
| 451 Browser* ChromeShellDelegate::GetTargetBrowser() { | 451 Browser* ChromeShellDelegate::GetTargetBrowser() { |
| 452 Browser* browser = chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()); | 452 Browser* browser = GetTargetBrowserIfAvailable(); |
| 453 if (browser) | 453 if (browser) |
| 454 return browser; | 454 return browser; |
| 455 return chrome::FindOrCreateTabbedBrowser( | 455 return chrome::FindOrCreateTabbedBrowser( |
| 456 ProfileManager::GetDefaultProfileOrOffTheRecord(), | 456 ProfileManager::GetDefaultProfileOrOffTheRecord(), |
| 457 chrome::HOST_DESKTOP_TYPE_ASH); | 457 chrome::HOST_DESKTOP_TYPE_ASH); |
| 458 } | 458 } |
| 459 | 459 |
| 460 Browser* ChromeShellDelegate::GetTargetBrowserIfAvailable() { |
| 461 return chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()); |
| 462 } |
| 463 |
| 460 keyboard::KeyboardControllerProxy* | 464 keyboard::KeyboardControllerProxy* |
| 461 ChromeShellDelegate::CreateKeyboardControllerProxy() { | 465 ChromeShellDelegate::CreateKeyboardControllerProxy() { |
| 462 return new AshKeyboardControllerProxy(); | 466 return new AshKeyboardControllerProxy(); |
| 463 } | 467 } |
| OLD | NEW |