OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chrome_browser_main_mac.h" | 5 #include "chrome/browser/chrome_browser_main_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 #include "chrome/browser/mac/install_from_dmg.h" | 21 #include "chrome/browser/mac/install_from_dmg.h" |
22 #import "chrome/browser/mac/keystone_glue.h" | 22 #import "chrome/browser/mac/keystone_glue.h" |
23 #include "chrome/browser/mac/mac_startup_profiler.h" | 23 #include "chrome/browser/mac/mac_startup_profiler.h" |
24 #include "chrome/browser/ui/app_list/app_list_service.h" | 24 #include "chrome/browser/ui/app_list/app_list_service.h" |
25 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
26 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
27 #include "components/crash/app/crashpad_mac.h" | 27 #include "components/crash/app/crashpad_mac.h" |
28 #include "components/metrics/metrics_service.h" | 28 #include "components/metrics/metrics_service.h" |
29 #include "content/public/common/main_function_params.h" | 29 #include "content/public/common/main_function_params.h" |
30 #include "content/public/common/result_codes.h" | 30 #include "content/public/common/result_codes.h" |
31 #import "media/base/mac/avfoundation_glue.h" | |
31 #include "ui/base/l10n/l10n_util_mac.h" | 32 #include "ui/base/l10n/l10n_util_mac.h" |
32 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
33 #include "ui/base/resource/resource_handle.h" | 34 #include "ui/base/resource/resource_handle.h" |
34 | 35 |
35 namespace { | 36 namespace { |
36 | 37 |
37 // Writes an undocumented sentinel file that prevents Spotlight from indexing | 38 // Writes an undocumented sentinel file that prevents Spotlight from indexing |
38 // below a particular path in order to reap some power savings. | 39 // below a particular path in order to reap some power savings. |
39 void EnsureMetadataNeverIndexFileOnFileThread( | 40 void EnsureMetadataNeverIndexFileOnFileThread( |
40 const base::FilePath& user_data_dir) { | 41 const base::FilePath& user_data_dir) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 | 115 |
115 base::FilePath resources_pack_path; | 116 base::FilePath resources_pack_path; |
116 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 117 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
117 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 118 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
118 resources_pack_path, ui::SCALE_FACTOR_NONE); | 119 resources_pack_path, ui::SCALE_FACTOR_NONE); |
119 | 120 |
120 // This is a no-op if the KeystoneRegistration framework is not present. | 121 // This is a no-op if the KeystoneRegistration framework is not present. |
121 // The framework is only distributed with branded Google Chrome builds. | 122 // The framework is only distributed with branded Google Chrome builds. |
122 [[KeystoneGlue defaultKeystoneGlue] registerWithKeystone]; | 123 [[KeystoneGlue defaultKeystoneGlue] registerWithKeystone]; |
123 | 124 |
125 // Initialize AVFoundation if supported, for audio and video. | |
126 AVFoundationGlue::InitializeAVFoundation(); | |
jam
2015/05/26 23:13:47
i think we want this in src/content so that all co
tommi (sloooow) - chröme
2015/05/27 09:11:02
Yes, makes sense. Put it in BrowserMainLoop::PreC
| |
127 | |
124 // Disk image installation is sort of a first-run task, so it shares the | 128 // Disk image installation is sort of a first-run task, so it shares the |
125 // no first run switches. | 129 // no first run switches. |
126 // | 130 // |
127 // This needs to be done after the resource bundle is initialized (for | 131 // This needs to be done after the resource bundle is initialized (for |
128 // access to localizations in the UI) and after Keystone is initialized | 132 // access to localizations in the UI) and after Keystone is initialized |
129 // (because the installation may need to promote Keystone) but before the | 133 // (because the installation may need to promote Keystone) but before the |
130 // app controller is set up (and thus before MainMenu.nib is loaded, because | 134 // app controller is set up (and thus before MainMenu.nib is loaded, because |
131 // the app controller assumes that a browser has been set up and will crash | 135 // the app controller assumes that a browser has been set up and will crash |
132 // upon receipt of certain notifications if no browser exists), before | 136 // upon receipt of certain notifications if no browser exists), before |
133 // anyone tries doing anything silly like firing off an import job, and | 137 // anyone tries doing anything silly like firing off an import job, and |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 // TODO(calamity): Make this gated on first_run::IsChromeFirstRun() in M45. | 193 // TODO(calamity): Make this gated on first_run::IsChromeFirstRun() in M45. |
190 content::BrowserThread::PostAfterStartupTask( | 194 content::BrowserThread::PostAfterStartupTask( |
191 FROM_HERE, base::ThreadTaskRunnerHandle::Get(), | 195 FROM_HERE, base::ThreadTaskRunnerHandle::Get(), |
192 base::Bind(&EnsureMetadataNeverIndexFile, user_data_dir())); | 196 base::Bind(&EnsureMetadataNeverIndexFile, user_data_dir())); |
193 } | 197 } |
194 | 198 |
195 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { | 199 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { |
196 AppController* appController = [NSApp delegate]; | 200 AppController* appController = [NSApp delegate]; |
197 [appController didEndMainMessageLoop]; | 201 [appController didEndMainMessageLoop]; |
198 } | 202 } |
OLD | NEW |