OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/ui/cocoa/import_progress_dialog.h" | 5 #import "chrome/browser/ui/cocoa/import_progress_dialog.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/l10n_util_mac.h" | 8 #include "app/l10n_util_mac.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac_util.h" | 10 #include "base/mac/mac_util.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #import "base/scoped_nsobject.h" | 12 #import "base/scoped_nsobject.h" |
13 #import "base/sys_string_conversions.h" | 13 #import "base/sys_string_conversions.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "grit/chromium_strings.h" | 15 #include "grit/chromium_strings.h" |
16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Convert ImportItem enum into the name of the ImportProgressDialogController | 20 // Convert ImportItem enum into the name of the ImportProgressDialogController |
(...skipping 29 matching lines...) Expand all Loading... |
50 @synthesize favoritesImportEnabled = favorites_import_enabled_; | 50 @synthesize favoritesImportEnabled = favorites_import_enabled_; |
51 @synthesize searchImportEnabled = search_import_enabled_; | 51 @synthesize searchImportEnabled = search_import_enabled_; |
52 @synthesize passwordImportEnabled = password_import_enabled_; | 52 @synthesize passwordImportEnabled = password_import_enabled_; |
53 @synthesize historyImportEnabled = history_import_enabled_; | 53 @synthesize historyImportEnabled = history_import_enabled_; |
54 | 54 |
55 - (id)initWithImporterHost:(ImporterHost*)host | 55 - (id)initWithImporterHost:(ImporterHost*)host |
56 browserName:(string16)browserName | 56 browserName:(string16)browserName |
57 observer:(ImportObserver*)observer | 57 observer:(ImportObserver*)observer |
58 itemsEnabled:(int16)items { | 58 itemsEnabled:(int16)items { |
59 NSString* nib_path = | 59 NSString* nib_path = |
60 [mac_util::MainAppBundle() pathForResource:@"ImportProgressDialog" | 60 [base::mac::MainAppBundle() pathForResource:@"ImportProgressDialog" |
61 ofType:@"nib"]; | 61 ofType:@"nib"]; |
62 self = [super initWithWindowNibPath:nib_path owner:self]; | 62 self = [super initWithWindowNibPath:nib_path owner:self]; |
63 if (self != nil) { | 63 if (self != nil) { |
64 importer_host_ = host; | 64 importer_host_ = host; |
65 observer_ = observer; | 65 observer_ = observer; |
66 import_host_observer_bridge_.reset(new ImporterObserverBridge(self)); | 66 import_host_observer_bridge_.reset(new ImporterObserverBridge(self)); |
67 importer_host_->SetObserver(import_host_observer_bridge_.get()); | 67 importer_host_->SetObserver(import_host_observer_bridge_.get()); |
68 | 68 |
69 string16 productName = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 69 string16 productName = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
70 NSString* explanatory_text = l10n_util::GetNSStringF( | 70 NSString* explanatory_text = l10n_util::GetNSStringF( |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 NSWindow* progress_window = [progress_dialog_ window]; | 183 NSWindow* progress_window = [progress_dialog_ window]; |
184 NSModalSession session = [NSApp beginModalSessionForWindow:progress_window]; | 184 NSModalSession session = [NSApp beginModalSessionForWindow:progress_window]; |
185 [progress_dialog_ showWindow:nil]; | 185 [progress_dialog_ showWindow:nil]; |
186 while (true) { | 186 while (true) { |
187 if ([NSApp runModalSession:session] != NSRunContinuesResponse) | 187 if ([NSApp runModalSession:session] != NSRunContinuesResponse) |
188 break; | 188 break; |
189 MessageLoop::current()->RunAllPending(); | 189 MessageLoop::current()->RunAllPending(); |
190 } | 190 } |
191 [NSApp endModalSession:session]; | 191 [NSApp endModalSession:session]; |
192 } | 192 } |
OLD | NEW |