OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/app_controller_mac.h" | 5 #import "chrome/browser/app_controller_mac.h" |
6 | 6 |
7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/mac_util.h" | 9 #include "base/mac_util.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "chrome/browser/command_updater.h" | 30 #include "chrome/browser/command_updater.h" |
31 #include "chrome/browser/download/download_manager.h" | 31 #include "chrome/browser/download/download_manager.h" |
32 #include "chrome/browser/options_window.h" | 32 #include "chrome/browser/options_window.h" |
33 #include "chrome/browser/sessions/tab_restore_service.h" | 33 #include "chrome/browser/sessions/tab_restore_service.h" |
34 #include "chrome/browser/tab_contents/tab_contents.h" | 34 #include "chrome/browser/tab_contents/tab_contents.h" |
35 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
36 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
37 #include "chrome/common/pref_service.h" | 37 #include "chrome/common/pref_service.h" |
38 #include "chrome/browser/profile_manager.h" | 38 #include "chrome/browser/profile_manager.h" |
39 #include "chrome/common/temp_scaffolding_stubs.h" | 39 #include "chrome/common/temp_scaffolding_stubs.h" |
| 40 #include "grit/chromium_strings.h" |
40 #include "grit/generated_resources.h" | 41 #include "grit/generated_resources.h" |
41 | 42 |
42 @interface AppController(PRIVATE) | 43 @interface AppController(PRIVATE) |
43 - (void)initMenuState; | 44 - (void)initMenuState; |
44 - (void)openURLs:(const std::vector<GURL>&)urls; | 45 - (void)openURLs:(const std::vector<GURL>&)urls; |
45 - (void)openPendingURLs; | 46 - (void)openPendingURLs; |
46 - (void)getUrl:(NSAppleEventDescriptor*)event | 47 - (void)getUrl:(NSAppleEventDescriptor*)event |
47 withReply:(NSAppleEventDescriptor*)reply; | 48 withReply:(NSAppleEventDescriptor*)reply; |
48 - (void)openFiles:(NSAppleEventDescriptor*)event | 49 - (void)openFiles:(NSAppleEventDescriptor*)event |
49 withReply:(NSAppleEventDescriptor*)reply; | 50 withReply:(NSAppleEventDescriptor*)reply; |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 312 } |
312 | 313 |
313 // Helper function for populating and displaying the in progress downloads at | 314 // Helper function for populating and displaying the in progress downloads at |
314 // exit alert panel. | 315 // exit alert panel. |
315 - (BOOL)userWillWaitForInProgressDownloads:(int)downloadCount { | 316 - (BOOL)userWillWaitForInProgressDownloads:(int)downloadCount { |
316 NSString* warningText = nil; | 317 NSString* warningText = nil; |
317 NSString* explanationText = nil; | 318 NSString* explanationText = nil; |
318 NSString* waitTitle = nil; | 319 NSString* waitTitle = nil; |
319 NSString* exitTitle = nil; | 320 NSString* exitTitle = nil; |
320 | 321 |
| 322 std::wstring product_name = l10n_util::GetString(IDS_PRODUCT_NAME); |
| 323 |
321 // Set the dialog text based on whether or not there are multiple downloads. | 324 // Set the dialog text based on whether or not there are multiple downloads. |
322 if (downloadCount == 1) { | 325 if (downloadCount == 1) { |
323 // Dialog text: warning and explanation. | 326 // Dialog text: warning and explanation. |
324 warningText = | 327 warningText = |
325 base::SysWideToNSString(l10n_util::GetString( | 328 base::SysWideToNSString(l10n_util::GetStringF( |
326 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_WARNING)); | 329 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_WARNING, product_name)); |
327 explanationText = | 330 explanationText = |
328 base::SysWideToNSString(l10n_util::GetString( | 331 base::SysWideToNSString(l10n_util::GetStringF( |
329 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_EXPLANATION)); | 332 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_EXPLANATION, product_name)); |
330 | 333 |
331 // Cancel download and exit button text. | 334 // Cancel download and exit button text. |
332 exitTitle = | 335 exitTitle = |
333 base::SysWideToNSString(l10n_util::GetString( | 336 base::SysWideToNSString(l10n_util::GetString( |
334 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL)); | 337 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL)); |
335 | 338 |
336 // Wait for download button text. | 339 // Wait for download button text. |
337 waitTitle = | 340 waitTitle = |
338 base::SysWideToNSString(l10n_util::GetString( | 341 base::SysWideToNSString(l10n_util::GetString( |
339 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL)); | 342 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL)); |
340 } else { | 343 } else { |
341 // Dialog text: warning and explanation. | 344 // Dialog text: warning and explanation. |
342 warningText = | 345 warningText = |
343 base::SysWideToNSString(l10n_util::GetStringF( | 346 base::SysWideToNSString(l10n_util::GetStringF( |
344 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_WARNING, downloadCount)); | 347 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_WARNING, product_name, |
| 348 IntToWString(downloadCount))); |
345 explanationText = | 349 explanationText = |
346 base::SysWideToNSString(l10n_util::GetString( | 350 base::SysWideToNSString(l10n_util::GetStringF( |
347 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_EXPLANATION)); | 351 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_EXPLANATION, product_name)); |
348 | 352 |
349 // Cancel downloads and exit button text. | 353 // Cancel downloads and exit button text. |
350 exitTitle = | 354 exitTitle = |
351 base::SysWideToNSString(l10n_util::GetString( | 355 base::SysWideToNSString(l10n_util::GetString( |
352 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_OK_BUTTON_LABEL)); | 356 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_OK_BUTTON_LABEL)); |
353 | 357 |
354 // Wait for downloads button text. | 358 // Wait for downloads button text. |
355 waitTitle = | 359 waitTitle = |
356 base::SysWideToNSString(l10n_util::GetString( | 360 base::SysWideToNSString(l10n_util::GetString( |
357 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL)); | 361 IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL)); |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 @end | 681 @end |
678 | 682 |
679 //--------------------------------------------------------------------------- | 683 //--------------------------------------------------------------------------- |
680 | 684 |
681 // Stub for cross-platform method that isn't called on Mac OS X. | 685 // Stub for cross-platform method that isn't called on Mac OS X. |
682 void ShowOptionsWindow(OptionsPage page, | 686 void ShowOptionsWindow(OptionsPage page, |
683 OptionsGroup highlight_group, | 687 OptionsGroup highlight_group, |
684 Profile* profile) { | 688 Profile* profile) { |
685 NOTIMPLEMENTED(); | 689 NOTIMPLEMENTED(); |
686 } | 690 } |
OLD | NEW |