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

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

Issue 231673005: Move ShortcutInfo, ShortcutLocations from ShellIntegration to web_app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 8 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 | Annotate | Revision Log
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 } 364 }
365 365
366 base::string16 CreateApplicationShortcutView::GetWindowTitle() const { 366 base::string16 CreateApplicationShortcutView::GetWindowTitle() const {
367 return l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_TITLE); 367 return l10n_util::GetStringUTF16(IDS_CREATE_SHORTCUTS_TITLE);
368 } 368 }
369 369
370 bool CreateApplicationShortcutView::Accept() { 370 bool CreateApplicationShortcutView::Accept() {
371 if (!IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)) 371 if (!IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK))
372 return false; 372 return false;
373 373
374 ShellIntegration::ShortcutLocations creation_locations; 374 web_app::ShortcutLocations creation_locations;
375 creation_locations.on_desktop = desktop_check_box_->checked(); 375 creation_locations.on_desktop = desktop_check_box_->checked();
376 if (menu_check_box_ != NULL && menu_check_box_->checked()) { 376 if (menu_check_box_ != NULL && menu_check_box_->checked()) {
377 creation_locations.applications_menu_location = 377 creation_locations.applications_menu_location =
378 create_in_chrome_apps_subdir_ ? 378 create_in_chrome_apps_subdir_ ?
379 ShellIntegration::APP_MENU_LOCATION_SUBDIR_CHROMEAPPS : 379 web_app::APP_MENU_LOCATION_SUBDIR_CHROMEAPPS :
380 ShellIntegration::APP_MENU_LOCATION_ROOT; 380 web_app::APP_MENU_LOCATION_ROOT;
381 } 381 }
382 382
383 #if defined(OS_WIN) 383 #if defined(OS_WIN)
384 creation_locations.in_quick_launch_bar = quick_launch_check_box_ == NULL ? 384 creation_locations.in_quick_launch_bar = quick_launch_check_box_ == NULL ?
385 NULL : quick_launch_check_box_->checked(); 385 NULL : quick_launch_check_box_->checked();
386 #elif defined(OS_POSIX) 386 #elif defined(OS_POSIX)
387 // Create shortcut in Mac dock or as Linux (gnome/kde) application launcher 387 // Create shortcut in Mac dock or as Linux (gnome/kde) application launcher
388 // are not implemented yet. 388 // are not implemented yet.
389 creation_locations.in_quick_launch_bar = false; 389 creation_locations.in_quick_launch_bar = false;
390 #endif 390 #endif
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 } 549 }
550 550
551 bool CreateChromeApplicationShortcutView::Cancel() { 551 bool CreateChromeApplicationShortcutView::Cancel() {
552 if (!close_callback_.is_null()) 552 if (!close_callback_.is_null())
553 close_callback_.Run(); 553 close_callback_.Run();
554 return CreateApplicationShortcutView::Cancel(); 554 return CreateApplicationShortcutView::Cancel();
555 } 555 }
556 556
557 // Called when the app's ShortcutInfo (with icon) is loaded. 557 // Called when the app's ShortcutInfo (with icon) is loaded.
558 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded( 558 void CreateChromeApplicationShortcutView::OnShortcutInfoLoaded(
559 const ShellIntegration::ShortcutInfo& shortcut_info) { 559 const web_app::ShortcutInfo& shortcut_info) {
560 shortcut_info_ = shortcut_info; 560 shortcut_info_ = shortcut_info;
561 561
562 CHECK(app_info_); 562 CHECK(app_info_);
563 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); 563 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon);
564 } 564 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698