| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "chrome/browser/tab_contents/link_infobar_delegate.h" | 48 #include "chrome/browser/tab_contents/link_infobar_delegate.h" |
| 49 #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" | 49 #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" |
| 50 #include "chrome/browser/tabs/pinned_tab_codec.h" | 50 #include "chrome/browser/tabs/pinned_tab_codec.h" |
| 51 #include "chrome/browser/tabs/tab_strip_model.h" | 51 #include "chrome/browser/tabs/tab_strip_model.h" |
| 52 #include "chrome/browser/ui/browser_list.h" | 52 #include "chrome/browser/ui/browser_list.h" |
| 53 #include "chrome/browser/ui/browser_navigator.h" | 53 #include "chrome/browser/ui/browser_navigator.h" |
| 54 #include "chrome/browser/ui/browser_window.h" | 54 #include "chrome/browser/ui/browser_window.h" |
| 55 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 55 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 56 #include "chrome/common/chrome_constants.h" | 56 #include "chrome/common/chrome_constants.h" |
| 57 #include "chrome/common/chrome_paths.h" | 57 #include "chrome/common/chrome_paths.h" |
| 58 #include "chrome/common/chrome_result_codes.h" |
| 58 #include "chrome/common/chrome_switches.h" | 59 #include "chrome/common/chrome_switches.h" |
| 59 #include "chrome/common/extensions/extension_constants.h" | 60 #include "chrome/common/extensions/extension_constants.h" |
| 60 #include "chrome/common/pref_names.h" | 61 #include "chrome/common/pref_names.h" |
| 61 #include "chrome/common/url_constants.h" | 62 #include "chrome/common/url_constants.h" |
| 62 #include "chrome/installer/util/browser_distribution.h" | 63 #include "chrome/installer/util/browser_distribution.h" |
| 63 #include "content/browser/browser_thread.h" | 64 #include "content/browser/browser_thread.h" |
| 64 #include "content/browser/child_process_security_policy.h" | 65 #include "content/browser/child_process_security_policy.h" |
| 65 #include "content/browser/renderer_host/render_process_host.h" | 66 #include "content/browser/renderer_host/render_process_host.h" |
| 66 #include "content/browser/tab_contents/navigation_details.h" | 67 #include "content/browser/tab_contents/navigation_details.h" |
| 67 #include "content/browser/tab_contents/tab_contents_view.h" | 68 #include "content/browser/tab_contents/tab_contents_view.h" |
| 68 #include "content/common/result_codes.h" | |
| 69 #include "grit/chromium_strings.h" | 69 #include "grit/chromium_strings.h" |
| 70 #include "grit/generated_resources.h" | 70 #include "grit/generated_resources.h" |
| 71 #include "grit/locale_settings.h" | 71 #include "grit/locale_settings.h" |
| 72 #include "grit/theme_resources.h" | 72 #include "grit/theme_resources.h" |
| 73 #include "grit/theme_resources_standard.h" | 73 #include "grit/theme_resources_standard.h" |
| 74 #include "net/base/net_util.h" | 74 #include "net/base/net_util.h" |
| 75 #include "ui/base/l10n/l10n_util.h" | 75 #include "ui/base/l10n/l10n_util.h" |
| 76 #include "ui/base/resource/resource_bundle.h" | 76 #include "ui/base/resource/resource_bundle.h" |
| 77 #include "webkit/glue/webkit_glue.h" | 77 #include "webkit/glue/webkit_glue.h" |
| 78 | 78 |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 544 |
| 545 BrowserInit::LaunchWithProfile lwp(cur_dir, command_line, this); | 545 BrowserInit::LaunchWithProfile lwp(cur_dir, command_line, this); |
| 546 std::vector<GURL> urls_to_launch = BrowserInit::GetURLsFromCommandLine( | 546 std::vector<GURL> urls_to_launch = BrowserInit::GetURLsFromCommandLine( |
| 547 command_line, cur_dir, profile); | 547 command_line, cur_dir, profile); |
| 548 bool launched = lwp.Launch(profile, urls_to_launch, process_startup); | 548 bool launched = lwp.Launch(profile, urls_to_launch, process_startup); |
| 549 in_startup = false; | 549 in_startup = false; |
| 550 | 550 |
| 551 if (!launched) { | 551 if (!launched) { |
| 552 LOG(ERROR) << "launch error"; | 552 LOG(ERROR) << "launch error"; |
| 553 if (return_code) | 553 if (return_code) |
| 554 *return_code = ResultCodes::INVALID_CMDLINE_URL; | 554 *return_code = chrome::RESULT_CODE_INVALID_CMDLINE_URL; |
| 555 return false; | 555 return false; |
| 556 } | 556 } |
| 557 | 557 |
| 558 #if defined(OS_CHROMEOS) | 558 #if defined(OS_CHROMEOS) |
| 559 // Initialize Chrome OS preferences like touch pad sensitivity. For the | 559 // Initialize Chrome OS preferences like touch pad sensitivity. For the |
| 560 // preferences to work in the guest mode, the initialization has to be | 560 // preferences to work in the guest mode, the initialization has to be |
| 561 // done after |profile| is switched to the incognito profile (which | 561 // done after |profile| is switched to the incognito profile (which |
| 562 // is actually GuestSessionProfile in the guest mode). See the | 562 // is actually GuestSessionProfile in the guest mode). See the |
| 563 // GetOffTheRecordProfile() call above. | 563 // GetOffTheRecordProfile() call above. |
| 564 profile->InitChromeOSPreferences(); | 564 profile->InitChromeOSPreferences(); |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1438 return false; | 1438 return false; |
| 1439 automation->SetExpectedTabCount(expected_tabs); | 1439 automation->SetExpectedTabCount(expected_tabs); |
| 1440 | 1440 |
| 1441 AutomationProviderList* list = | 1441 AutomationProviderList* list = |
| 1442 g_browser_process->InitAutomationProviderList(); | 1442 g_browser_process->InitAutomationProviderList(); |
| 1443 DCHECK(list); | 1443 DCHECK(list); |
| 1444 list->AddProvider(automation); | 1444 list->AddProvider(automation); |
| 1445 | 1445 |
| 1446 return true; | 1446 return true; |
| 1447 } | 1447 } |
| OLD | NEW |