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

Unified Diff: chrome/browser/chromeos/note_taking_app_utils.cc

Issue 2212303003: Implement app launch changes for app runtime extension proposal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tool-screenshot
Patch Set: Nits Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/note_taking_app_utils.cc
diff --git a/chrome/browser/chromeos/note_taking_app_utils.cc b/chrome/browser/chromeos/note_taking_app_utils.cc
index 1e3cef1ae66c233cac487ed25b832f1efc7ecb18..7ecffaff10897c3f4e415876e1fd6fe9050c18a8 100644
--- a/chrome/browser/chromeos/note_taking_app_utils.cc
+++ b/chrome/browser/chromeos/note_taking_app_utils.cc
@@ -11,13 +11,17 @@
#include "ash/common/system/chromeos/palette/palette_utils.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_split.h"
#include "chrome/browser/profiles/profile.h"
#include "chromeos/chromeos_switches.h"
#include "extensions/browser/extension_registry.h"
+#include "extensions/common/api/app_runtime.h"
#include "extensions/common/extension.h"
#include "url/gurl.h"
+namespace app_runtime = extensions::api::app_runtime;
+
namespace chromeos {
namespace {
@@ -75,13 +79,9 @@ void LaunchNoteTakingAppForNewNote(Profile* profile,
return;
}
- // TODO(derat): Launch with a "create new note" launch action once that's been
- // added to chrome.appRuntime. Also decide what should be passed as the launch
- // source.
- if (path.empty())
- apps::LaunchPlatformApp(profile, app, extensions::SOURCE_UNTRACKED);
- else
- apps::LaunchPlatformAppWithPath(profile, app, path);
+ auto action_data = base::MakeUnique<app_runtime::ActionData>();
+ action_data->action_type = app_runtime::ActionType::ACTION_TYPE_NEW_NOTE;
+ apps::LaunchPlatformAppWithAction(profile, app, std::move(action_data), path);
}
} // namespace chromeos
« no previous file with comments | « chrome/browser/apps/app_launch_for_metro_restart_win.cc ('k') | extensions/browser/api/app_runtime/app_runtime_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698