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

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

Issue 11280287: Magnifier: Prevent useless operation in enabling/disabling magnifier. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: review fix (#2 & #3) Created 8 years 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 "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/shell.h" 10 #include "ash/shell.h"
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 // TODO(abarth): Should this move to InitializeNetworkOptions()? 430 // TODO(abarth): Should this move to InitializeNetworkOptions()?
431 // Allow access to file:// on ChromeOS for tests. 431 // Allow access to file:// on ChromeOS for tests.
432 if (parsed_command_line().HasSwitch(::switches::kAllowFileAccess)) 432 if (parsed_command_line().HasSwitch(::switches::kAllowFileAccess))
433 ChromeNetworkDelegate::AllowAccessToAllFiles(); 433 ChromeNetworkDelegate::AllowAccessToAllFiles();
434 434
435 if (parsed_command_line().HasSwitch(::switches::kEnableContacts)) { 435 if (parsed_command_line().HasSwitch(::switches::kEnableContacts)) {
436 contact_manager_.reset(new contacts::ContactManager()); 436 contact_manager_.reset(new contacts::ContactManager());
437 contact_manager_->Init(); 437 contact_manager_->Init();
438 } 438 }
439 439
440 // Initialize magnification manager before ash tray is created.
441 chromeos::MagnificationManager::Initialize();
442
440 // There are two use cases for kLoginUser: 443 // There are two use cases for kLoginUser:
441 // 1) if passed in tandem with kLoginPassword, to drive a "StubLogin" 444 // 1) if passed in tandem with kLoginPassword, to drive a "StubLogin"
442 // 2) if passed alone, to signal that the indicated user has already 445 // 2) if passed alone, to signal that the indicated user has already
443 // logged in and we should behave accordingly. 446 // logged in and we should behave accordingly.
444 // This handles case 2. 447 // This handles case 2.
445 if (parsed_command_line().HasSwitch(::switches::kLoginUser) && 448 if (parsed_command_line().HasSwitch(::switches::kLoginUser) &&
446 !parsed_command_line().HasSwitch(::switches::kLoginPassword)) { 449 !parsed_command_line().HasSwitch(::switches::kLoginPassword)) {
447 std::string username = 450 std::string username =
448 parsed_command_line().GetSwitchValueASCII(::switches::kLoginUser); 451 parsed_command_line().GetSwitchValueASCII(::switches::kLoginUser);
449 VLOG(1) << "Relaunching browser for user: " << username; 452 VLOG(1) << "Relaunching browser for user: " << username;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 // Initialize the brightness observer so that we'll display an onscreen 523 // Initialize the brightness observer so that we'll display an onscreen
521 // indication of brightness changes during login. 524 // indication of brightness changes during login.
522 brightness_observer_.reset(new BrightnessObserver()); 525 brightness_observer_.reset(new BrightnessObserver());
523 output_observer_.reset(new OutputObserver()); 526 output_observer_.reset(new OutputObserver());
524 resume_observer_.reset(new ResumeObserver()); 527 resume_observer_.reset(new ResumeObserver());
525 screen_lock_observer_.reset(new ScreenLockObserver()); 528 screen_lock_observer_.reset(new ScreenLockObserver());
526 if (KioskModeSettings::Get()->IsKioskModeEnabled()) { 529 if (KioskModeSettings::Get()->IsKioskModeEnabled()) {
527 power_state_override_ = new PowerStateOverride( 530 power_state_override_ = new PowerStateOverride(
528 PowerStateOverride::BLOCK_DISPLAY_SLEEP); 531 PowerStateOverride::BLOCK_DISPLAY_SLEEP);
529 } 532 }
530 magnification_manager_.reset(
531 chromeos::MagnificationManager::CreateInstance());
532 chromeos::accessibility::Initialize(); 533 chromeos::accessibility::Initialize();
533 534
534 primary_display_switch_observer_.reset( 535 primary_display_switch_observer_.reset(
535 new PrimaryDisplaySwitchObserver()); 536 new PrimaryDisplaySwitchObserver());
536 537
537 removable_device_notifications_ = 538 removable_device_notifications_ =
538 new RemovableDeviceNotificationsCros(); 539 new RemovableDeviceNotificationsCros();
539 540
540 // Initialize the network portal detector for Chrome OS. The network 541 // Initialize the network portal detector for Chrome OS. The network
541 // portal detector starts to listen for notifications from 542 // portal detector starts to listen for notifications from
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 621
621 // Tell DeviceSettingsService to stop talking to session_manager. 622 // Tell DeviceSettingsService to stop talking to session_manager.
622 DeviceSettingsService::Get()->Shutdown(); 623 DeviceSettingsService::Get()->Shutdown();
623 624
624 // We should remove observers attached to D-Bus clients before 625 // We should remove observers attached to D-Bus clients before
625 // DBusThreadManager is shut down. 626 // DBusThreadManager is shut down.
626 screen_lock_observer_.reset(); 627 screen_lock_observer_.reset();
627 resume_observer_.reset(); 628 resume_observer_.reset();
628 brightness_observer_.reset(); 629 brightness_observer_.reset();
629 output_observer_.reset(); 630 output_observer_.reset();
630 magnification_manager_.reset();
631 power_state_override_ = NULL; 631 power_state_override_ = NULL;
632 632
633 // The XInput2 event listener needs to be shut down earlier than when 633 // The XInput2 event listener needs to be shut down earlier than when
634 // Singletons are finally destroyed in AtExitManager. 634 // Singletons are finally destroyed in AtExitManager.
635 XInputHierarchyChangedEventListener::GetInstance()->Stop(); 635 XInputHierarchyChangedEventListener::GetInstance()->Stop();
636 636
637 // chromeos::SystemKeyEventListener::Shutdown() is always safe to call, 637 // chromeos::SystemKeyEventListener::Shutdown() is always safe to call,
638 // even if Initialize() wasn't called. 638 // even if Initialize() wasn't called.
639 SystemKeyEventListener::Shutdown(); 639 SystemKeyEventListener::Shutdown();
640 imageburner::BurnManager::Shutdown(); 640 imageburner::BurnManager::Shutdown();
641 AudioHandler::Shutdown(); 641 AudioHandler::Shutdown();
642 642
643 WebSocketProxyController::Shutdown(); 643 WebSocketProxyController::Shutdown();
644 644
645 // Let classes unregister themselves as observers of the ash::Shell singleton 645 // Let classes unregister themselves as observers of the ash::Shell singleton
646 // before the shell is destroyed. 646 // before the shell is destroyed.
647 user_activity_notifier_.reset(); 647 user_activity_notifier_.reset();
648 video_activity_notifier_.reset(); 648 video_activity_notifier_.reset();
649 primary_display_switch_observer_.reset(); 649 primary_display_switch_observer_.reset();
650 650
651 // Detach D-Bus clients before DBusThreadManager is shut down. 651 // Detach D-Bus clients before DBusThreadManager is shut down.
652 power_button_observer_.reset(); 652 power_button_observer_.reset();
653 screen_dimming_observer_.reset(); 653 screen_dimming_observer_.reset();
654 654
655 // Delete ContactManager while |g_browser_process| is still alive. 655 // Delete ContactManager while |g_browser_process| is still alive.
656 contact_manager_.reset(); 656 contact_manager_.reset();
657 657
658 chromeos::MagnificationManager::Shutdown();
659
658 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); 660 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun();
659 } 661 }
660 662
661 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { 663 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() {
662 SetupLowMemoryHeadroomFieldTrial(); 664 SetupLowMemoryHeadroomFieldTrial();
663 } 665 }
664 666
665 void ChromeBrowserMainPartsChromeos::SetupLowMemoryHeadroomFieldTrial() { 667 void ChromeBrowserMainPartsChromeos::SetupLowMemoryHeadroomFieldTrial() {
666 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); 668 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
667 // Only enable this experiment on Canary and Dev, since it's possible 669 // Only enable this experiment on Canary and Dev, since it's possible
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 } else if (trial->group() == margin_200mb) { 704 } else if (trial->group() == margin_200mb) {
703 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; 705 LOG(WARNING) << "low_mem: Part of '200MB' experiment";
704 LowMemoryObserver::SetLowMemoryMargin(200); 706 LowMemoryObserver::SetLowMemoryMargin(200);
705 } else { 707 } else {
706 LOG(WARNING) << "low_mem: Part of 'default' experiment"; 708 LOG(WARNING) << "low_mem: Part of 'default' experiment";
707 } 709 }
708 } 710 }
709 } 711 }
710 712
711 } // namespace chromeos 713 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698