Chromium Code Reviews| 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_devtools_delegate.h" | 8 #include "android_webview/browser/aw_devtools_delegate.h" |
| 9 #include "android_webview/browser/aw_result_codes.h" | 9 #include "android_webview/browser/aw_result_codes.h" |
| 10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 AwBrowserMainParts::~AwBrowserMainParts() { | 34 AwBrowserMainParts::~AwBrowserMainParts() { |
| 35 } | 35 } |
| 36 | 36 |
| 37 void AwBrowserMainParts::PreEarlyInitialization() { | 37 void AwBrowserMainParts::PreEarlyInitialization() { |
| 38 net::NetworkChangeNotifier::SetFactory( | 38 net::NetworkChangeNotifier::SetFactory( |
| 39 new net::NetworkChangeNotifierFactoryAndroid()); | 39 new net::NetworkChangeNotifierFactoryAndroid()); |
| 40 content::Compositor::InitializeWithFlags( | 40 content::Compositor::InitializeWithFlags( |
| 41 content::Compositor::DIRECT_CONTEXT_ON_DRAW_THREAD); | 41 content::Compositor::DIRECT_CONTEXT_ON_DRAW_THREAD); |
| 42 | 42 |
| 43 // Android WebView does not use default MessageLoop. It has its own | 43 // Android WebView does not use default MessageLoop. It has its own |
| 44 // Android specific MessageLoop. Also see MainMessageLoopRun. | 44 // Android specific base::MessageLoop. Also see MainMessageLoopRun. |
|
joth
2013/04/27 00:59:19
nit: don't change comment (the line above wasn't,
xhwang
2013/04/27 01:19:02
Thanks. That'd due to a bug in my script. Fixed.
| |
| 45 DCHECK(!main_message_loop_.get()); | 45 DCHECK(!main_message_loop_.get()); |
| 46 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); | 46 main_message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
| 47 MessageLoopForUI::current()->Start(); | 47 base::MessageLoopForUI::current()->Start(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 int AwBrowserMainParts::PreCreateThreads() { | 50 int AwBrowserMainParts::PreCreateThreads() { |
| 51 browser_context_->InitializeBeforeThreadCreation(); | 51 browser_context_->InitializeBeforeThreadCreation(); |
| 52 | 52 |
| 53 ui::ResourceBundle::InitSharedInstanceLocaleOnly( | 53 ui::ResourceBundle::InitSharedInstanceLocaleOnly( |
| 54 l10n_util::GetDefaultLocale(), NULL); | 54 l10n_util::GetDefaultLocale(), NULL); |
| 55 | 55 |
| 56 base::FilePath pak_path; | 56 base::FilePath pak_path; |
| 57 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path); | 57 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 73 // Android specific MessageLoop. | 73 // Android specific MessageLoop. |
| 74 return true; | 74 return true; |
| 75 } | 75 } |
| 76 | 76 |
| 77 void AwBrowserMainParts::PostMainMessageLoopRun() { | 77 void AwBrowserMainParts::PostMainMessageLoopRun() { |
| 78 if (devtools_delegate_) | 78 if (devtools_delegate_) |
| 79 devtools_delegate_->Stop(); | 79 devtools_delegate_->Stop(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace android_webview | 82 } // namespace android_webview |
| OLD | NEW |