| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 // Setting the time of the last action on the window here allows us to steal | 1175 // Setting the time of the last action on the window here allows us to steal |
| 1176 // focus, which is what the user wants when opening a new tab in an existing | 1176 // focus, which is what the user wants when opening a new tab in an existing |
| 1177 // browser window. | 1177 // browser window. |
| 1178 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeHandle()); | 1178 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeHandle()); |
| 1179 #endif | 1179 #endif |
| 1180 } | 1180 } |
| 1181 | 1181 |
| 1182 #if !defined(OS_MACOSX) | 1182 #if !defined(OS_MACOSX) |
| 1183 // In kiosk mode, we want to always be fullscreen, so switch to that now. | 1183 // In kiosk mode, we want to always be fullscreen, so switch to that now. |
| 1184 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 1184 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
| 1185 browser->ToggleFullscreenMode(false); | 1185 browser->ToggleFullscreenMode(); |
| 1186 #endif | 1186 #endif |
| 1187 | 1187 |
| 1188 for (size_t i = 0; i < tabs.size(); ++i) { | 1188 for (size_t i = 0; i < tabs.size(); ++i) { |
| 1189 // We skip URLs that we'd have to launch an external protocol handler for. | 1189 // We skip URLs that we'd have to launch an external protocol handler for. |
| 1190 // This avoids us getting into an infinite loop asking ourselves to open | 1190 // This avoids us getting into an infinite loop asking ourselves to open |
| 1191 // a URL, should the handler be (incorrectly) configured to be us. Anyone | 1191 // a URL, should the handler be (incorrectly) configured to be us. Anyone |
| 1192 // asking us to open such a URL should really ask the handler directly. | 1192 // asking us to open such a URL should really ask the handler directly. |
| 1193 bool handled_by_chrome = ProfileIOData::IsHandledURL(tabs[i].url) || | 1193 bool handled_by_chrome = ProfileIOData::IsHandledURL(tabs[i].url) || |
| 1194 (profile_ && profile_->GetProtocolHandlerRegistry()->IsHandledProtocol( | 1194 (profile_ && profile_->GetProtocolHandlerRegistry()->IsHandledProtocol( |
| 1195 tabs[i].url.scheme())); | 1195 tabs[i].url.scheme())); |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1832 | 1832 |
| 1833 Profile* profile = ProfileManager::GetLastUsedProfile(); | 1833 Profile* profile = ProfileManager::GetLastUsedProfile(); |
| 1834 if (!profile) { | 1834 if (!profile) { |
| 1835 // We should only be able to get here if the profile already exists and | 1835 // We should only be able to get here if the profile already exists and |
| 1836 // has been created. | 1836 // has been created. |
| 1837 NOTREACHED(); | 1837 NOTREACHED(); |
| 1838 return; | 1838 return; |
| 1839 } | 1839 } |
| 1840 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); | 1840 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); |
| 1841 } | 1841 } |
| OLD | NEW |