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

Side by Side Diff: content/shell/browser/shell_login_dialog_mac.mm

Issue 1010963002: favor DCHECK_CURRENTLY_ON for better logs in content/{public,shell,test}/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 5 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell_login_dialog.h" 5 #include "content/shell/browser/shell_login_dialog.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/bundle_locations.h" 10 #include "base/mac/bundle_locations.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 - (void)cancel { 81 - (void)cancel {
82 [NSApp endSheet:[alert_ window]]; 82 [NSApp endSheet:[alert_ window]];
83 alert_.reset(); 83 alert_.reset();
84 } 84 }
85 85
86 @end 86 @end
87 87
88 namespace content { 88 namespace content {
89 89
90 void ShellLoginDialog::PlatformCreateDialog(const base::string16& message) { 90 void ShellLoginDialog::PlatformCreateDialog(const base::string16& message) {
91 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 91 DCHECK_CURRENTLY_ON(BrowserThread::UI);
92 helper_ = [[ShellLoginDialogHelper alloc] init]; 92 helper_ = [[ShellLoginDialogHelper alloc] init];
93 93
94 // Show the modal dialog. 94 // Show the modal dialog.
95 NSAlert* alert = [helper_ alert]; 95 NSAlert* alert = [helper_ alert];
96 [alert setDelegate:helper_]; 96 [alert setDelegate:helper_];
97 [alert setInformativeText:base::SysUTF16ToNSString(message)]; 97 [alert setInformativeText:base::SysUTF16ToNSString(message)];
98 [alert setMessageText:@"Please log in."]; 98 [alert setMessageText:@"Please log in."];
99 [alert addButtonWithTitle:@"OK"]; 99 [alert addButtonWithTitle:@"OK"];
100 NSButton* other = [alert addButtonWithTitle:@"Cancel"]; 100 NSButton* other = [alert addButtonWithTitle:@"Cancel"];
101 [other setKeyEquivalent:@"\e"]; 101 [other setKeyEquivalent:@"\e"];
102 [alert 102 [alert
103 beginSheetModalForWindow:nil // nil here makes it app-modal 103 beginSheetModalForWindow:nil // nil here makes it app-modal
104 modalDelegate:helper_ 104 modalDelegate:helper_
105 didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) 105 didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
106 contextInfo:this]; 106 contextInfo:this];
107 107
108 [helper_ focus]; 108 [helper_ focus];
109 } 109 }
110 110
111 void ShellLoginDialog::PlatformCleanUp() { 111 void ShellLoginDialog::PlatformCleanUp() {
112 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 112 DCHECK_CURRENTLY_ON(BrowserThread::UI);
113 [helper_ release]; 113 [helper_ release];
114 helper_ = nil; 114 helper_ = nil;
115 } 115 }
116 116
117 void ShellLoginDialog::PlatformRequestCancelled() { 117 void ShellLoginDialog::PlatformRequestCancelled() {
118 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 118 DCHECK_CURRENTLY_ON(BrowserThread::UI);
119 [helper_ cancel]; 119 [helper_ cancel];
120 } 120 }
121 121
122 } // namespace content 122 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_login_dialog.cc ('k') | content/shell/browser/shell_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698