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 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1412 // If there are any extra parameters, we expect each one to generate a | 1412 // If there are any extra parameters, we expect each one to generate a |
1413 // new tab; if there are none then we have no tabs | 1413 // new tab; if there are none then we have no tabs |
1414 std::vector<GURL> urls_to_open = GetURLsFromCommandLine( | 1414 std::vector<GURL> urls_to_open = GetURLsFromCommandLine( |
1415 command_line, cur_dir, profile); | 1415 command_line, cur_dir, profile); |
1416 size_t expected_tabs = | 1416 size_t expected_tabs = |
1417 std::max(static_cast<int>(urls_to_open.size()), 0); | 1417 std::max(static_cast<int>(urls_to_open.size()), 0); |
1418 if (expected_tabs == 0) | 1418 if (expected_tabs == 0) |
1419 silent_launch = true; | 1419 silent_launch = true; |
1420 | 1420 |
1421 if (command_line.HasSwitch(switches::kChromeFrame)) { | 1421 if (command_line.HasSwitch(switches::kChromeFrame)) { |
| 1422 #if !defined(USE_AURA) |
1422 if (!CreateAutomationProvider<ChromeFrameAutomationProvider>( | 1423 if (!CreateAutomationProvider<ChromeFrameAutomationProvider>( |
1423 automation_channel_id, profile, expected_tabs)) | 1424 automation_channel_id, profile, expected_tabs)) |
1424 return false; | 1425 return false; |
| 1426 #endif |
1425 } else { | 1427 } else { |
1426 if (!CreateAutomationProvider<AutomationProvider>( | 1428 if (!CreateAutomationProvider<AutomationProvider>( |
1427 automation_channel_id, profile, expected_tabs)) | 1429 automation_channel_id, profile, expected_tabs)) |
1428 return false; | 1430 return false; |
1429 } | 1431 } |
1430 } | 1432 } |
1431 | 1433 |
1432 // If we have been invoked to display a desktop notification on behalf of | 1434 // If we have been invoked to display a desktop notification on behalf of |
1433 // the service process, we do not want to open any browser windows. | 1435 // the service process, we do not want to open any browser windows. |
1434 if (command_line.HasSwitch(switches::kNotifyCloudPrintTokenExpired)) { | 1436 if (command_line.HasSwitch(switches::kNotifyCloudPrintTokenExpired)) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1501 return false; | 1503 return false; |
1502 automation->SetExpectedTabCount(expected_tabs); | 1504 automation->SetExpectedTabCount(expected_tabs); |
1503 | 1505 |
1504 AutomationProviderList* list = | 1506 AutomationProviderList* list = |
1505 g_browser_process->InitAutomationProviderList(); | 1507 g_browser_process->InitAutomationProviderList(); |
1506 DCHECK(list); | 1508 DCHECK(list); |
1507 list->AddProvider(automation); | 1509 list->AddProvider(automation); |
1508 | 1510 |
1509 return true; | 1511 return true; |
1510 } | 1512 } |
OLD | NEW |