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 19 matching lines...) Expand all Loading... |
30 : browser_context_(browser_context) { | 30 : browser_context_(browser_context) { |
31 } | 31 } |
32 | 32 |
33 AwBrowserMainParts::~AwBrowserMainParts() { | 33 AwBrowserMainParts::~AwBrowserMainParts() { |
34 } | 34 } |
35 | 35 |
36 void AwBrowserMainParts::PreEarlyInitialization() { | 36 void AwBrowserMainParts::PreEarlyInitialization() { |
37 net::NetworkChangeNotifier::SetFactory( | 37 net::NetworkChangeNotifier::SetFactory( |
38 new net::NetworkChangeNotifierFactoryAndroid()); | 38 new net::NetworkChangeNotifierFactoryAndroid()); |
39 content::Compositor::InitializeWithFlags( | 39 content::Compositor::InitializeWithFlags( |
40 UseCompositorDirectDraw() ? | 40 content::Compositor::DIRECT_CONTEXT_ON_DRAW_THREAD); |
41 content::Compositor::DIRECT_CONTEXT_ON_DRAW_THREAD : 0); | |
42 | 41 |
43 // Android WebView does not use default MessageLoop. It has its own | 42 // Android WebView does not use default MessageLoop. It has its own |
44 // Android specific MessageLoop. ALso see MainMessageLoopRun. | 43 // Android specific MessageLoop. Also see MainMessageLoopRun. |
45 DCHECK(!main_message_loop_.get()); | 44 DCHECK(!main_message_loop_.get()); |
46 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); | 45 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); |
47 MessageLoopForUI::current()->Start(); | 46 MessageLoopForUI::current()->Start(); |
48 } | 47 } |
49 | 48 |
50 int AwBrowserMainParts::PreCreateThreads() { | 49 int AwBrowserMainParts::PreCreateThreads() { |
51 browser_context_->InitializeBeforeThreadCreation(); | 50 browser_context_->InitializeBeforeThreadCreation(); |
52 | 51 |
53 // Although we don't load a locale pak for Android WebView, we still | 52 // Although we don't load a locale pak for Android WebView, we still |
54 // need to initialise the resource bundle with a locale. | 53 // need to initialise the resource bundle with a locale. |
(...skipping 19 matching lines...) Expand all Loading... |
74 return content::RESULT_CODE_NORMAL_EXIT; | 73 return content::RESULT_CODE_NORMAL_EXIT; |
75 } | 74 } |
76 | 75 |
77 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { | 76 bool AwBrowserMainParts::MainMessageLoopRun(int* result_code) { |
78 // Android WebView does not use default MessageLoop. It has its own | 77 // Android WebView does not use default MessageLoop. It has its own |
79 // Android specific MessageLoop. | 78 // Android specific MessageLoop. |
80 return true; | 79 return true; |
81 } | 80 } |
82 | 81 |
83 } // namespace android_webview | 82 } // namespace android_webview |
OLD | NEW |