OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 namespace { | 125 namespace { |
126 | 126 |
127 #if defined(USE_LINUX_BREAKPAD) | 127 #if defined(USE_LINUX_BREAKPAD) |
128 void ChromeOSVersionCallback(const std::string& version) { | 128 void ChromeOSVersionCallback(const std::string& version) { |
129 base::SetLinuxDistro(std::string("CrOS ") + version); | 129 base::SetLinuxDistro(std::string("CrOS ") + version); |
130 } | 130 } |
131 | 131 |
132 #endif | 132 #endif |
133 | 133 |
134 class MessageLoopObserver : public MessageLoopForUI::Observer { | 134 class MessageLoopObserver : public base::MessageLoopForUI::Observer { |
135 virtual base::EventStatus WillProcessEvent( | 135 virtual base::EventStatus WillProcessEvent( |
136 const base::NativeEvent& event) OVERRIDE { | 136 const base::NativeEvent& event) OVERRIDE { |
137 return base::EVENT_CONTINUE; | 137 return base::EVENT_CONTINUE; |
138 } | 138 } |
139 | 139 |
140 virtual void DidProcessEvent( | 140 virtual void DidProcessEvent( |
141 const base::NativeEvent& event) OVERRIDE { | 141 const base::NativeEvent& event) OVERRIDE { |
142 } | 142 } |
143 }; | 143 }; |
144 | 144 |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 LOG(WARNING) << "Using new connection change notifier."; | 458 LOG(WARNING) << "Using new connection change notifier."; |
459 network_change_factory = new NetworkChangeNotifierFactoryChromeos(); | 459 network_change_factory = new NetworkChangeNotifierFactoryChromeos(); |
460 } else { | 460 } else { |
461 network_change_factory = new CrosNetworkChangeNotifierFactory(); | 461 network_change_factory = new CrosNetworkChangeNotifierFactory(); |
462 } | 462 } |
463 net::NetworkChangeNotifier::SetFactory(network_change_factory); | 463 net::NetworkChangeNotifier::SetFactory(network_change_factory); |
464 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); | 464 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); |
465 } | 465 } |
466 | 466 |
467 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() { | 467 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() { |
468 MessageLoopForUI* message_loop = MessageLoopForUI::current(); | 468 base::MessageLoopForUI* message_loop = base::MessageLoopForUI::current(); |
469 message_loop->AddObserver(g_message_loop_observer.Pointer()); | 469 message_loop->AddObserver(g_message_loop_observer.Pointer()); |
470 | 470 |
471 dbus_services_.reset(new internal::DBusServices(parameters())); | 471 dbus_services_.reset(new internal::DBusServices(parameters())); |
472 | 472 |
473 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); | 473 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); |
474 } | 474 } |
475 | 475 |
476 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun. | 476 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun. |
477 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. | 477 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. |
478 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { | 478 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); | 907 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); |
908 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); | 908 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); |
909 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); | 909 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); |
910 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); | 910 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); |
911 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); | 911 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); |
912 // This is necessary to start the experiment as a side effect. | 912 // This is necessary to start the experiment as a side effect. |
913 trial->group(); | 913 trial->group(); |
914 } | 914 } |
915 | 915 |
916 } // namespace chromeos | 916 } // namespace chromeos |
OLD | NEW |