| 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 #include "chrome/browser/ui/views/create_application_shortcut_view.h" | 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/win/windows_version.h" | |
| 16 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 17 #include "chrome/browser/extensions/tab_helper.h" | 16 #include "chrome/browser/extensions/tab_helper.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/browser_commands.h" | 19 #include "chrome/browser/ui/browser_commands.h" |
| 21 #include "chrome/browser/ui/browser_finder.h" | 20 #include "chrome/browser/ui/browser_finder.h" |
| 22 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 21 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 23 #include "chrome/browser/web_applications/web_app.h" | 22 #include "chrome/browser/web_applications/web_app.h" |
| 24 #include "chrome/common/chrome_constants.h" | 23 #include "chrome/common/chrome_constants.h" |
| 25 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 49 #include "ui/views/controls/image_view.h" | 48 #include "ui/views/controls/image_view.h" |
| 50 #include "ui/views/controls/label.h" | 49 #include "ui/views/controls/label.h" |
| 51 #include "ui/views/layout/grid_layout.h" | 50 #include "ui/views/layout/grid_layout.h" |
| 52 #include "ui/views/layout/layout_constants.h" | 51 #include "ui/views/layout/layout_constants.h" |
| 53 #include "ui/views/widget/widget.h" | 52 #include "ui/views/widget/widget.h" |
| 54 #include "ui/views/window/dialog_client_view.h" | 53 #include "ui/views/window/dialog_client_view.h" |
| 55 #include "url/gurl.h" | 54 #include "url/gurl.h" |
| 56 | 55 |
| 57 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
| 58 #include "base/win/shortcut.h" | 57 #include "base/win/shortcut.h" |
| 58 #include "base/win/windows_version.h" |
| 59 #endif // defined(OS_WIN) | 59 #endif // defined(OS_WIN) |
| 60 | 60 |
| 61 namespace { | 61 namespace { |
| 62 | 62 |
| 63 const int kIconPreviewSizePixels = 32; | 63 const int kIconPreviewSizePixels = 32; |
| 64 | 64 |
| 65 // AppInfoView shows the application icon and title. | 65 // AppInfoView shows the application icon and title. |
| 66 class AppInfoView : public views::View { | 66 class AppInfoView : public views::View { |
| 67 public: | 67 public: |
| 68 AppInfoView(const base::string16& title, | 68 AppInfoView(const base::string16& title, |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 close_callback_.Run(false); | 543 close_callback_.Run(false); |
| 544 return CreateApplicationShortcutView::Cancel(); | 544 return CreateApplicationShortcutView::Cancel(); |
| 545 } | 545 } |
| 546 | 546 |
| 547 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( | 547 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( |
| 548 std::unique_ptr<web_app::ShortcutInfo> shortcut_info, | 548 std::unique_ptr<web_app::ShortcutInfo> shortcut_info, |
| 549 const extensions::FileHandlersInfo& file_handlers_info) { | 549 const extensions::FileHandlersInfo& file_handlers_info) { |
| 550 shortcut_info_ = std::move(shortcut_info); | 550 shortcut_info_ = std::move(shortcut_info); |
| 551 file_handlers_info_ = file_handlers_info; | 551 file_handlers_info_ = file_handlers_info; |
| 552 } | 552 } |
| OLD | NEW |