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

Side by Side Diff: content/browser/android/content_startup_flags.cc

Issue 10790066: Enable gesture events handling on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added remaining flags and removed unnecessary comments 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
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 "content/browser/android/content_startup_flags.h" 5 #include "content/browser/android/content_startup_flags.h"
6 6
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/string_split.h" 8 #include "base/string_split.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 void SetContentCommandLineFlags(int max_render_process_count, 44 void SetContentCommandLineFlags(int max_render_process_count,
45 const std::string& plugin_descriptor) { 45 const std::string& plugin_descriptor) {
46 // May be called multiple times, to cover all possible program entry points. 46 // May be called multiple times, to cover all possible program entry points.
47 static bool already_initialized = false; 47 static bool already_initialized = false;
48 if (already_initialized) return; 48 if (already_initialized) return;
49 already_initialized = true; 49 already_initialized = true;
50 50
51 CommandLine* parsed_command_line = CommandLine::ForCurrentProcess(); 51 CommandLine* parsed_command_line = CommandLine::ForCurrentProcess();
52 52
53 #if !defined(ANDROID_UPSTREAM_BRINGUP) 53
54 // TODO(yfriedman): Upstream this when bringing up rendering code and 54 // TODO(yfriedman): Upstream this when bringing up rendering code and
55 // rendering modes. b/6668088 55 // rendering modes. b/6668088
56 // Set subflags for the --graphics-mode=XYZ omnibus flag. 56 // Set subflags for the --graphics-mode=XYZ omnibus flag.
57 std::string graphics_mode; 57 std::string graphics_mode;
58 if (parsed_command_line->HasSwitch(switches::kGraphicsMode)) { 58 if (parsed_command_line->HasSwitch(switches::kGraphicsMode)) {
59 graphics_mode = parsed_command_line->GetSwitchValueASCII( 59 graphics_mode = parsed_command_line->GetSwitchValueASCII(
60 switches::kGraphicsMode); 60 switches::kGraphicsMode);
61 } else { 61 } else {
62 // Default mode is threaded compositor mode 62 // Default mode is threaded compositor mode
63 graphics_mode = switches::kGraphicsModeValueCompositor; 63 graphics_mode = switches::kGraphicsModeValueCompositor;
64 parsed_command_line->AppendSwitchNative( 64 parsed_command_line->AppendSwitchNative(
65 switches::kGraphicsMode, graphics_mode.c_str()); 65 switches::kGraphicsMode, graphics_mode.c_str());
66 } 66 }
67 67
68 if (graphics_mode == switches::kGraphicsModeValueBasic) { 68 if (graphics_mode == switches::kGraphicsModeValueBasic) {
69 // Intentionally blank. 69 // Intentionally blank.
70 } else if (graphics_mode == switches::kGraphicsModeValueCompositor) { 70 } else if (graphics_mode == switches::kGraphicsModeValueCompositor) {
71 SetCommandLineSwitch(switches::kForceCompositingMode); 71 SetCommandLineSwitch(switches::kForceCompositingMode);
72 SetCommandLineSwitch(switches::kEnableAcceleratedPlugins); 72 SetCommandLineSwitch(switches::kEnableAcceleratedPlugins);
73 SetCommandLineSwitch(switches::kEnableCompositingForFixedPosition); 73 SetCommandLineSwitch(switches::kEnableCompositingForFixedPosition);
74 SetCommandLineSwitch(switches::kEnableThreadedCompositing); 74 SetCommandLineSwitch(switches::kEnableThreadedCompositing);
75 #if !defined(ANDROID_UPSTREAM_BRINGUP)
75 // Per tile painting saves memory in background tabs (http://b/5669228). 76 // Per tile painting saves memory in background tabs (http://b/5669228).
76 SetCommandLineSwitch(switches::kEnablePerTilePainting); 77 SetCommandLineSwitch(switches::kEnablePerTilePainting);
78 #endif
79
77 } else { 80 } else {
78 LOG(FATAL) << "Invalid --graphics-mode flag: " << graphics_mode; 81 LOG(FATAL) << "Invalid --graphics-mode flag: " << graphics_mode;
79 } 82 }
80 #endif
81 83
82 if (parsed_command_line->HasSwitch(switches::kRendererProcessLimit)) { 84 if (parsed_command_line->HasSwitch(switches::kRendererProcessLimit)) {
83 std::string limit = parsed_command_line->GetSwitchValueASCII( 85 std::string limit = parsed_command_line->GetSwitchValueASCII(
84 switches::kRendererProcessLimit); 86 switches::kRendererProcessLimit);
85 int value; 87 int value;
86 if (base::StringToInt(limit, &value)) 88 if (base::StringToInt(limit, &value))
87 max_render_process_count = value; 89 max_render_process_count = value;
88 } 90 }
89 91
90 if (max_render_process_count <= 0) { 92 if (max_render_process_count <= 0) {
(...skipping 30 matching lines...) Expand all
121 "1"); 123 "1");
122 124
123 // TODO(aelias): Enable these flags once they're merged in from upstream. 125 // TODO(aelias): Enable these flags once they're merged in from upstream.
124 // parsed_command_line->AppendSwitch(switches::kEnableTouchEvents); 126 // parsed_command_line->AppendSwitch(switches::kEnableTouchEvents);
125 // parsed_command_line->AppendSwitch(switches::kEnablePinch); 127 // parsed_command_line->AppendSwitch(switches::kEnablePinch);
126 128
127 SetPepperCommandLineFlags(plugin_descriptor); 129 SetPepperCommandLineFlags(plugin_descriptor);
128 } 130 }
129 131
130 } // namespace content 132 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/android/content_view_core_impl.h » ('j') | content/browser/android/content_view_core_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698