OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_UPDATE_SHORTCUT_WORKER_WIN_H_ | 5 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_UPDATE_SHORTCUT_WORKER_WIN_H_ |
6 #define CHROME_BROWSER_WEB_APPLICATIONS_UPDATE_SHORTCUT_WORKER_WIN_H_ | 6 #define CHROME_BROWSER_WEB_APPLICATIONS_UPDATE_SHORTCUT_WORKER_WIN_H_ |
7 | 7 |
8 #include "chrome/browser/shell_integration.h" | 8 #include "chrome/browser/shell_integration.h" |
9 #include "chrome/browser/web_applications/web_app.h" | 9 #include "chrome/browser/web_applications/web_app.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // update them when icons are downloaded. It observes TAB_CLOSING notification | 24 // update them when icons are downloaded. It observes TAB_CLOSING notification |
25 // and cancels all the work when the underlying tab is closing. | 25 // and cancels all the work when the underlying tab is closing. |
26 class UpdateShortcutWorker : public content::NotificationObserver { | 26 class UpdateShortcutWorker : public content::NotificationObserver { |
27 public: | 27 public: |
28 explicit UpdateShortcutWorker(content::WebContents* web_contents); | 28 explicit UpdateShortcutWorker(content::WebContents* web_contents); |
29 | 29 |
30 void Run(); | 30 void Run(); |
31 | 31 |
32 private: | 32 private: |
33 // Overridden from content::NotificationObserver: | 33 // Overridden from content::NotificationObserver: |
34 virtual void Observe(int type, | 34 void Observe(int type, |
35 const content::NotificationSource& source, | 35 const content::NotificationSource& source, |
36 const content::NotificationDetails& details); | 36 const content::NotificationDetails& details) override; |
37 | 37 |
38 // Downloads icon via the FaviconDriver. | 38 // Downloads icon via the FaviconDriver. |
39 void DownloadIcon(); | 39 void DownloadIcon(); |
40 | 40 |
41 // Favicon download callback. | 41 // Favicon download callback. |
42 void DidDownloadFavicon( | 42 void DidDownloadFavicon( |
43 int requested_size, | 43 int requested_size, |
44 int id, | 44 int id, |
45 int http_status_code, | 45 int http_status_code, |
46 const GURL& image_url, | 46 const GURL& image_url, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // Existing shortcuts. | 81 // Existing shortcuts. |
82 std::vector<base::FilePath> shortcut_files_; | 82 std::vector<base::FilePath> shortcut_files_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(UpdateShortcutWorker); | 84 DISALLOW_COPY_AND_ASSIGN(UpdateShortcutWorker); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace web_app | 87 } // namespace web_app |
88 | 88 |
89 #endif // CHROME_BROWSER_WEB_APPLICATIONS_UPDATE_SHORTCUT_WORKER_WIN_H_ | 89 #endif // CHROME_BROWSER_WEB_APPLICATIONS_UPDATE_SHORTCUT_WORKER_WIN_H_ |
OLD | NEW |