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

Side by Side Diff: chrome/browser/extensions/api/app/app_api.cc

Issue 10543070: Remove #if from platform app launch code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | no next file » | 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/extensions/api/app/app_api.h" 5 #include "chrome/browser/extensions/api/app/app_api.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 Profile* profile, const Extension* extension, const string16& action, 128 Profile* profile, const Extension* extension, const string16& action,
129 const std::string& file_system_id, const FilePath& base_name) { 129 const std::string& file_system_id, const FilePath& base_name) {
130 ListValue args; 130 ListValue args;
131 DictionaryValue* launch_data = new DictionaryValue(); 131 DictionaryValue* launch_data = new DictionaryValue();
132 DictionaryValue* intent = new DictionaryValue(); 132 DictionaryValue* intent = new DictionaryValue();
133 intent->SetString("action", UTF16ToUTF8(action)); 133 intent->SetString("action", UTF16ToUTF8(action));
134 launch_data->Set("intent", intent); 134 launch_data->Set("intent", intent);
135 intent->SetString("type", "chrome-extension://fileentry"); 135 intent->SetString("type", "chrome-extension://fileentry");
136 args.Append(launch_data); 136 args.Append(launch_data);
137 args.Append(Value::CreateStringValue(file_system_id)); 137 args.Append(Value::CreateStringValue(file_system_id));
138 #if defined(OS_WIN) 138 args.Append(Value::CreateStringValue(base_name.AsUTF8Unsafe()));
139 args.Append(Value::CreateStringValue(UTF16ToUTF8(base_name.value())));
140 #else
141 args.Append(Value::CreateStringValue(base_name.value()));
142 #endif
143 std::string json_args; 139 std::string json_args;
144 base::JSONWriter::Write(&args, &json_args); 140 base::JSONWriter::Write(&args, &json_args);
145 profile->GetExtensionEventRouter()->DispatchEventToExtension( 141 profile->GetExtensionEventRouter()->DispatchEventToExtension(
146 extension->id(), kOnLaunchedEvent, json_args, NULL, GURL()); 142 extension->id(), kOnLaunchedEvent, json_args, NULL, GURL());
147 } 143 }
148 144
149 } // namespace extensions 145 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698