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

Unified Diff: extensions/browser/app_window/app_window.h

Issue 2209053004: Enhance chrome.app.window API with icon property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: extensions/browser/app_window/app_window.h
diff --git a/extensions/browser/app_window/app_window.h b/extensions/browser/app_window/app_window.h
index 1e30bab83f4e42725ef6e9ecc69b45b01c8a9212..4d505b42887f51c92e8e090835cd5d0df20808de 100644
--- a/extensions/browser/app_window/app_window.h
+++ b/extensions/browser/app_window/app_window.h
@@ -196,6 +196,9 @@ class AppWindow : public content::WebContentsDelegate,
// the app. Defaults to false.
bool show_in_shelf;
+ // Icon URL to be used for setting the window icon.
+ GURL window_icon_url;
+
// The API enables developers to specify content or window bounds. This
// function combines them into a single, constrained window size.
gfx::Rect GetInitialWindowBounds(const gfx::Insets& frame_insets) const;
@@ -375,6 +378,12 @@ class AppWindow : public content::WebContentsDelegate,
bool show_in_shelf() const { return show_in_shelf_; }
+ const gfx::Image& window_icon() const { return window_icon_; }
+
+ const GURL& window_icon_url() const { return window_icon_url_; }
+
+ void UpdateWindowIcon(const gfx::Image& image);
+
void SetAppWindowContentsForTesting(
std::unique_ptr<AppWindowContents> contents) {
app_window_contents_ = std::move(contents);
@@ -580,6 +589,13 @@ class AppWindow : public content::WebContentsDelegate,
// Whether |show_in_shelf| was set in the CreateParams.
bool show_in_shelf_;
+ // Icon of the window shown in task bar.
+ gfx::Image window_icon_;
Reilly Grant (use Gerrit) 2016/08/04 18:02:42 Why is this a separate field from app_icon_ if we
stevenjb 2016/08/04 21:00:47 I tend to agree. If we use a single icon image and
Andra Paraschiv 2016/08/08 13:34:12 Thank you, Reilly and Steven, for feedback. I upda
+
+ // Icon URL to be used for setting the window icon. If not empty,
+ // window_icon_ will be fetched and set using this URL.
+ GURL window_icon_url_;
+
// PlzNavigate: this is called when the first navigation is ready to commit.
base::Closure on_first_commit_callback_;

Powered by Google App Engine
This is Rietveld 408576698