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 "android_webview/browser/aw_browser_main_parts.h" | 5 #include "android_webview/browser/aw_browser_main_parts.h" |
6 | 6 |
7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
8 #include "android_webview/browser/aw_result_codes.h" | 8 #include "android_webview/browser/aw_result_codes.h" |
9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 ui::ResourceBundle::InitSharedInstanceLocaleOnly( | 54 ui::ResourceBundle::InitSharedInstanceLocaleOnly( |
55 content::GetContentClient()->browser()->GetApplicationLocale(), NULL); | 55 content::GetContentClient()->browser()->GetApplicationLocale(), NULL); |
56 | 56 |
57 // TODO(benm): It would be nice to be able to take string resources from | 57 // TODO(benm): It would be nice to be able to take string resources from |
58 // the Android framework for WebView, and rely on resource paks only | 58 // the Android framework for WebView, and rely on resource paks only |
59 // for non-string assets. e.g. graphics (and might be nice in the | 59 // for non-string assets. e.g. graphics (and might be nice in the |
60 // long term to move them into the Android framwork too). Toward | 60 // long term to move them into the Android framwork too). Toward |
61 // that, seed the ResourceBundle instance with a non-string, locale | 61 // that, seed the ResourceBundle instance with a non-string, locale |
62 // independant pak. Until we no longer rely on paks for strings, | 62 // independant pak. Until we no longer rely on paks for strings, |
63 // load an extra data pack separately that has the strings in it. | 63 // load an extra data pack separately that has the strings in it. |
64 FilePath pak_path; | 64 base::FilePath pak_path; |
65 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path); | 65 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path); |
66 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 66 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
67 pak_path.AppendASCII("webviewchromium_strings.pak"), | 67 pak_path.AppendASCII("webviewchromium_strings.pak"), |
68 ui::SCALE_FACTOR_NONE); | 68 ui::SCALE_FACTOR_NONE); |
69 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 69 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
70 pak_path.AppendASCII("webviewchromium.pak"), | 70 pak_path.AppendASCII("webviewchromium.pak"), |
71 ui::SCALE_FACTOR_NONE); | 71 ui::SCALE_FACTOR_NONE); |
72 | 72 |
73 return content::RESULT_CODE_NORMAL_EXIT; | 73 return content::RESULT_CODE_NORMAL_EXIT; |
74 } | 74 } |
75 | 75 |
76 void AwBrowserMainParts::PreMainMessageLoopRun() { | 76 void AwBrowserMainParts::PreMainMessageLoopRun() { |
77 browser_context_->PreMainMessageLoopRun(); | 77 browser_context_->PreMainMessageLoopRun(); |
78 } | 78 } |
79 | 79 |
80 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { | 80 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { |
81 // Android WebView does not use default MessageLoop. It has its own | 81 // Android WebView does not use default MessageLoop. It has its own |
82 // Android specific MessageLoop. | 82 // Android specific MessageLoop. |
83 return true; | 83 return true; |
84 } | 84 } |
85 | 85 |
86 } // namespace android_webview | 86 } // namespace android_webview |
OLD | NEW |