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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 #include "content/browser/tab_contents/navigation_details.h" | 71 #include "content/browser/tab_contents/navigation_details.h" |
72 #include "content/browser/tab_contents/tab_contents_view.h" | 72 #include "content/browser/tab_contents/tab_contents_view.h" |
73 #include "grit/chromium_strings.h" | 73 #include "grit/chromium_strings.h" |
74 #include "grit/generated_resources.h" | 74 #include "grit/generated_resources.h" |
75 #include "grit/locale_settings.h" | 75 #include "grit/locale_settings.h" |
76 #include "grit/theme_resources.h" | 76 #include "grit/theme_resources.h" |
77 #include "grit/theme_resources_standard.h" | 77 #include "grit/theme_resources_standard.h" |
78 #include "net/base/net_util.h" | 78 #include "net/base/net_util.h" |
79 #include "ui/base/l10n/l10n_util.h" | 79 #include "ui/base/l10n/l10n_util.h" |
80 #include "ui/base/resource/resource_bundle.h" | 80 #include "ui/base/resource/resource_bundle.h" |
81 #include "webkit/glue/webkit_glue.h" | |
82 | 81 |
83 #if defined(OS_MACOSX) | 82 #if defined(OS_MACOSX) |
84 #include "base/mac/mac_util.h" | 83 #include "base/mac/mac_util.h" |
85 #include "chrome/browser/ui/cocoa/keystone_infobar.h" | 84 #include "chrome/browser/ui/cocoa/keystone_infobar.h" |
86 #endif | 85 #endif |
87 | 86 |
88 #if defined(TOOLKIT_USES_GTK) | 87 #if defined(TOOLKIT_USES_GTK) |
89 #include "chrome/browser/ui/gtk/gtk_util.h" | 88 #include "chrome/browser/ui/gtk/gtk_util.h" |
90 #endif | 89 #endif |
91 | 90 |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 g_browser_process->InitDevToolsHttpProtocolHandler( | 682 g_browser_process->InitDevToolsHttpProtocolHandler( |
684 profile, | 683 profile, |
685 "127.0.0.1", | 684 "127.0.0.1", |
686 static_cast<int>(port), | 685 static_cast<int>(port), |
687 ""); | 686 ""); |
688 } else { | 687 } else { |
689 DLOG(WARNING) << "Invalid http debugger port number " << port; | 688 DLOG(WARNING) << "Invalid http debugger port number " << port; |
690 } | 689 } |
691 } | 690 } |
692 | 691 |
693 if (command_line_.HasSwitch(switches::kUserAgent)) { | |
694 webkit_glue::SetUserAgent(command_line_.GetSwitchValueASCII( | |
695 switches::kUserAgent)); | |
696 } | |
697 | |
698 // Open the required browser windows and tabs. First, see if | 692 // Open the required browser windows and tabs. First, see if |
699 // we're being run as an application window. If so, the user | 693 // we're being run as an application window. If so, the user |
700 // opened an app shortcut. Don't restore tabs or open initial | 694 // opened an app shortcut. Don't restore tabs or open initial |
701 // URLs in that case. The user should see the window as an app, | 695 // URLs in that case. The user should see the window as an app, |
702 // not as chrome. | 696 // not as chrome. |
703 if (OpenApplicationWindow(profile)) { | 697 if (OpenApplicationWindow(profile)) { |
704 RecordLaunchModeHistogram(LM_AS_WEBAPP); | 698 RecordLaunchModeHistogram(LM_AS_WEBAPP); |
705 } else { | 699 } else { |
706 RecordLaunchModeHistogram(urls_to_open.empty()? | 700 RecordLaunchModeHistogram(urls_to_open.empty()? |
707 LM_TO_BE_DECIDED : LM_WITH_URLS); | 701 LM_TO_BE_DECIDED : LM_WITH_URLS); |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 if (!automation->InitializeChannel(channel_id)) | 1487 if (!automation->InitializeChannel(channel_id)) |
1494 return false; | 1488 return false; |
1495 automation->SetExpectedTabCount(expected_tabs); | 1489 automation->SetExpectedTabCount(expected_tabs); |
1496 | 1490 |
1497 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); | 1491 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); |
1498 DCHECK(list); | 1492 DCHECK(list); |
1499 list->AddProvider(automation); | 1493 list->AddProvider(automation); |
1500 | 1494 |
1501 return true; | 1495 return true; |
1502 } | 1496 } |
OLD | NEW |