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

Side by Side Diff: android_webview/browser/aw_browser_main_parts.cc

Issue 1659363003: [Android WebView] Implement support for Network Information API and enable it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove logging Created 4 years, 9 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 "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_dev_tools_discovery_provider.h" 8 #include "android_webview/browser/aw_dev_tools_discovery_provider.h"
9 #include "android_webview/browser/aw_media_client_android.h" 9 #include "android_webview/browser/aw_media_client_android.h"
10 #include "android_webview/browser/aw_result_codes.h" 10 #include "android_webview/browser/aw_result_codes.h"
11 #include "android_webview/browser/deferred_gpu_command_service.h" 11 #include "android_webview/browser/deferred_gpu_command_service.h"
12 #include "android_webview/browser/net/aw_network_change_notifier_factory.h"
12 #include "android_webview/common/aw_resource.h" 13 #include "android_webview/common/aw_resource.h"
13 #include "android_webview/common/aw_switches.h" 14 #include "android_webview/common/aw_switches.h"
14 #include "base/android/apk_assets.h" 15 #include "base/android/apk_assets.h"
15 #include "base/android/build_info.h" 16 #include "base/android/build_info.h"
16 #include "base/android/locale_utils.h" 17 #include "base/android/locale_utils.h"
17 #include "base/android/memory_pressure_listener_android.h" 18 #include "base/android/memory_pressure_listener_android.h"
18 #include "base/command_line.h" 19 #include "base/command_line.h"
19 #include "base/files/file_path.h" 20 #include "base/files/file_path.h"
20 #include "base/i18n/rtl.h" 21 #include "base/i18n/rtl.h"
21 #include "base/path_service.h" 22 #include "base/path_service.h"
(...skipping 17 matching lines...) Expand all
39 namespace android_webview { 40 namespace android_webview {
40 41
41 AwBrowserMainParts::AwBrowserMainParts(AwBrowserContext* browser_context) 42 AwBrowserMainParts::AwBrowserMainParts(AwBrowserContext* browser_context)
42 : browser_context_(browser_context) { 43 : browser_context_(browser_context) {
43 } 44 }
44 45
45 AwBrowserMainParts::~AwBrowserMainParts() { 46 AwBrowserMainParts::~AwBrowserMainParts() {
46 } 47 }
47 48
48 void AwBrowserMainParts::PreEarlyInitialization() { 49 void AwBrowserMainParts::PreEarlyInitialization() {
49 net::NetworkChangeNotifier::SetFactory( 50 net::NetworkChangeNotifier::SetFactory(new AwNetworkChangeNotifierFactory());
50 new net::NetworkChangeNotifierFactoryAndroid());
51 51
52 // Android WebView does not use default MessageLoop. It has its own 52 // Android WebView does not use default MessageLoop. It has its own
53 // Android specific MessageLoop. Also see MainMessageLoopRun. 53 // Android specific MessageLoop. Also see MainMessageLoopRun.
54 DCHECK(!main_message_loop_.get()); 54 DCHECK(!main_message_loop_.get());
55 main_message_loop_.reset(new base::MessageLoopForUI); 55 main_message_loop_.reset(new base::MessageLoopForUI);
56 base::MessageLoopForUI::current()->Start(); 56 base::MessageLoopForUI::current()->Start();
57 } 57 }
58 58
59 int AwBrowserMainParts::PreCreateThreads() { 59 int AwBrowserMainParts::PreCreateThreads() {
60 ui::SetLocalePaksStoredInApk(true); 60 ui::SetLocalePaksStoredInApk(true);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView(); 98 content::RenderFrameHost::AllowInjectingJavaScriptForAndroidWebView();
99 } 99 }
100 100
101 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { 101 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) {
102 // Android WebView does not use default MessageLoop. It has its own 102 // Android WebView does not use default MessageLoop. It has its own
103 // Android specific MessageLoop. 103 // Android specific MessageLoop.
104 return true; 104 return true;
105 } 105 }
106 106
107 } // namespace android_webview 107 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/android_webview.gyp ('k') | android_webview/browser/net/aw_network_change_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698