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

Side by Side Diff: content/shell/shell_browser_main_parts.cc

Issue 10928193: Add native-side unit test for Android NetworkChangeNotifier (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebasing Created 8 years, 3 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 "content/shell/shell_browser_main_parts.h" 5 #include "content/shell/shell_browser_main_parts.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
12 #include "base/threading/thread.h" 12 #include "base/threading/thread.h"
13 #include "base/threading/thread_restrictions.h" 13 #include "base/threading/thread_restrictions.h"
14 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
15 #include "content/public/common/main_function_params.h" 15 #include "content/public/common/main_function_params.h"
16 #include "content/public/common/url_constants.h" 16 #include "content/public/common/url_constants.h"
17 #include "content/shell/shell.h" 17 #include "content/shell/shell.h"
18 #include "content/shell/shell_browser_context.h" 18 #include "content/shell/shell_browser_context.h"
19 #include "content/shell/shell_devtools_delegate.h" 19 #include "content/shell/shell_devtools_delegate.h"
20 #include "content/shell/shell_switches.h" 20 #include "content/shell/shell_switches.h"
21 #include "googleurl/src/gurl.h" 21 #include "googleurl/src/gurl.h"
22 #include "grit/net_resources.h" 22 #include "grit/net_resources.h"
23 #include "net/base/net_module.h" 23 #include "net/base/net_module.h"
24 #include "net/base/net_util.h" 24 #include "net/base/net_util.h"
25 #include "ui/base/resource/resource_bundle.h" 25 #include "ui/base/resource/resource_bundle.h"
26 26
27 #if defined(OS_ANDROID) 27 #if defined(OS_ANDROID)
28 #include "net/base/network_change_notifier.h" 28 #include "net/base/network_change_notifier.h"
29 #include "net/android/network_change_notifier_factory.h" 29 #include "net/android/network_change_notifier_factory_android.h"
30 #endif 30 #endif
31 31
32 namespace content { 32 namespace content {
33 33
34 namespace { 34 namespace {
35 35
36 static GURL GetStartupURL() { 36 static GURL GetStartupURL() {
37 CommandLine* command_line = CommandLine::ForCurrentProcess(); 37 CommandLine* command_line = CommandLine::ForCurrentProcess();
38 if (command_line->HasSwitch(switches::kContentBrowserTest)) 38 if (command_line->HasSwitch(switches::kContentBrowserTest))
39 return GURL(); 39 return GURL();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 void ShellBrowserMainParts::PostMainMessageLoopStart() { 85 void ShellBrowserMainParts::PostMainMessageLoopStart() {
86 #if defined(OS_ANDROID) 86 #if defined(OS_ANDROID)
87 MessageLoopForUI::current()->Start(); 87 MessageLoopForUI::current()->Start();
88 #endif 88 #endif
89 } 89 }
90 90
91 void ShellBrowserMainParts::PreEarlyInitialization() { 91 void ShellBrowserMainParts::PreEarlyInitialization() {
92 #if defined(OS_ANDROID) 92 #if defined(OS_ANDROID)
93 net::NetworkChangeNotifier::SetFactory( 93 net::NetworkChangeNotifier::SetFactory(
94 new net::android::NetworkChangeNotifierFactory()); 94 new net::NetworkChangeNotifierFactoryAndroid());
95 #endif 95 #endif
96 } 96 }
97 97
98 void ShellBrowserMainParts::PreMainMessageLoopRun() { 98 void ShellBrowserMainParts::PreMainMessageLoopRun() {
99 browser_context_.reset(new ShellBrowserContext(false)); 99 browser_context_.reset(new ShellBrowserContext(false));
100 off_the_record_browser_context_.reset(new ShellBrowserContext(true)); 100 off_the_record_browser_context_.reset(new ShellBrowserContext(true));
101 101
102 Shell::PlatformInitialize(); 102 Shell::PlatformInitialize();
103 net::NetModule::SetResourceProvider(PlatformResourceProvider); 103 net::NetModule::SetResourceProvider(PlatformResourceProvider);
104 104
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 #if defined(USE_AURA) 146 #if defined(USE_AURA)
147 Shell::PlatformExit(); 147 Shell::PlatformExit();
148 #endif 148 #endif
149 if (devtools_delegate_) 149 if (devtools_delegate_)
150 devtools_delegate_->Stop(); 150 devtools_delegate_->Stop();
151 browser_context_.reset(); 151 browser_context_.reset();
152 off_the_record_browser_context_.reset(); 152 off_the_record_browser_context_.reset();
153 } 153 }
154 154
155 } // namespace 155 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main_android.cc ('k') | net/android/java/src/org/chromium/net/NetworkChangeNotifier.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698