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

Side by Side Diff: chrome/browser/ui/browser_init.cc

Issue 8371022: touchui: Update a couple of command-line flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 | « chrome/browser/chromeos/login/login_utils.cc ('k') | chrome/common/chrome_switches.h » ('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) 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 #include "chrome/browser/chromeos/gview_request_interceptor.h" 101 #include "chrome/browser/chromeos/gview_request_interceptor.h"
102 #include "chrome/browser/chromeos/low_battery_observer.h" 102 #include "chrome/browser/chromeos/low_battery_observer.h"
103 #include "chrome/browser/chromeos/network_message_observer.h" 103 #include "chrome/browser/chromeos/network_message_observer.h"
104 #include "chrome/browser/chromeos/sms_observer.h" 104 #include "chrome/browser/chromeos/sms_observer.h"
105 #include "chrome/browser/chromeos/update_observer.h" 105 #include "chrome/browser/chromeos/update_observer.h"
106 #if defined(TOOLKIT_USES_GTK) 106 #if defined(TOOLKIT_USES_GTK)
107 #include "chrome/browser/chromeos/wm_message_listener.h" 107 #include "chrome/browser/chromeos/wm_message_listener.h"
108 #endif 108 #endif
109 #endif 109 #endif
110 110
111 #if defined(TOUCH_UI) 111 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX)
112 #include "ui/base/touch/touch_factory.h" 112 #include "ui/base/touch/touch_factory.h"
113 #endif 113 #endif
114 114
115 namespace { 115 namespace {
116 116
117 // SetAsDefaultBrowserTask ---------------------------------------------------- 117 // SetAsDefaultBrowserTask ----------------------------------------------------
118 118
119 class SetAsDefaultBrowserTask : public Task { 119 class SetAsDefaultBrowserTask : public Task {
120 public: 120 public:
121 SetAsDefaultBrowserTask(); 121 SetAsDefaultBrowserTask();
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 } 1480 }
1481 1481
1482 #if defined(OS_CHROMEOS) 1482 #if defined(OS_CHROMEOS)
1483 // The browser will be launched after the user logs in. 1483 // The browser will be launched after the user logs in.
1484 if (command_line.HasSwitch(switches::kLoginManager) || 1484 if (command_line.HasSwitch(switches::kLoginManager) ||
1485 command_line.HasSwitch(switches::kLoginPassword)) { 1485 command_line.HasSwitch(switches::kLoginPassword)) {
1486 silent_launch = true; 1486 silent_launch = true;
1487 } 1487 }
1488 #endif 1488 #endif
1489 1489
1490 #if defined(TOUCH_UI) 1490 #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX)
1491 // Get a list of pointer-devices that should be treated as touch-devices. 1491 // Get a list of pointer-devices that should be treated as touch-devices.
1492 // TODO(sad): Instead of/in addition to getting the list from the 1492 // This is primarily used for testing/debugging touch-event processing when a
1493 // command-line, query X for a list of touch devices. 1493 // touch-device isn't available.
1494 std::string touch_devices = 1494 std::string touch_devices =
1495 command_line.GetSwitchValueASCII(switches::kTouchDevices); 1495 command_line.GetSwitchValueASCII(switches::kTouchDevices);
1496 1496
1497 if (!touch_devices.empty()) { 1497 if (!touch_devices.empty()) {
1498 std::vector<std::string> devs; 1498 std::vector<std::string> devs;
1499 std::vector<unsigned int> device_ids; 1499 std::vector<unsigned int> device_ids;
1500 unsigned int devid; 1500 unsigned int devid;
1501 base::SplitString(touch_devices, ',', &devs); 1501 base::SplitString(touch_devices, ',', &devs);
1502 for (std::vector<std::string>::iterator iter = devs.begin(); 1502 for (std::vector<std::string>::iterator iter = devs.begin();
1503 iter != devs.end(); ++iter) { 1503 iter != devs.end(); ++iter) {
1504 if (base::StringToInt(*iter, reinterpret_cast<int*>(&devid))) { 1504 if (base::StringToInt(*iter, reinterpret_cast<int*>(&devid)))
1505 device_ids.push_back(devid); 1505 device_ids.push_back(devid);
1506 } else { 1506 else
1507 DLOG(WARNING) << "Invalid touch-device id: " << *iter; 1507 DLOG(WARNING) << "Invalid touch-device id: " << *iter;
1508 }
1509 } 1508 }
1510 ui::TouchFactory::GetInstance()->SetTouchDeviceList(device_ids); 1509 ui::TouchFactory::GetInstance()->SetTouchDeviceList(device_ids);
1511 } 1510 }
1512 #endif 1511 #endif
1513 1512
1514 // If we don't want to launch a new browser window or tab (in the case 1513 // If we don't want to launch a new browser window or tab (in the case
1515 // of an automation request), we are done here. 1514 // of an automation request), we are done here.
1516 if (!silent_launch) { 1515 if (!silent_launch) {
1517 IsProcessStartup is_process_startup = process_startup ? 1516 IsProcessStartup is_process_startup = process_startup ?
1518 IS_PROCESS_STARTUP : IS_NOT_PROCESS_STARTUP; 1517 IS_PROCESS_STARTUP : IS_NOT_PROCESS_STARTUP;
(...skipping 15 matching lines...) Expand all
1534 if (!automation->InitializeChannel(channel_id)) 1533 if (!automation->InitializeChannel(channel_id))
1535 return false; 1534 return false;
1536 automation->SetExpectedTabCount(expected_tabs); 1535 automation->SetExpectedTabCount(expected_tabs);
1537 1536
1538 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); 1537 AutomationProviderList* list = g_browser_process->GetAutomationProviderList();
1539 DCHECK(list); 1538 DCHECK(list);
1540 list->AddProvider(automation); 1539 list->AddProvider(automation);
1541 1540
1542 return true; 1541 return true;
1543 } 1542 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/login_utils.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698