| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "chrome/browser/extensions/image_loading_tracker.h" | 13 #include "chrome/browser/extensions/image_loading_tracker.h" |
| 14 #include "chrome/browser/web_applications/web_app.h" | 14 #include "chrome/browser/web_applications/web_app.h" |
| 15 #include "ui/views/controls/button/button.h" | 15 #include "ui/views/controls/button/button.h" |
| 16 #include "ui/views/window/dialog_delegate.h" | 16 #include "ui/views/window/dialog_delegate.h" |
| 17 | 17 |
| 18 class Profile; | 18 class Profile; |
| 19 class TabContents; | 19 class TabContents; |
| 20 typedef TabContents TabContentsWrapper; | |
| 21 class SkBitmap; | 20 class SkBitmap; |
| 22 | 21 |
| 23 namespace extensions { | 22 namespace extensions { |
| 24 class Extension; | 23 class Extension; |
| 25 } | 24 } |
| 26 | 25 |
| 27 namespace views { | 26 namespace views { |
| 28 class Checkbox; | 27 class Checkbox; |
| 29 class Label; | 28 class Label; |
| 30 } | 29 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 75 |
| 77 // Target shortcut info. | 76 // Target shortcut info. |
| 78 ShellIntegration::ShortcutInfo shortcut_info_; | 77 ShellIntegration::ShortcutInfo shortcut_info_; |
| 79 | 78 |
| 80 DISALLOW_COPY_AND_ASSIGN(CreateApplicationShortcutView); | 79 DISALLOW_COPY_AND_ASSIGN(CreateApplicationShortcutView); |
| 81 }; | 80 }; |
| 82 | 81 |
| 83 // Create an application shortcut pointing to a URL. | 82 // Create an application shortcut pointing to a URL. |
| 84 class CreateUrlApplicationShortcutView : public CreateApplicationShortcutView { | 83 class CreateUrlApplicationShortcutView : public CreateApplicationShortcutView { |
| 85 public: | 84 public: |
| 86 explicit CreateUrlApplicationShortcutView(TabContentsWrapper* tab_contents); | 85 explicit CreateUrlApplicationShortcutView(TabContents* tab_contents); |
| 87 virtual ~CreateUrlApplicationShortcutView(); | 86 virtual ~CreateUrlApplicationShortcutView(); |
| 88 | 87 |
| 89 virtual bool Accept() OVERRIDE; | 88 virtual bool Accept() OVERRIDE; |
| 90 | 89 |
| 91 private: | 90 private: |
| 92 // Fetch the largest unprocessed icon. | 91 // Fetch the largest unprocessed icon. |
| 93 // The first largest icon downloaded and decoded successfully will be used. | 92 // The first largest icon downloaded and decoded successfully will be used. |
| 94 void FetchIcon(); | 93 void FetchIcon(); |
| 95 | 94 |
| 96 // Callback of icon download. | 95 // Callback of icon download. |
| 97 void OnIconDownloaded(bool errored, const SkBitmap& image); | 96 void OnIconDownloaded(bool errored, const SkBitmap& image); |
| 98 | 97 |
| 99 // The tab whose URL is being turned into an app. | 98 // The tab whose URL is being turned into an app. |
| 100 TabContentsWrapper* tab_contents_; | 99 TabContents* tab_contents_; |
| 101 | 100 |
| 102 // Pending app icon download tracked by us. | 101 // Pending app icon download tracked by us. |
| 103 class IconDownloadCallbackFunctor; | 102 class IconDownloadCallbackFunctor; |
| 104 IconDownloadCallbackFunctor* pending_download_; | 103 IconDownloadCallbackFunctor* pending_download_; |
| 105 | 104 |
| 106 // Unprocessed icons from the WebApplicationInfo passed in. | 105 // Unprocessed icons from the WebApplicationInfo passed in. |
| 107 web_app::IconInfoList unprocessed_icons_; | 106 web_app::IconInfoList unprocessed_icons_; |
| 108 | 107 |
| 109 DISALLOW_COPY_AND_ASSIGN(CreateUrlApplicationShortcutView); | 108 DISALLOW_COPY_AND_ASSIGN(CreateUrlApplicationShortcutView); |
| 110 }; | 109 }; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 126 int index) OVERRIDE; | 125 int index) OVERRIDE; |
| 127 | 126 |
| 128 private: | 127 private: |
| 129 const extensions::Extension* app_; | 128 const extensions::Extension* app_; |
| 130 ImageLoadingTracker tracker_; | 129 ImageLoadingTracker tracker_; |
| 131 | 130 |
| 132 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutView); | 131 DISALLOW_COPY_AND_ASSIGN(CreateChromeApplicationShortcutView); |
| 133 }; | 132 }; |
| 134 | 133 |
| 135 #endif // CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ | 134 #endif // CHROME_BROWSER_UI_VIEWS_CREATE_APPLICATION_SHORTCUT_VIEW_H_ |
| OLD | NEW |