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