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

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

Issue 2209053004: Enhance chrome.app.window API with icon property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review v5 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
« no previous file with comments | « no previous file | extensions/browser/app_window/app_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4f8be57cf179d468a58eee1427461e77502835b8..e92e7e7f659ecd0b5430033481aafe7020d6f6ea 100644
--- a/extensions/browser/api/app_window/app_window_api.cc
+++ b/extensions/browser/api/app_window/app_window_api.cc
@@ -332,6 +332,17 @@ bool AppWindowCreateFunction::RunAsync() {
}
}
+ if (options->icon.get()) {
+ // First, check if the window icon URL is a valid global URL.
+ create_params.window_icon_url = GURL(*options->icon.get());
+
+ // If the URL is not global, check for a valid extension local URL.
+ if (!create_params.window_icon_url.is_valid()) {
+ create_params.window_icon_url =
+ extension()->GetResourceURL(*options->icon.get());
+ }
+ }
+
if (options->type != app_window::WINDOW_TYPE_PANEL) {
switch (options->state) {
case app_window::STATE_NONE:
« no previous file with comments | « no previous file | extensions/browser/app_window/app_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698