Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 10831042: Revert 148676 - Revert revert of 146149 - Don't pass the connector check policy flag along. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 1543
1544 // If the command line specifies --pack-extension, attempt the pack extension 1544 // If the command line specifies --pack-extension, attempt the pack extension
1545 // startup action and exit. 1545 // startup action and exit.
1546 if (parsed_command_line().HasSwitch(switches::kPackExtension)) { 1546 if (parsed_command_line().HasSwitch(switches::kPackExtension)) {
1547 ExtensionsStartupUtil extension_startup_util; 1547 ExtensionsStartupUtil extension_startup_util;
1548 if (extension_startup_util.PackExtension(parsed_command_line())) 1548 if (extension_startup_util.PackExtension(parsed_command_line()))
1549 return content::RESULT_CODE_NORMAL_EXIT; 1549 return content::RESULT_CODE_NORMAL_EXIT;
1550 return chrome::RESULT_CODE_PACK_EXTENSION_ERROR; 1550 return chrome::RESULT_CODE_PACK_EXTENSION_ERROR;
1551 } 1551 }
1552 1552
1553 bool pass_command_line = true;
1554
1555 #if !defined(OS_MACOSX) 1553 #if !defined(OS_MACOSX)
1556 // In environments other than Mac OS X we support import of settings 1554 // In environments other than Mac OS X we support import of settings
1557 // from other browsers. In case this process is a short-lived "import" 1555 // from other browsers. In case this process is a short-lived "import"
1558 // process that another browser runs just to import the settings, we 1556 // process that another browser runs just to import the settings, we
1559 // don't want to be checking for another browser process, by design. 1557 // don't want to be checking for another browser process, by design.
1560 pass_command_line = !HasImportSwitch(parsed_command_line()); 1558 if (!HasImportSwitch(parsed_command_line())) {
1561 #endif 1559 #endif
1562
1563 // If we're being launched just to check the connector policy, we are
1564 // short-lived and don't want to be passing that switch off.
1565 pass_command_line = pass_command_line && !parsed_command_line().HasSwitch(
1566 switches::kCheckCloudPrintConnectorPolicy);
1567
1568 if (pass_command_line) {
1569 // When another process is running, use that process instead of starting a 1560 // When another process is running, use that process instead of starting a
1570 // new one. NotifyOtherProcess will currently give the other process up to 1561 // new one. NotifyOtherProcess will currently give the other process up to
1571 // 20 seconds to respond. Note that this needs to be done before we attempt 1562 // 20 seconds to respond. Note that this needs to be done before we attempt
1572 // to read the profile. 1563 // to read the profile.
1573 notify_result_ = process_singleton_->NotifyOtherProcessOrCreate( 1564 notify_result_ = process_singleton_->NotifyOtherProcessOrCreate(
1574 base::Bind(&ProcessSingletonNotificationCallback)); 1565 base::Bind(&ProcessSingletonNotificationCallback));
1575 switch (notify_result_) { 1566 switch (notify_result_) {
1576 case ProcessSingleton::PROCESS_NONE: 1567 case ProcessSingleton::PROCESS_NONE:
1577 // No process already running, fall through to starting a new one. 1568 // No process already running, fall through to starting a new one.
1578 break; 1569 break;
1579 1570
1580 case ProcessSingleton::PROCESS_NOTIFIED: 1571 case ProcessSingleton::PROCESS_NOTIFIED:
1581 #if defined(OS_POSIX) && !defined(OS_MACOSX) 1572 #if defined(OS_POSIX) && !defined(OS_MACOSX)
1582 printf("%s\n", base::SysWideToNativeMB(UTF16ToWide( 1573 printf("%s\n", base::SysWideToNativeMB(UTF16ToWide(
1583 l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str()); 1574 l10n_util::GetStringUTF16(IDS_USED_EXISTING_BROWSER))).c_str());
1584 #endif 1575 #endif
1585 return chrome::RESULT_CODE_NORMAL_EXIT_PROCESS_NOTIFIED; 1576 return content::RESULT_CODE_NORMAL_EXIT;
1586 1577
1587 case ProcessSingleton::PROFILE_IN_USE: 1578 case ProcessSingleton::PROFILE_IN_USE:
1588 return chrome::RESULT_CODE_PROFILE_IN_USE; 1579 return chrome::RESULT_CODE_PROFILE_IN_USE;
1589 1580
1590 case ProcessSingleton::LOCK_ERROR: 1581 case ProcessSingleton::LOCK_ERROR:
1591 LOG(ERROR) << "Failed to create a ProcessSingleton for your profile " 1582 LOG(ERROR) << "Failed to create a ProcessSingleton for your profile "
1592 "directory. This means that running multiple instances " 1583 "directory. This means that running multiple instances "
1593 "would start multiple browser processes rather than " 1584 "would start multiple browser processes rather than "
1594 "opening a new window in the existing process. Aborting " 1585 "opening a new window in the existing process. Aborting "
1595 "now to avoid profile corruption."; 1586 "now to avoid profile corruption.";
1596 return chrome::RESULT_CODE_PROFILE_IN_USE; 1587 return chrome::RESULT_CODE_PROFILE_IN_USE;
1597 1588
1598 default: 1589 default:
1599 NOTREACHED(); 1590 NOTREACHED();
1600 } 1591 }
1592 #if !defined(OS_MACOSX) // closing brace for if
1601 } 1593 }
1594 #endif
1602 1595
1603 #if defined(USE_X11) 1596 #if defined(USE_X11)
1604 SetBrowserX11ErrorHandlers(); 1597 SetBrowserX11ErrorHandlers();
1605 #endif 1598 #endif
1606 1599
1607 // Desktop construction occurs here, (required before profile creation). 1600 // Desktop construction occurs here, (required before profile creation).
1608 PreProfileInit(); 1601 PreProfileInit();
1609 1602
1610 // Profile creation ---------------------------------------------------------- 1603 // Profile creation ----------------------------------------------------------
1611 1604
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
2080 if (base::win::GetVersion() <= base::win::VERSION_XP) 2073 if (base::win::GetVersion() <= base::win::VERSION_XP)
2081 uma_name += "_XP"; 2074 uma_name += "_XP";
2082 2075
2083 uma_name += "_PreRead_"; 2076 uma_name += "_PreRead_";
2084 uma_name += pre_read_percentage; 2077 uma_name += pre_read_percentage;
2085 AddPreReadHistogramTime(uma_name.c_str(), time); 2078 AddPreReadHistogramTime(uma_name.c_str(), time);
2086 } 2079 }
2087 #endif 2080 #endif
2088 #endif 2081 #endif
2089 } 2082 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/cloud_print/test/cloud_print_policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698