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

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 namespace { 122 namespace {
123 123
124 #if defined(USE_LINUX_BREAKPAD) 124 #if defined(USE_LINUX_BREAKPAD)
125 void ChromeOSVersionCallback(const std::string& version) { 125 void ChromeOSVersionCallback(const std::string& version) {
126 base::SetLinuxDistro(std::string("CrOS ") + version); 126 base::SetLinuxDistro(std::string("CrOS ") + version);
127 } 127 }
128 128
129 #endif 129 #endif
130 130
131 class MessageLoopObserver : public MessageLoopForUI::Observer { 131 class MessageLoopObserver : public base::MessageLoopForUI::Observer {
132 virtual base::EventStatus WillProcessEvent( 132 virtual base::EventStatus WillProcessEvent(const base::NativeEvent& event)
brettw 2013/04/28 04:26:27 I preferred the old wrapping here (OVERRIDE on its
133 const base::NativeEvent& event) OVERRIDE { 133 OVERRIDE {
134 return base::EVENT_CONTINUE; 134 return base::EVENT_CONTINUE;
135 } 135 }
136 136
137 virtual void DidProcessEvent( 137 virtual void DidProcessEvent(
138 const base::NativeEvent& event) OVERRIDE { 138 const base::NativeEvent& event) OVERRIDE {
139 } 139 }
140 }; 140 };
141 141
142 static base::LazyInstance<MessageLoopObserver> g_message_loop_observer = 142 static base::LazyInstance<MessageLoopObserver> g_message_loop_observer =
143 LAZY_INSTANCE_INITIALIZER; 143 LAZY_INSTANCE_INITIALIZER;
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 LOG(WARNING) << "Using new connection change notifier."; 452 LOG(WARNING) << "Using new connection change notifier.";
453 network_change_factory = new NetworkChangeNotifierFactoryChromeos(); 453 network_change_factory = new NetworkChangeNotifierFactoryChromeos();
454 } else { 454 } else {
455 network_change_factory = new CrosNetworkChangeNotifierFactory(); 455 network_change_factory = new CrosNetworkChangeNotifierFactory();
456 } 456 }
457 net::NetworkChangeNotifier::SetFactory(network_change_factory); 457 net::NetworkChangeNotifier::SetFactory(network_change_factory);
458 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); 458 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart();
459 } 459 }
460 460
461 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() { 461 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() {
462 MessageLoopForUI* message_loop = MessageLoopForUI::current(); 462 base::MessageLoopForUI* message_loop = base::MessageLoopForUI::current();
463 message_loop->AddObserver(g_message_loop_observer.Pointer()); 463 message_loop->AddObserver(g_message_loop_observer.Pointer());
464 464
465 dbus_services_.reset(new internal::DBusServices(parameters())); 465 dbus_services_.reset(new internal::DBusServices(parameters()));
466 466
467 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); 467 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart();
468 } 468 }
469 469
470 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun. 470 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun.
471 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. 471 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads.
472 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { 472 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() {
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); 879 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0);
880 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); 880 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0);
881 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); 881 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0);
882 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); 882 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0);
883 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); 883 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0);
884 // This is necessary to start the experiment as a side effect. 884 // This is necessary to start the experiment as a side effect.
885 trial->group(); 885 trial->group();
886 } 886 }
887 887
888 } // namespace chromeos 888 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698