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

Side by Side Diff: chrome/browser/chrome_browser_main_android.cc

Issue 1187433006: Load language .pak files directly from the apk when using splits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@locale-res-or-file
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
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_android.h" 5 #include "chrome/browser/chrome_browser_main_android.h"
6 6
7 #include "base/android/build_info.h"
7 #include "base/command_line.h" 8 #include "base/command_line.h"
8 #include "base/path_service.h" 9 #include "base/path_service.h"
9 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
10 #include "chrome/browser/android/chrome_media_client_android.h" 11 #include "chrome/browser/android/chrome_media_client_android.h"
11 #include "chrome/browser/android/seccomp_support_detector.h" 12 #include "chrome/browser/android/seccomp_support_detector.h"
12 #include "chrome/browser/google/google_search_counter_android.h" 13 #include "chrome/browser/google/google_search_counter_android.h"
13 #include "chrome/browser/signin/signin_manager_factory.h" 14 #include "chrome/browser/signin/signin_manager_factory.h"
14 #include "chrome/common/chrome_paths.h" 15 #include "chrome/common/chrome_paths.h"
15 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
16 #include "components/crash/app/breakpad_linux.h" 17 #include "components/crash/app/breakpad_linux.h"
17 #include "components/crash/browser/crash_dump_manager_android.h" 18 #include "components/crash/browser/crash_dump_manager_android.h"
18 #include "components/signin/core/browser/signin_manager.h" 19 #include "components/signin/core/browser/signin_manager.h"
19 #include "content/public/browser/android/compositor.h" 20 #include "content/public/browser/android/compositor.h"
20 #include "content/public/browser/browser_thread.h" 21 #include "content/public/browser/browser_thread.h"
21 #include "content/public/common/main_function_params.h" 22 #include "content/public/common/main_function_params.h"
22 #include "media/base/android/media_client_android.h" 23 #include "media/base/android/media_client_android.h"
23 #include "net/android/network_change_notifier_factory_android.h" 24 #include "net/android/network_change_notifier_factory_android.h"
24 #include "net/base/network_change_notifier.h" 25 #include "net/base/network_change_notifier.h"
26 #include "ui/base/resource/resource_bundle_android.h"
25 #include "ui/base/ui_base_paths.h" 27 #include "ui/base/ui_base_paths.h"
26 28
27 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( 29 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid(
28 const content::MainFunctionParams& parameters) 30 const content::MainFunctionParams& parameters)
29 : ChromeBrowserMainParts(parameters) { 31 : ChromeBrowserMainParts(parameters) {
30 } 32 }
31 33
32 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { 34 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() {
33 } 35 }
34 36
(...skipping 17 matching lines...) Expand all
52 if (!breakpad_enabled) 54 if (!breakpad_enabled)
53 breakpad_enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( 55 breakpad_enabled = base::CommandLine::ForCurrentProcess()->HasSwitch(
54 switches::kEnableCrashReporterForTesting); 56 switches::kEnableCrashReporterForTesting);
55 57
56 if (breakpad_enabled) { 58 if (breakpad_enabled) {
57 base::FilePath crash_dump_dir; 59 base::FilePath crash_dump_dir;
58 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir); 60 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir);
59 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir)); 61 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dump_dir));
60 } 62 }
61 63
64 bool has_splits = base::android::BuildInfo::GetInstance()->has_apk_splits();
Yaron 2015/06/18 20:45:43 how'd you pick here?
agrieve 2015/06/19 01:37:25 This is where webview does it (android_webview/bro
65 ui::SetLocalePaksStoredInApk(has_splits);
66
62 return ChromeBrowserMainParts::PreCreateThreads(); 67 return ChromeBrowserMainParts::PreCreateThreads();
63 } 68 }
64 69
65 void ChromeBrowserMainPartsAndroid::PostProfileInit() { 70 void ChromeBrowserMainPartsAndroid::PostProfileInit() {
66 Profile* main_profile = profile(); 71 Profile* main_profile = profile();
67 search_counter_.reset(new GoogleSearchCounterAndroid(main_profile)); 72 search_counter_.reset(new GoogleSearchCounterAndroid(main_profile));
68 73
69 ChromeBrowserMainParts::PostProfileInit(); 74 ChromeBrowserMainParts::PostProfileInit();
70 } 75 }
71 76
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 ChromeBrowserMainParts::PostBrowserStart(); 113 ChromeBrowserMainParts::PostBrowserStart();
109 114
110 content::BrowserThread::GetBlockingPool()->PostDelayedTask(FROM_HERE, 115 content::BrowserThread::GetBlockingPool()->PostDelayedTask(FROM_HERE,
111 base::Bind(&SeccompSupportDetector::StartDetection), 116 base::Bind(&SeccompSupportDetector::StartDetection),
112 base::TimeDelta::FromMinutes(1)); 117 base::TimeDelta::FromMinutes(1));
113 } 118 }
114 119
115 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { 120 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() {
116 NOTREACHED(); 121 NOTREACHED();
117 } 122 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698