Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 11082002: Remove TOGGLE_MAXIMIZED_* from Ash reserved actions list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix AcceleratorControllerTest.WindowSnap Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (!was_active) 175 if (!was_active)
176 browser->window()->Show(); 176 browser->window()->Show();
177 } 177 }
178 178
179 void ChromeShellDelegate::NewWindow(bool is_incognito) { 179 void ChromeShellDelegate::NewWindow(bool is_incognito) {
180 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); 180 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord();
181 chrome::NewEmptyWindow( 181 chrome::NewEmptyWindow(
182 is_incognito ? profile->GetOffTheRecordProfile() : profile); 182 is_incognito ? profile->GetOffTheRecordProfile() : profile);
183 } 183 }
184 184
185 void ChromeShellDelegate::ToggleMaximized() {
186 aura::Window* window = ash::wm::GetActiveWindow();
187 if (!window)
188 return;
189 // Get out of fullscreen when in fullscreen mode.
190 if (ash::wm::IsWindowFullscreen(window)) {
191 chrome::ToggleFullscreenMode(GetTargetBrowser());
192 return;
193 }
194 if (ash::wm::IsWindowMaximized(window))
sky 2012/10/09 15:50:53 Promote this to a common place so TestShellDelegat
mazda 2012/10/09 20:50:33 I added ToggleMaximizedWindow to ash/wm/window_uti
195 ash::wm::RestoreWindow(window);
196 else if (ash::wm::CanMaximizeWindow(window))
197 ash::wm::MaximizeWindow(window);
198 }
199
185 void ChromeShellDelegate::OpenFileManager(bool as_dialog) { 200 void ChromeShellDelegate::OpenFileManager(bool as_dialog) {
186 #if defined(OS_CHROMEOS) 201 #if defined(OS_CHROMEOS)
187 if (as_dialog) { 202 if (as_dialog) {
188 Browser* browser = 203 Browser* browser =
189 browser::FindBrowserWithWindow(ash::wm::GetActiveWindow()); 204 browser::FindBrowserWithWindow(ash::wm::GetActiveWindow());
190 // Open the select file dialog only if there is an active browser where the 205 // Open the select file dialog only if there is an active browser where the
191 // selected file is displayed. Otherwise open a file manager in a tab. 206 // selected file is displayed. Otherwise open a file manager in a tab.
192 if (browser) { 207 if (browser) {
193 browser->OpenFile(); 208 browser->OpenFile();
194 return; 209 return;
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 ash::Shell::GetInstance()->ShowLauncher(); 465 ash::Shell::GetInstance()->ShowLauncher();
451 break; 466 break;
452 default: 467 default:
453 NOTREACHED() << "Unexpected notification " << type; 468 NOTREACHED() << "Unexpected notification " << type;
454 } 469 }
455 #else 470 #else
456 // MSVC++ warns about switch statements without any cases. 471 // MSVC++ warns about switch statements without any cases.
457 NOTREACHED() << "Unexpected notification " << type; 472 NOTREACHED() << "Unexpected notification " << type;
458 #endif 473 #endif
459 } 474 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698