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 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 // Setting the time of the last action on the window here allows us to steal | 1052 // Setting the time of the last action on the window here allows us to steal |
1053 // focus, which is what the user wants when opening a new tab in an existing | 1053 // focus, which is what the user wants when opening a new tab in an existing |
1054 // browser window. | 1054 // browser window. |
1055 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeHandle()); | 1055 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeHandle()); |
1056 #endif | 1056 #endif |
1057 } | 1057 } |
1058 | 1058 |
1059 #if !defined(OS_MACOSX) | 1059 #if !defined(OS_MACOSX) |
1060 // In kiosk mode, we want to always be fullscreen, so switch to that now. | 1060 // In kiosk mode, we want to always be fullscreen, so switch to that now. |
1061 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 1061 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
1062 browser->ToggleFullscreenMode(); | 1062 browser->ToggleFullscreenMode(false); |
1063 #endif | 1063 #endif |
1064 | 1064 |
1065 bool first_tab = true; | 1065 bool first_tab = true; |
1066 for (size_t i = 0; i < tabs.size(); ++i) { | 1066 for (size_t i = 0; i < tabs.size(); ++i) { |
1067 // We skip URLs that we'd have to launch an external protocol handler for. | 1067 // We skip URLs that we'd have to launch an external protocol handler for. |
1068 // This avoids us getting into an infinite loop asking ourselves to open | 1068 // This avoids us getting into an infinite loop asking ourselves to open |
1069 // a URL, should the handler be (incorrectly) configured to be us. Anyone | 1069 // a URL, should the handler be (incorrectly) configured to be us. Anyone |
1070 // asking us to open such a URL should really ask the handler directly. | 1070 // asking us to open such a URL should really ask the handler directly. |
1071 bool handled_by_chrome = ProfileIOData::IsHandledURL(tabs[i].url) || | 1071 bool handled_by_chrome = ProfileIOData::IsHandledURL(tabs[i].url) || |
1072 (profile_ && profile_->GetProtocolHandlerRegistry()->IsHandledProtocol( | 1072 (profile_ && profile_->GetProtocolHandlerRegistry()->IsHandledProtocol( |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 if (!automation->InitializeChannel(channel_id)) | 1530 if (!automation->InitializeChannel(channel_id)) |
1531 return false; | 1531 return false; |
1532 automation->SetExpectedTabCount(expected_tabs); | 1532 automation->SetExpectedTabCount(expected_tabs); |
1533 | 1533 |
1534 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); | 1534 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); |
1535 DCHECK(list); | 1535 DCHECK(list); |
1536 list->AddProvider(automation); | 1536 list->AddProvider(automation); |
1537 | 1537 |
1538 return true; | 1538 return true; |
1539 } | 1539 } |
OLD | NEW |