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 | |
9 #include <algorithm> | 8 #include <algorithm> |
10 #include <cmath> | 9 #include <cmath> |
| 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/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/win/windows_version.h" | 16 #include "base/win/windows_version.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "chrome/browser/extensions/tab_helper.h" | 18 #include "chrome/browser/extensions/tab_helper.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 389 |
390 #if defined(OS_WIN) | 390 #if defined(OS_WIN) |
391 creation_locations.in_quick_launch_bar = quick_launch_check_box_ == nullptr ? | 391 creation_locations.in_quick_launch_bar = quick_launch_check_box_ == nullptr ? |
392 false : quick_launch_check_box_->checked(); | 392 false : quick_launch_check_box_->checked(); |
393 #elif defined(OS_POSIX) | 393 #elif defined(OS_POSIX) |
394 // Create shortcut in Mac dock or as Linux (gnome/kde) application launcher | 394 // Create shortcut in Mac dock or as Linux (gnome/kde) application launcher |
395 // are not implemented yet. | 395 // are not implemented yet. |
396 creation_locations.in_quick_launch_bar = false; | 396 creation_locations.in_quick_launch_bar = false; |
397 #endif | 397 #endif |
398 | 398 |
399 web_app::CreateShortcutsWithInfo(web_app::SHORTCUT_CREATION_BY_USER, | 399 web_app::CreateShortcutsWithInfo( |
400 creation_locations, shortcut_info_.Pass(), | 400 web_app::SHORTCUT_CREATION_BY_USER, creation_locations, |
401 file_handlers_info_); | 401 std::move(shortcut_info_), file_handlers_info_); |
402 return true; | 402 return true; |
403 } | 403 } |
404 | 404 |
405 views::Checkbox* CreateApplicationShortcutView::AddCheckbox( | 405 views::Checkbox* CreateApplicationShortcutView::AddCheckbox( |
406 const base::string16& text, bool checked) { | 406 const base::string16& text, bool checked) { |
407 views::Checkbox* checkbox = new views::Checkbox(text); | 407 views::Checkbox* checkbox = new views::Checkbox(text); |
408 checkbox->SetChecked(checked); | 408 checkbox->SetChecked(checked); |
409 checkbox->set_listener(this); | 409 checkbox->set_listener(this); |
410 return checkbox; | 410 return checkbox; |
411 } | 411 } |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 | 551 |
552 bool CreateChromeApplicationShortcutView::Cancel() { | 552 bool CreateChromeApplicationShortcutView::Cancel() { |
553 if (!close_callback_.is_null()) | 553 if (!close_callback_.is_null()) |
554 close_callback_.Run(false); | 554 close_callback_.Run(false); |
555 return CreateApplicationShortcutView::Cancel(); | 555 return CreateApplicationShortcutView::Cancel(); |
556 } | 556 } |
557 | 557 |
558 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( | 558 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( |
559 scoped_ptr<web_app::ShortcutInfo> shortcut_info, | 559 scoped_ptr<web_app::ShortcutInfo> shortcut_info, |
560 const extensions::FileHandlersInfo& file_handlers_info) { | 560 const extensions::FileHandlersInfo& file_handlers_info) { |
561 shortcut_info_ = shortcut_info.Pass(); | 561 shortcut_info_ = std::move(shortcut_info); |
562 file_handlers_info_ = file_handlers_info; | 562 file_handlers_info_ = file_handlers_info; |
563 } | 563 } |
OLD | NEW |