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

Unified Diff: extensions/browser/api/app_window/app_window_api.cc

Issue 1914993002: Enhance chrome.app.window API with better shelf integration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + Fixes v10 Created 4 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/app_window/app_window_api.cc
diff --git a/extensions/browser/api/app_window/app_window_api.cc b/extensions/browser/api/app_window/app_window_api.cc
index 096f050bf6a839414c981de492d5f84b47dd566e..4f8be57cf179d468a58eee1427461e77502835b8 100644
--- a/extensions/browser/api/app_window/app_window_api.cc
+++ b/extensions/browser/api/app_window/app_window_api.cc
@@ -75,6 +75,8 @@ const char kImeWindowMustBeImeWindowOrPanel[] =
"IME extensions must create ime window ( with \"ime: true\" and "
"\"frame: 'none'\") or panel window (with \"type: panel\").";
#endif
+const char kShowInShelfWindowKeyNotSet[] =
+ "The \"showInShelf\" option requires the \"id\" option to be set.";
} // namespace app_window_constants
const char kNoneFrameOption[] = "none";
@@ -321,6 +323,15 @@ bool AppWindowCreateFunction::RunAsync() {
*options->visible_on_all_workspaces;
}
+ if (options->show_in_shelf.get()) {
+ create_params.show_in_shelf = *options->show_in_shelf.get();
+
+ if (create_params.show_in_shelf && create_params.window_key.empty()) {
+ error_ = app_window_constants::kShowInShelfWindowKeyNotSet;
+ return false;
+ }
+ }
+
if (options->type != app_window::WINDOW_TYPE_PANEL) {
switch (options->state) {
case app_window::STATE_NONE:
« no previous file with comments | « chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc ('k') | extensions/browser/app_window/app_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698