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

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: Add ash::wm::ToggleMaximizedWindow to window_util.h 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 ash::wm::ToggleMaximizedWindow(window);
195 }
196
185 void ChromeShellDelegate::OpenFileManager(bool as_dialog) { 197 void ChromeShellDelegate::OpenFileManager(bool as_dialog) {
186 #if defined(OS_CHROMEOS) 198 #if defined(OS_CHROMEOS)
187 if (as_dialog) { 199 if (as_dialog) {
188 Browser* browser = 200 Browser* browser =
189 browser::FindBrowserWithWindow(ash::wm::GetActiveWindow()); 201 browser::FindBrowserWithWindow(ash::wm::GetActiveWindow());
190 // Open the select file dialog only if there is an active browser where the 202 // 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. 203 // selected file is displayed. Otherwise open a file manager in a tab.
192 if (browser) { 204 if (browser) {
193 browser->OpenFile(); 205 browser->OpenFile();
194 return; 206 return;
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 ash::Shell::GetInstance()->ShowLauncher(); 462 ash::Shell::GetInstance()->ShowLauncher();
451 break; 463 break;
452 default: 464 default:
453 NOTREACHED() << "Unexpected notification " << type; 465 NOTREACHED() << "Unexpected notification " << type;
454 } 466 }
455 #else 467 #else
456 // MSVC++ warns about switch statements without any cases. 468 // MSVC++ warns about switch statements without any cases.
457 NOTREACHED() << "Unexpected notification " << type; 469 NOTREACHED() << "Unexpected notification " << type;
458 #endif 470 #endif
459 } 471 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698