Chromium Code Reviews| 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/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 return; | 190 return; |
| 191 // Get out of fullscreen when in fullscreen mode. | 191 // Get out of fullscreen when in fullscreen mode. |
| 192 if (ash::wm::IsWindowFullscreen(window)) { | 192 if (ash::wm::IsWindowFullscreen(window)) { |
| 193 chrome::ToggleFullscreenMode(GetTargetBrowser()); | 193 chrome::ToggleFullscreenMode(GetTargetBrowser()); |
| 194 return; | 194 return; |
| 195 } | 195 } |
| 196 ash::wm::ToggleMaximizedWindow(window); | 196 ash::wm::ToggleMaximizedWindow(window); |
| 197 } | 197 } |
| 198 | 198 |
| 199 void ChromeShellDelegate::OpenFileManager(bool as_dialog) { | 199 void ChromeShellDelegate::OpenFileManager(bool as_dialog) { |
| 200 #if defined(OS_CHROMEOS) | 200 #if defined(OS_CHROMEOS) |
|
sky
2012/11/06 16:46:58
Why is any of this in an ifdef?
SeRya
2012/11/07 07:27:23
Because file_manager_util is available in ChromeOS
| |
| 201 if (as_dialog) { | 201 if (as_dialog) { |
| 202 Browser* browser = | 202 Browser* browser = |
| 203 browser::FindBrowserWithWindow(ash::wm::GetActiveWindow()); | 203 browser::FindBrowserWithWindow(ash::wm::GetActiveWindow()); |
| 204 // Open the select file dialog only if there is an active browser where the | 204 // Open the select file dialog only if there is an active browser where the |
| 205 // selected file is displayed. Otherwise open a file manager in a tab. | 205 // selected file is displayed. |
| 206 if (browser) { | 206 if (browser) { |
| 207 browser->OpenFile(); | 207 browser->OpenFile(); |
| 208 return; | 208 return; |
| 209 } | 209 } |
| 210 } else { | |
| 211 file_manager_util::OpenApplication(); | |
| 210 } | 212 } |
| 211 file_manager_util::OpenApplication(); | |
| 212 #endif | 213 #endif |
| 213 } | 214 } |
| 214 | 215 |
| 215 void ChromeShellDelegate::OpenCrosh() { | 216 void ChromeShellDelegate::OpenCrosh() { |
| 216 #if defined(OS_CHROMEOS) | 217 #if defined(OS_CHROMEOS) |
| 217 Browser* browser = GetTargetBrowser(); | 218 Browser* browser = GetTargetBrowser(); |
| 218 GURL crosh_url = TerminalExtensionHelper::GetCroshExtensionURL( | 219 GURL crosh_url = TerminalExtensionHelper::GetCroshExtensionURL( |
| 219 browser->profile()); | 220 browser->profile()); |
| 220 if (!crosh_url.is_valid()) | 221 if (!crosh_url.is_valid()) |
| 221 return; | 222 return; |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 481 ash::Shell::GetInstance()->ShowLauncher(); | 482 ash::Shell::GetInstance()->ShowLauncher(); |
| 482 break; | 483 break; |
| 483 default: | 484 default: |
| 484 NOTREACHED() << "Unexpected notification " << type; | 485 NOTREACHED() << "Unexpected notification " << type; |
| 485 } | 486 } |
| 486 #else | 487 #else |
| 487 // MSVC++ warns about switch statements without any cases. | 488 // MSVC++ warns about switch statements without any cases. |
| 488 NOTREACHED() << "Unexpected notification " << type; | 489 NOTREACHED() << "Unexpected notification " << type; |
| 489 #endif | 490 #endif |
| 490 } | 491 } |
| OLD | NEW |