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

Unified Diff: content/shell/shell_login_dialog_mac.mm

Issue 9982014: Make common utility to load views from nibs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: retain autorelease Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/select_file_dialog_mac.mm ('k') | ui/base/cocoa/nib_loading.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_login_dialog_mac.mm
diff --git a/content/shell/shell_login_dialog_mac.mm b/content/shell/shell_login_dialog_mac.mm
index c08892d0c75872a4edf4b92a7bb780840d53b155..2f55dfb3c41bc15b234f1e3ed5b20bf4c9494669 100644
--- a/content/shell/shell_login_dialog_mac.mm
+++ b/content/shell/shell_login_dialog_mac.mm
@@ -12,6 +12,7 @@
#import "base/memory/scoped_nsobject.h"
#include "base/sys_string_conversions.h"
#include "content/public/browser/browser_thread.h"
+#import "ui/base/cocoa/nib_loading.h"
namespace {
@@ -48,29 +49,13 @@ const int kPasswordFieldTag = 2;
}
- (NSView*)accessoryView {
- scoped_nsobject<NSNib> nib(
- [[NSNib alloc] initWithNibNamed:@"HttpAuth"
- bundle:base::mac::FrameworkBundle()]);
- if (!nib)
+ NSView* accessory_view = ui::GetViewFromNib(@"HttpAuth");
+ if (!accessory_view)
return nil;
- NSArray* objects;
- BOOL success = [nib instantiateNibWithOwner:nil
- topLevelObjects:&objects];
- if (!success)
- return nil;
- [objects makeObjectsPerformSelector:@selector(release)];
-
- for (NSView* view in objects) {
- if (![view isKindOfClass:[NSView class]])
- continue;
-
- usernameField_ = [view viewWithTag:kUsernameFieldTag];
- passwordField_ = [view viewWithTag:kPasswordFieldTag];
- return view;
- }
-
- return nil;
+ usernameField_ = [accessory_view viewWithTag:kUsernameFieldTag];
+ passwordField_ = [accessory_view viewWithTag:kPasswordFieldTag];
+ return accessory_view;
}
- (void)focus {
« no previous file with comments | « chrome/browser/ui/cocoa/select_file_dialog_mac.mm ('k') | ui/base/cocoa/nib_loading.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698