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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 DCHECK(!tabs.empty()); | 1030 DCHECK(!tabs.empty()); |
1031 // If we don't yet have a profile, try to use the one we're given from | 1031 // If we don't yet have a profile, try to use the one we're given from |
1032 // |browser|. While we may not end up actually using |browser| (since it | 1032 // |browser|. While we may not end up actually using |browser| (since it |
1033 // could be a popup window), we can at least use the profile. | 1033 // could be a popup window), we can at least use the profile. |
1034 if (!profile_ && browser) | 1034 if (!profile_ && browser) |
1035 profile_ = browser->profile(); | 1035 profile_ = browser->profile(); |
1036 | 1036 |
1037 if (!browser || !browser->is_type_tabbed()) { | 1037 if (!browser || !browser->is_type_tabbed()) { |
1038 browser = Browser::Create(profile_); | 1038 browser = Browser::Create(profile_); |
1039 } else { | 1039 } else { |
1040 #if defined(TOOLKIT_GTK) | 1040 #if defined(TOOLKIT_GTK) && !defined(USE_AURA) |
1041 // Setting the time of the last action on the window here allows us to steal | 1041 // Setting the time of the last action on the window here allows us to steal |
1042 // focus, which is what the user wants when opening a new tab in an existing | 1042 // focus, which is what the user wants when opening a new tab in an existing |
1043 // browser window. | 1043 // browser window. |
1044 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeHandle()); | 1044 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeHandle()); |
1045 #endif | 1045 #endif |
1046 } | 1046 } |
1047 | 1047 |
1048 #if !defined(OS_MACOSX) | 1048 #if !defined(OS_MACOSX) |
1049 // In kiosk mode, we want to always be fullscreen, so switch to that now. | 1049 // In kiosk mode, we want to always be fullscreen, so switch to that now. |
1050 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 1050 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 if (!automation->InitializeChannel(channel_id)) | 1504 if (!automation->InitializeChannel(channel_id)) |
1505 return false; | 1505 return false; |
1506 automation->SetExpectedTabCount(expected_tabs); | 1506 automation->SetExpectedTabCount(expected_tabs); |
1507 | 1507 |
1508 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); | 1508 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); |
1509 DCHECK(list); | 1509 DCHECK(list); |
1510 list->AddProvider(automation); | 1510 list->AddProvider(automation); |
1511 | 1511 |
1512 return true; | 1512 return true; |
1513 } | 1513 } |
OLD | NEW |