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

Side by Side Diff: chrome/browser/ui/views/create_application_shortcut_view.cc

Issue 2851303005: [Win10] Allow users to create start menu App shortcuts from chrome://apps. (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 create_shortcuts_label_->SetMultiLine(true); 69 create_shortcuts_label_->SetMultiLine(true);
70 70
71 desktop_check_box_ = AddCheckbox( 71 desktop_check_box_ = AddCheckbox(
72 l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_DESKTOP_CHKBOX), 72 l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_DESKTOP_CHKBOX),
73 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateOnDesktop)); 73 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateOnDesktop));
74 74
75 menu_check_box_ = nullptr; 75 menu_check_box_ = nullptr;
76 quick_launch_check_box_ = nullptr; 76 quick_launch_check_box_ = nullptr;
77 77
78 #if defined(OS_WIN) 78 #if defined(OS_WIN)
79 base::win::Version version = base::win::GetVersion();
79 // Do not allow creating shortcuts on the Start Screen for Windows 8. 80 // Do not allow creating shortcuts on the Start Screen for Windows 8.
80 if (base::win::GetVersion() < base::win::VERSION_WIN8) { 81 if (version != base::win::VERSION_WIN8 &&
82 version != base::win::VERSION_WIN8_1) {
81 menu_check_box_ = AddCheckbox( 83 menu_check_box_ = AddCheckbox(
82 l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_START_MENU_CHKBOX), 84 l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_START_MENU_CHKBOX),
83 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu)); 85 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu));
84 } 86 }
85 87
86 // Win10 actively prevents creating shortcuts on the taskbar so we eliminate 88 // Win10 actively prevents creating shortcuts on the taskbar so we eliminate
87 // that option from the dialog. 89 // that option from the dialog.
88 if (base::win::CanPinShortcutToTaskbar()) { 90 if (base::win::CanPinShortcutToTaskbar()) {
89 quick_launch_check_box_ = AddCheckbox( 91 quick_launch_check_box_ = AddCheckbox(
90 (base::win::GetVersion() >= base::win::VERSION_WIN7) ? 92 (version >= base::win::VERSION_WIN7)
91 l10n_util::GetStringUTF16(IDS_PIN_TO_TASKBAR_CHKBOX) : 93 ? l10n_util::GetStringUTF16(IDS_PIN_TO_TASKBAR_CHKBOX)
92 l10n_util::GetStringUTF16( 94 : l10n_util::GetStringUTF16(
93 IDS_CREATE_SHORTCUTS_QUICK_LAUNCH_BAR_CHKBOX), 95 IDS_CREATE_SHORTCUTS_QUICK_LAUNCH_BAR_CHKBOX),
94 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInQuickLaunchBar)); 96 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInQuickLaunchBar));
95 } 97 }
96 #elif defined(OS_POSIX) 98 #elif defined(OS_POSIX)
97 menu_check_box_ = AddCheckbox( 99 menu_check_box_ = AddCheckbox(
98 l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_MENU_CHKBOX), 100 l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_MENU_CHKBOX),
99 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu)); 101 profile_->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu));
100 #endif 102 #endif
101 103
102 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); 104 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
103 105
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 views::Checkbox* checkbox = new views::Checkbox(text); 239 views::Checkbox* checkbox = new views::Checkbox(text);
238 checkbox->SetChecked(checked); 240 checkbox->SetChecked(checked);
239 checkbox->set_listener(this); 241 checkbox->set_listener(this);
240 return checkbox; 242 return checkbox;
241 } 243 }
242 244
243 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( 245 void CreateChromeApplicationShortcutView::OnAppInfoLoaded(
244 std::unique_ptr<web_app::ShortcutInfo> shortcut_info) { 246 std::unique_ptr<web_app::ShortcutInfo> shortcut_info) {
245 shortcut_info_ = std::move(shortcut_info); 247 shortcut_info_ = std::move(shortcut_info);
246 } 248 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698