OLD | NEW |
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 // On Mac, one can't make shortcuts with command-line arguments. Instead, we | 5 // On Mac, one can't make shortcuts with command-line arguments. Instead, we |
6 // produce small app bundles which locate the Chromium framework and load it, | 6 // produce small app bundles which locate the Chromium framework and load it, |
7 // passing the appropriate data. This is the entry point into the framework for | 7 // passing the appropriate data. This is the entry point into the framework for |
8 // those app bundles. | 8 // those app bundles. |
9 | 9 |
10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 for (NSString* language in preferred_languages) { | 575 for (NSString* language in preferred_languages) { |
576 if ([supported_languages containsObject:language]) { | 576 if ([supported_languages containsObject:language]) { |
577 preferred_localization = base::SysNSStringToUTF8(language); | 577 preferred_localization = base::SysNSStringToUTF8(language); |
578 break; | 578 break; |
579 } | 579 } |
580 } | 580 } |
581 std::string locale = l10n_util::NormalizeLocale( | 581 std::string locale = l10n_util::NormalizeLocale( |
582 l10n_util::GetApplicationLocale(preferred_localization)); | 582 l10n_util::GetApplicationLocale(preferred_localization)); |
583 | 583 |
584 // Load localized strings. | 584 // Load localized strings. |
585 ResourceBundle::InitSharedInstanceLocaleOnly(locale, NULL); | 585 ResourceBundle::InitSharedInstanceWithLocale(locale, NULL, false); |
586 | 586 |
587 // Launch the IO thread. | 587 // Launch the IO thread. |
588 base::Thread::Options io_thread_options; | 588 base::Thread::Options io_thread_options; |
589 io_thread_options.message_loop_type = base::MessageLoop::TYPE_IO; | 589 io_thread_options.message_loop_type = base::MessageLoop::TYPE_IO; |
590 base::Thread *io_thread = new base::Thread("CrAppShimIO"); | 590 base::Thread *io_thread = new base::Thread("CrAppShimIO"); |
591 io_thread->StartWithOptions(io_thread_options); | 591 io_thread->StartWithOptions(io_thread_options); |
592 g_io_thread = io_thread; | 592 g_io_thread = io_thread; |
593 | 593 |
594 // Find already running instances of Chrome. | 594 // Find already running instances of Chrome. |
595 pid_t pid = -1; | 595 pid_t pid = -1; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 // minute. | 660 // minute. |
661 main_message_loop.PostTask( | 661 main_message_loop.PostTask( |
662 FROM_HERE, | 662 FROM_HERE, |
663 base::Bind(&AppShimController::Init, | 663 base::Bind(&AppShimController::Init, |
664 base::Unretained(&controller))); | 664 base::Unretained(&controller))); |
665 } | 665 } |
666 | 666 |
667 main_message_loop.Run(); | 667 main_message_loop.Run(); |
668 return 0; | 668 return 0; |
669 } | 669 } |
OLD | NEW |