| 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 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 // Setting the time of the last action on the window here allows us to steal | 1185 // Setting the time of the last action on the window here allows us to steal |
| 1186 // focus, which is what the user wants when opening a new tab in an existing | 1186 // focus, which is what the user wants when opening a new tab in an existing |
| 1187 // browser window. | 1187 // browser window. |
| 1188 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeHandle()); | 1188 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeHandle()); |
| 1189 #endif | 1189 #endif |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 #if !defined(OS_MACOSX) | 1192 #if !defined(OS_MACOSX) |
| 1193 // In kiosk mode, we want to always be fullscreen, so switch to that now. | 1193 // In kiosk mode, we want to always be fullscreen, so switch to that now. |
| 1194 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 1194 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
| 1195 browser->ToggleFullscreenMode(false); | 1195 browser->ToggleFullscreenMode(); |
| 1196 #endif | 1196 #endif |
| 1197 | 1197 |
| 1198 for (size_t i = 0; i < tabs.size(); ++i) { | 1198 for (size_t i = 0; i < tabs.size(); ++i) { |
| 1199 // We skip URLs that we'd have to launch an external protocol handler for. | 1199 // We skip URLs that we'd have to launch an external protocol handler for. |
| 1200 // This avoids us getting into an infinite loop asking ourselves to open | 1200 // This avoids us getting into an infinite loop asking ourselves to open |
| 1201 // a URL, should the handler be (incorrectly) configured to be us. Anyone | 1201 // a URL, should the handler be (incorrectly) configured to be us. Anyone |
| 1202 // asking us to open such a URL should really ask the handler directly. | 1202 // asking us to open such a URL should really ask the handler directly. |
| 1203 bool handled_by_chrome = ProfileIOData::IsHandledURL(tabs[i].url) || | 1203 bool handled_by_chrome = ProfileIOData::IsHandledURL(tabs[i].url) || |
| 1204 (profile_ && profile_->GetProtocolHandlerRegistry()->IsHandledProtocol( | 1204 (profile_ && profile_->GetProtocolHandlerRegistry()->IsHandledProtocol( |
| 1205 tabs[i].url.scheme())); | 1205 tabs[i].url.scheme())); |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1859 | 1859 |
| 1860 Profile* profile = ProfileManager::GetLastUsedProfile(); | 1860 Profile* profile = ProfileManager::GetLastUsedProfile(); |
| 1861 if (!profile) { | 1861 if (!profile) { |
| 1862 // We should only be able to get here if the profile already exists and | 1862 // We should only be able to get here if the profile already exists and |
| 1863 // has been created. | 1863 // has been created. |
| 1864 NOTREACHED(); | 1864 NOTREACHED(); |
| 1865 return; | 1865 return; |
| 1866 } | 1866 } |
| 1867 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); | 1867 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); |
| 1868 } | 1868 } |
| OLD | NEW |