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

Side by Side Diff: chrome/browser/ui/cocoa/confirm_quit_panel_controller.mm

Issue 1041313003: MacViews: Remove BrowserWindowController dependency from AppController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@titlebar
Patch Set: Fix tests Created 5 years, 8 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
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 #import <QuartzCore/QuartzCore.h> 6 #import <QuartzCore/QuartzCore.h>
7 7
8 #import "chrome/browser/ui/cocoa/confirm_quit_panel_controller.h" 8 #import "chrome/browser/ui/cocoa/confirm_quit_panel_controller.h"
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/mac/scoped_nsobject.h" 11 #include "base/mac/scoped_nsobject.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/prefs/pref_registry_simple.h" 13 #include "base/prefs/pref_registry_simple.h"
14 #include "base/strings/sys_string_conversions.h" 14 #include "base/strings/sys_string_conversions.h"
15 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/profiles/profile_manager.h" 17 #include "chrome/browser/profiles/profile_manager.h"
18 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 18 #include "chrome/browser/ui/browser_finder.h"
19 #include "chrome/browser/ui/cocoa/confirm_quit.h" 19 #include "chrome/browser/ui/cocoa/confirm_quit.h"
20 #include "chrome/common/pref_names.h" 20 #include "chrome/common/pref_names.h"
21 #include "chrome/grit/generated_resources.h" 21 #include "chrome/grit/generated_resources.h"
22 #import "ui/base/accelerators/platform_accelerator_cocoa.h" 22 #import "ui/base/accelerators/platform_accelerator_cocoa.h"
23 #include "ui/base/l10n/l10n_util_mac.h" 23 #include "ui/base/l10n/l10n_util_mac.h"
24 24
25 // Constants /////////////////////////////////////////////////////////////////// 25 // Constants ///////////////////////////////////////////////////////////////////
26 26
27 // How long the user must hold down Cmd+Q to confirm the quit. 27 // How long the user must hold down Cmd+Q to confirm the quit.
28 const NSTimeInterval kTimeToConfirmQuit = 1.5; 28 const NSTimeInterval kTimeToConfirmQuit = 1.5;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 if ((self = [super initWithDuration:duration 148 if ((self = [super initWithDuration:duration
149 animationCurve:NSAnimationLinear])) { 149 animationCurve:NSAnimationLinear])) {
150 application_ = app; 150 application_ = app;
151 [self setDelegate:self]; 151 [self setDelegate:self];
152 } 152 }
153 return self; 153 return self;
154 } 154 }
155 155
156 - (void)setCurrentProgress:(NSAnimationProgress)progress { 156 - (void)setCurrentProgress:(NSAnimationProgress)progress {
157 for (NSWindow* window in [application_ windows]) { 157 for (NSWindow* window in [application_ windows]) {
158 if ([[window windowController] 158 if (chrome::FindBrowserWithWindow(window))
159 isKindOfClass:[BrowserWindowController class]]) {
160 [window setAlphaValue:1.0 - progress]; 159 [window setAlphaValue:1.0 - progress];
161 }
162 } 160 }
163 } 161 }
164 162
165 - (void)animationDidStop:(NSAnimation*)anim { 163 - (void)animationDidStop:(NSAnimation*)anim {
166 DCHECK_EQ(self, anim); 164 DCHECK_EQ(self, anim);
167 [self autorelease]; 165 [self autorelease];
168 } 166 }
169 167
170 @end 168 @end
171 169
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 if (modifiers & NSAlternateKeyMask) 417 if (modifiers & NSAlternateKeyMask)
420 [string appendString:@"\u2325"]; 418 [string appendString:@"\u2325"];
421 if (modifiers & NSShiftKeyMask) 419 if (modifiers & NSShiftKeyMask)
422 [string appendString:@"\u21E7"]; 420 [string appendString:@"\u21E7"];
423 421
424 [string appendString:[item.characters() uppercaseString]]; 422 [string appendString:[item.characters() uppercaseString]];
425 return string; 423 return string;
426 } 424 }
427 425
428 @end 426 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698