| 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/startup/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/browser/profiles/profile.h" | 34 #include "chrome/browser/profiles/profile.h" |
| 35 #include "chrome/browser/profiles/profile_io_data.h" | 35 #include "chrome/browser/profiles/profile_io_data.h" |
| 36 #include "chrome/browser/protector/protected_prefs_watcher.h" | 36 #include "chrome/browser/protector/protected_prefs_watcher.h" |
| 37 #include "chrome/browser/protector/protector_service.h" | 37 #include "chrome/browser/protector/protector_service.h" |
| 38 #include "chrome/browser/protector/protector_service_factory.h" | 38 #include "chrome/browser/protector/protector_service_factory.h" |
| 39 #include "chrome/browser/protector/protector_utils.h" | 39 #include "chrome/browser/protector/protector_utils.h" |
| 40 #include "chrome/browser/sessions/session_restore.h" | 40 #include "chrome/browser/sessions/session_restore.h" |
| 41 #include "chrome/browser/sessions/session_service.h" | 41 #include "chrome/browser/sessions/session_service.h" |
| 42 #include "chrome/browser/sessions/session_service_factory.h" | 42 #include "chrome/browser/sessions/session_service_factory.h" |
| 43 #include "chrome/browser/shell_integration.h" | 43 #include "chrome/browser/shell_integration.h" |
| 44 #include "chrome/browser/ui/browser_commands.h" |
| 44 #include "chrome/browser/ui/browser_finder.h" | 45 #include "chrome/browser/ui/browser_finder.h" |
| 45 #include "chrome/browser/ui/browser_list.h" | 46 #include "chrome/browser/ui/browser_list.h" |
| 46 #include "chrome/browser/ui/browser_navigator.h" | 47 #include "chrome/browser/ui/browser_navigator.h" |
| 47 #include "chrome/browser/ui/browser_tabrestore.h" | 48 #include "chrome/browser/ui/browser_tabrestore.h" |
| 48 #include "chrome/browser/ui/browser_tabstrip.h" | 49 #include "chrome/browser/ui/browser_tabstrip.h" |
| 49 #include "chrome/browser/ui/browser_window.h" | 50 #include "chrome/browser/ui/browser_window.h" |
| 50 #include "chrome/browser/ui/extensions/application_launch.h" | 51 #include "chrome/browser/ui/extensions/application_launch.h" |
| 51 #include "chrome/browser/ui/startup/autolaunch_prompt.h" | 52 #include "chrome/browser/ui/startup/autolaunch_prompt.h" |
| 52 #include "chrome/browser/ui/startup/bad_flags_prompt.h" | 53 #include "chrome/browser/ui/startup/bad_flags_prompt.h" |
| 53 #include "chrome/browser/ui/startup/default_browser_prompt.h" | 54 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 #if defined(TOOLKIT_GTK) | 673 #if defined(TOOLKIT_GTK) |
| 673 // Setting the time of the last action on the window here allows us to steal | 674 // Setting the time of the last action on the window here allows us to steal |
| 674 // focus, which is what the user wants when opening a new tab in an existing | 675 // focus, which is what the user wants when opening a new tab in an existing |
| 675 // browser window. | 676 // browser window. |
| 676 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow()); | 677 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow()); |
| 677 #endif | 678 #endif |
| 678 } | 679 } |
| 679 | 680 |
| 680 // In kiosk mode, we want to always be fullscreen, so switch to that now. | 681 // In kiosk mode, we want to always be fullscreen, so switch to that now. |
| 681 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 682 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
| 682 browser->ToggleFullscreenMode(); | 683 chrome::ToggleFullscreenMode(browser); |
| 683 | 684 |
| 684 bool first_tab = true; | 685 bool first_tab = true; |
| 685 for (size_t i = 0; i < tabs.size(); ++i) { | 686 for (size_t i = 0; i < tabs.size(); ++i) { |
| 686 // We skip URLs that we'd have to launch an external protocol handler for. | 687 // We skip URLs that we'd have to launch an external protocol handler for. |
| 687 // This avoids us getting into an infinite loop asking ourselves to open | 688 // This avoids us getting into an infinite loop asking ourselves to open |
| 688 // a URL, should the handler be (incorrectly) configured to be us. Anyone | 689 // a URL, should the handler be (incorrectly) configured to be us. Anyone |
| 689 // asking us to open such a URL should really ask the handler directly. | 690 // asking us to open such a URL should really ask the handler directly. |
| 690 bool handled_by_chrome = ProfileIOData::IsHandledURL(tabs[i].url) || | 691 bool handled_by_chrome = ProfileIOData::IsHandledURL(tabs[i].url) || |
| 691 (profile_ && profile_->GetProtocolHandlerRegistry()->IsHandledProtocol( | 692 (profile_ && profile_->GetProtocolHandlerRegistry()->IsHandledProtocol( |
| 692 tabs[i].url.scheme())); | 693 tabs[i].url.scheme())); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 // New: | 861 // New: |
| 861 prefs->GetString(prefs::kHomePage), | 862 prefs->GetString(prefs::kHomePage), |
| 862 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), | 863 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), |
| 863 prefs->GetBoolean(prefs::kShowHomeButton), | 864 prefs->GetBoolean(prefs::kShowHomeButton), |
| 864 // Backup: | 865 // Backup: |
| 865 backup_homepage, | 866 backup_homepage, |
| 866 backup_homepage_is_ntp, | 867 backup_homepage_is_ntp, |
| 867 backup_show_home_button)); | 868 backup_show_home_button)); |
| 868 } | 869 } |
| 869 } | 870 } |
| OLD | NEW |