OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/browser_init.h" | 5 #include "chrome/browser/ui/browser_init.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 #if defined(OS_CHROMEOS) | 92 #if defined(OS_CHROMEOS) |
93 #include "chrome/browser/chromeos/cros/cros_library.h" | 93 #include "chrome/browser/chromeos/cros/cros_library.h" |
94 #include "chrome/browser/chromeos/cros/mount_library.h" | 94 #include "chrome/browser/chromeos/cros/mount_library.h" |
95 #include "chrome/browser/chromeos/cros/network_library.h" | 95 #include "chrome/browser/chromeos/cros/network_library.h" |
96 #include "chrome/browser/chromeos/customization_document.h" | 96 #include "chrome/browser/chromeos/customization_document.h" |
97 #include "chrome/browser/chromeos/enterprise_extension_observer.h" | 97 #include "chrome/browser/chromeos/enterprise_extension_observer.h" |
98 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 98 #include "chrome/browser/chromeos/gview_request_interceptor.h" |
99 #include "chrome/browser/chromeos/low_battery_observer.h" | 99 #include "chrome/browser/chromeos/low_battery_observer.h" |
100 #include "chrome/browser/chromeos/network_message_observer.h" | 100 #include "chrome/browser/chromeos/network_message_observer.h" |
101 #include "chrome/browser/chromeos/network_state_notifier.h" | |
102 #include "chrome/browser/chromeos/sms_observer.h" | 101 #include "chrome/browser/chromeos/sms_observer.h" |
103 #include "chrome/browser/chromeos/update_observer.h" | 102 #include "chrome/browser/chromeos/update_observer.h" |
104 #include "chrome/browser/chromeos/wm_message_listener.h" | 103 #include "chrome/browser/chromeos/wm_message_listener.h" |
105 #endif | 104 #endif |
106 | 105 |
107 #if defined(TOUCH_UI) | 106 #if defined(TOUCH_UI) |
108 #include "views/focus/accelerator_handler.h" | 107 #include "views/focus/accelerator_handler.h" |
109 #endif | 108 #endif |
110 | 109 |
111 namespace { | 110 namespace { |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 return in_startup; | 541 return in_startup; |
543 } | 542 } |
544 | 543 |
545 bool BrowserInit::LaunchBrowser(const CommandLine& command_line, | 544 bool BrowserInit::LaunchBrowser(const CommandLine& command_line, |
546 Profile* profile, | 545 Profile* profile, |
547 const FilePath& cur_dir, | 546 const FilePath& cur_dir, |
548 bool process_startup, | 547 bool process_startup, |
549 int* return_code) { | 548 int* return_code) { |
550 in_startup = process_startup; | 549 in_startup = process_startup; |
551 DCHECK(profile); | 550 DCHECK(profile); |
552 #if defined(OS_CHROMEOS) | |
553 if (process_startup) { | |
554 // NetworkStateNotifier has to be initialized before Launching browser | |
555 // because the page load can happen in parallel to this UI thread | |
556 // and IO thread may access the NetworkStateNotifier. | |
557 chromeos::CrosLibrary::Get()->GetNetworkLibrary() | |
558 ->AddNetworkManagerObserver( | |
559 chromeos::NetworkStateNotifier::GetInstance()); | |
560 } | |
561 #endif | |
562 | 551 |
563 // Continue with the incognito profile from here on if Incognito mode | 552 // Continue with the incognito profile from here on if Incognito mode |
564 // is forced. | 553 // is forced. |
565 if (IncognitoIsForced(command_line, profile->GetPrefs())) { | 554 if (IncognitoIsForced(command_line, profile->GetPrefs())) { |
566 profile = profile->GetOffTheRecordProfile(); | 555 profile = profile->GetOffTheRecordProfile(); |
567 } else if (command_line.HasSwitch(switches::kIncognito)) { | 556 } else if (command_line.HasSwitch(switches::kIncognito)) { |
568 LOG(WARNING) << "Incognito mode disabled by policy, launching a normal " | 557 LOG(WARNING) << "Incognito mode disabled by policy, launching a normal " |
569 << "browser session."; | 558 << "browser session."; |
570 } | 559 } |
571 | 560 |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 if (!automation->InitializeChannel(channel_id)) | 1493 if (!automation->InitializeChannel(channel_id)) |
1505 return false; | 1494 return false; |
1506 automation->SetExpectedTabCount(expected_tabs); | 1495 automation->SetExpectedTabCount(expected_tabs); |
1507 | 1496 |
1508 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); | 1497 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); |
1509 DCHECK(list); | 1498 DCHECK(list); |
1510 list->AddProvider(automation); | 1499 list->AddProvider(automation); |
1511 | 1500 |
1512 return true; | 1501 return true; |
1513 } | 1502 } |
OLD | NEW |