| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 namespace { | 132 namespace { |
| 133 | 133 |
| 134 #if defined(USE_LINUX_BREAKPAD) | 134 #if defined(USE_LINUX_BREAKPAD) |
| 135 void ChromeOSVersionCallback(const std::string& version) { | 135 void ChromeOSVersionCallback(const std::string& version) { |
| 136 base::SetLinuxDistro(std::string("CrOS ") + version); | 136 base::SetLinuxDistro(std::string("CrOS ") + version); |
| 137 } | 137 } |
| 138 | 138 |
| 139 #endif | 139 #endif |
| 140 | 140 |
| 141 class MessageLoopObserver : public MessageLoopForUI::Observer { | 141 class MessageLoopObserver : public base::MessageLoopForUI::Observer { |
| 142 virtual base::EventStatus WillProcessEvent( | 142 virtual base::EventStatus WillProcessEvent( |
| 143 const base::NativeEvent& event) OVERRIDE { | 143 const base::NativeEvent& event) OVERRIDE { |
| 144 return base::EVENT_CONTINUE; | 144 return base::EVENT_CONTINUE; |
| 145 } | 145 } |
| 146 | 146 |
| 147 virtual void DidProcessEvent( | 147 virtual void DidProcessEvent( |
| 148 const base::NativeEvent& event) OVERRIDE { | 148 const base::NativeEvent& event) OVERRIDE { |
| 149 } | 149 } |
| 150 }; | 150 }; |
| 151 | 151 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 LOG(WARNING) << "Using new connection change notifier."; | 481 LOG(WARNING) << "Using new connection change notifier."; |
| 482 network_change_factory = new NetworkChangeNotifierFactoryChromeos(); | 482 network_change_factory = new NetworkChangeNotifierFactoryChromeos(); |
| 483 } else { | 483 } else { |
| 484 network_change_factory = new CrosNetworkChangeNotifierFactory(); | 484 network_change_factory = new CrosNetworkChangeNotifierFactory(); |
| 485 } | 485 } |
| 486 net::NetworkChangeNotifier::SetFactory(network_change_factory); | 486 net::NetworkChangeNotifier::SetFactory(network_change_factory); |
| 487 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); | 487 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); |
| 488 } | 488 } |
| 489 | 489 |
| 490 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() { | 490 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() { |
| 491 MessageLoopForUI* message_loop = MessageLoopForUI::current(); | 491 base::MessageLoopForUI* message_loop = base::MessageLoopForUI::current(); |
| 492 message_loop->AddObserver(g_message_loop_observer.Pointer()); | 492 message_loop->AddObserver(g_message_loop_observer.Pointer()); |
| 493 | 493 |
| 494 dbus_services_.reset(new internal::DBusServices(parameters())); | 494 dbus_services_.reset(new internal::DBusServices(parameters())); |
| 495 | 495 |
| 496 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); | 496 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); |
| 497 } | 497 } |
| 498 | 498 |
| 499 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun. | 499 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun. |
| 500 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. | 500 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. |
| 501 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { | 501 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); | 927 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); |
| 928 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); | 928 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); |
| 929 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); | 929 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); |
| 930 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); | 930 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); |
| 931 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); | 931 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); |
| 932 // This is necessary to start the experiment as a side effect. | 932 // This is necessary to start the experiment as a side effect. |
| 933 trial->group(); | 933 trial->group(); |
| 934 } | 934 } |
| 935 | 935 |
| 936 } // namespace chromeos | 936 } // namespace chromeos |
| OLD | NEW |