OLD | NEW |
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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #include "content/public/common/main_function_params.h" | 62 #include "content/public/common/main_function_params.h" |
63 #include "grit/platform_locale_settings.h" | 63 #include "grit/platform_locale_settings.h" |
64 #include "net/base/network_change_notifier.h" | 64 #include "net/base/network_change_notifier.h" |
65 #include "net/url_request/url_request.h" | 65 #include "net/url_request/url_request.h" |
66 #include "ui/base/l10n/l10n_util.h" | 66 #include "ui/base/l10n/l10n_util.h" |
67 | 67 |
68 #if defined(TOOLKIT_USES_GTK) | 68 #if defined(TOOLKIT_USES_GTK) |
69 #include <gtk/gtk.h> | 69 #include <gtk/gtk.h> |
70 #endif | 70 #endif |
71 | 71 |
| 72 #if !defined(OS_WIN) && defined(USE_ASH) |
| 73 #include "chrome/browser/chromeos/background/desktop_background_observer.h" |
| 74 #endif |
| 75 |
72 #if defined(USE_AURA) | 76 #if defined(USE_AURA) |
73 #include "chrome/browser/chromeos/legacy_window_manager/initial_browser_window_o
bserver.h" | 77 #include "chrome/browser/chromeos/legacy_window_manager/initial_browser_window_o
bserver.h" |
74 #include "chrome/browser/chromeos/power/power_button_controller_delegate_chromeo
s.h" | 78 #include "chrome/browser/chromeos/power/power_button_controller_delegate_chromeo
s.h" |
75 #include "chrome/browser/chromeos/power/power_button_observer.h" | 79 #include "chrome/browser/chromeos/power/power_button_observer.h" |
76 #include "chrome/browser/chromeos/power/video_property_writer.h" | 80 #include "chrome/browser/chromeos/power/video_property_writer.h" |
77 #endif | 81 #endif |
78 | 82 |
79 class MessageLoopObserver : public MessageLoopForUI::Observer { | 83 class MessageLoopObserver : public MessageLoopForUI::Observer { |
80 #if defined(USE_AURA) | 84 #if defined(USE_AURA) |
81 virtual base::EventStatus WillProcessEvent( | 85 virtual base::EventStatus WillProcessEvent( |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 content::NotificationService::AllSources(), | 406 content::NotificationService::AllSources(), |
403 content::NotificationService::NoDetails()); | 407 content::NotificationService::NoDetails()); |
404 } else if (parsed_command_line().HasSwitch(switches::kLoginManager)) { | 408 } else if (parsed_command_line().HasSwitch(switches::kLoginManager)) { |
405 // Initialize status area mode early on. | 409 // Initialize status area mode early on. |
406 chromeos::StatusAreaViewChromeos:: | 410 chromeos::StatusAreaViewChromeos:: |
407 SetScreenMode(chromeos::StatusAreaViewChromeos::LOGIN_MODE_WEBUI); | 411 SetScreenMode(chromeos::StatusAreaViewChromeos::LOGIN_MODE_WEBUI); |
408 } | 412 } |
409 | 413 |
410 // In Aura builds this will initialize ash::Shell. | 414 // In Aura builds this will initialize ash::Shell. |
411 ChromeBrowserMainPartsLinux::PreProfileInit(); | 415 ChromeBrowserMainPartsLinux::PreProfileInit(); |
| 416 |
| 417 #if !defined(OS_WIN) && defined(USE_ASH) |
| 418 // Initialize desktop background observer so that it can receive |
| 419 // LOGIN_USER_CHANGED notification from UserManager. |
| 420 desktop_background_observer_.reset(new chromeos::DesktopBackgroundObserver); |
| 421 #endif |
412 } | 422 } |
413 | 423 |
414 void ChromeBrowserMainPartsChromeos::PostProfileInit() { | 424 void ChromeBrowserMainPartsChromeos::PostProfileInit() { |
415 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 425 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
416 // -- just after CreateProfile(). | 426 // -- just after CreateProfile(). |
417 | 427 |
418 if (parsed_command_line().HasSwitch(switches::kLoginUser) && | 428 if (parsed_command_line().HasSwitch(switches::kLoginUser) && |
419 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { | 429 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { |
420 // Pass the TokenService pointer to the policy connector so user policy can | 430 // Pass the TokenService pointer to the policy connector so user policy can |
421 // grab a token and register with the policy server. | 431 // grab a token and register with the policy server. |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell | 543 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell |
534 // singleton before the shell is destroyed. | 544 // singleton before the shell is destroyed. |
535 video_property_writer_.reset(); | 545 video_property_writer_.reset(); |
536 // Remove PowerButtonObserver attached to a D-Bus client before | 546 // Remove PowerButtonObserver attached to a D-Bus client before |
537 // DBusThreadManager is shut down. | 547 // DBusThreadManager is shut down. |
538 power_button_observer_.reset(); | 548 power_button_observer_.reset(); |
539 #endif | 549 #endif |
540 | 550 |
541 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); | 551 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); |
542 } | 552 } |
OLD | NEW |