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

Side by Side Diff: extensions/browser/api/app_runtime/app_runtime_api.cc

Issue 722703002: Make "source" a required argument of AppLaunchParams and fill in the argument in all call points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/app_runtime/app_runtime_api.h" 5 #include "extensions/browser/api/app_runtime/app_runtime_api.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "extensions/browser/event_router.h" 10 #include "extensions/browser/event_router.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 case extensions::SOURCE_RESTART: 76 case extensions::SOURCE_RESTART:
77 return app_runtime::LAUNCH_SOURCE_RESTART; 77 return app_runtime::LAUNCH_SOURCE_RESTART;
78 case extensions::SOURCE_LOAD_AND_LAUNCH: 78 case extensions::SOURCE_LOAD_AND_LAUNCH:
79 return app_runtime::LAUNCH_SOURCE_LOAD_AND_LAUNCH; 79 return app_runtime::LAUNCH_SOURCE_LOAD_AND_LAUNCH;
80 case extensions::SOURCE_COMMAND_LINE: 80 case extensions::SOURCE_COMMAND_LINE:
81 return app_runtime::LAUNCH_SOURCE_COMMAND_LINE; 81 return app_runtime::LAUNCH_SOURCE_COMMAND_LINE;
82 case extensions::SOURCE_FILE_HANDLER: 82 case extensions::SOURCE_FILE_HANDLER:
83 return app_runtime::LAUNCH_SOURCE_FILE_HANDLER; 83 return app_runtime::LAUNCH_SOURCE_FILE_HANDLER;
84 case extensions::SOURCE_URL_HANDLER: 84 case extensions::SOURCE_URL_HANDLER:
85 return app_runtime::LAUNCH_SOURCE_URL_HANDLER; 85 return app_runtime::LAUNCH_SOURCE_URL_HANDLER;
86
87 case extensions::SOURCE_SYSTEM_TRAY: 86 case extensions::SOURCE_SYSTEM_TRAY:
88 return app_runtime::LAUNCH_SOURCE_SYSTEM_TRAY; 87 return app_runtime::LAUNCH_SOURCE_SYSTEM_TRAY;
89 case extensions::SOURCE_ABOUT_PAGE: 88 case extensions::SOURCE_ABOUT_PAGE:
90 return app_runtime::LAUNCH_SOURCE_ABOUT_PAGE; 89 return app_runtime::LAUNCH_SOURCE_ABOUT_PAGE;
91 case extensions::SOURCE_KEYBOARD: 90 case extensions::SOURCE_KEYBOARD:
92 return app_runtime::LAUNCH_SOURCE_KEYBOARD; 91 return app_runtime::LAUNCH_SOURCE_KEYBOARD;
92 case extensions::SOURCE_EXTENSIONS_PAGE:
93 return app_runtime::LAUNCH_SOURCE_EXTENSIONS_PAGE;
94 case extensions::SOURCE_MANAGEMENT_API:
95 return app_runtime::LAUNCH_SOURCE_MANAGEMENT_API;
96 case extensions::SOURCE_EPHEMERAL_APP:
97 return app_runtime::LAUNCH_SOURCE_EPHEMERAL_APP;
98 case extensions::SOURCE_BACKGROUND:
99 return app_runtime::LAUNCH_SOURCE_BACKGROUND;
100 case extensions::SOURCE_KIOSK:
101 return app_runtime::LAUNCH_SOURCE_KIOSK;
102 case extensions::SOURCE_CHROME_INTERNAL:
103 return app_runtime::LAUNCH_SOURCE_CHROME_INTERNAL;
93 104
94 default: 105 default:
95 return app_runtime::LAUNCH_SOURCE_NONE; 106 return app_runtime::LAUNCH_SOURCE_NONE;
96 } 107 }
97 } 108 }
98 109
99 } // namespace 110 } // namespace
100 111
101 // static 112 // static
102 void AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent( 113 void AppRuntimeEventRouter::DispatchOnEmbedRequestedEvent(
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 launch_data.url.reset(new std::string(url.spec())); 193 launch_data.url.reset(new std::string(url.spec()));
183 launch_data.referrer_url.reset(new std::string(referrer_url.spec())); 194 launch_data.referrer_url.reset(new std::string(referrer_url.spec()));
184 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) { 195 if (extensions::FeatureSwitch::trace_app_source()->IsEnabled()) {
185 launch_data.source = source_enum; 196 launch_data.source = source_enum;
186 } 197 }
187 DispatchOnLaunchedEventImpl( 198 DispatchOnLaunchedEventImpl(
188 extension->id(), source_enum, launch_data.ToValue().Pass(), context); 199 extension->id(), source_enum, launch_data.ToValue().Pass(), context);
189 } 200 }
190 201
191 } // namespace extensions 202 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/test/remoting/remote_desktop_browsertest.cc ('k') | extensions/common/api/app_runtime.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698