| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/create_application_shortcut_view.h" | 5 #include "chrome/browser/views/create_application_shortcut_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "base/win/windows_version.h" |
| 11 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
| 12 #include "chrome/browser/profile.h" | 13 #include "chrome/browser/profile.h" |
| 13 #include "chrome/browser/tab_contents/tab_contents.h" | 14 #include "chrome/browser/tab_contents/tab_contents.h" |
| 14 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 15 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| 15 #include "chrome/common/chrome_constants.h" | 16 #include "chrome/common/chrome_constants.h" |
| 16 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 17 #include "gfx/canvas_skia.h" | 18 #include "gfx/canvas_skia.h" |
| 18 #include "gfx/codec/png_codec.h" | 19 #include "gfx/codec/png_codec.h" |
| 19 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 20 #include "grit/locale_settings.h" | 21 #include "grit/locale_settings.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 258 |
| 258 menu_check_box_ = NULL; | 259 menu_check_box_ = NULL; |
| 259 quick_launch_check_box_ = NULL; | 260 quick_launch_check_box_ = NULL; |
| 260 | 261 |
| 261 #if defined(OS_WIN) | 262 #if defined(OS_WIN) |
| 262 menu_check_box_ = AddCheckbox( | 263 menu_check_box_ = AddCheckbox( |
| 263 l10n_util::GetString(IDS_CREATE_SHORTCUTS_START_MENU_CHKBOX), | 264 l10n_util::GetString(IDS_CREATE_SHORTCUTS_START_MENU_CHKBOX), |
| 264 profile->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu)); | 265 profile->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu)); |
| 265 | 266 |
| 266 quick_launch_check_box_ = AddCheckbox( | 267 quick_launch_check_box_ = AddCheckbox( |
| 267 (win_util::GetWinVersion() >= win_util::WINVERSION_WIN7) ? | 268 (base::win::GetVersion() >= base::win::VERSION_WIN7) ? |
| 268 l10n_util::GetString(IDS_PIN_TO_TASKBAR_CHKBOX) : | 269 l10n_util::GetString(IDS_PIN_TO_TASKBAR_CHKBOX) : |
| 269 l10n_util::GetString(IDS_CREATE_SHORTCUTS_QUICK_LAUNCH_BAR_CHKBOX), | 270 l10n_util::GetString(IDS_CREATE_SHORTCUTS_QUICK_LAUNCH_BAR_CHKBOX), |
| 270 profile->GetPrefs()->GetBoolean(prefs::kWebAppCreateInQuickLaunchBar)); | 271 profile->GetPrefs()->GetBoolean(prefs::kWebAppCreateInQuickLaunchBar)); |
| 271 #elif defined(OS_LINUX) | 272 #elif defined(OS_LINUX) |
| 272 menu_check_box_ = AddCheckbox( | 273 menu_check_box_ = AddCheckbox( |
| 273 l10n_util::GetString(IDS_CREATE_SHORTCUTS_MENU_CHKBOX), | 274 l10n_util::GetString(IDS_CREATE_SHORTCUTS_MENU_CHKBOX), |
| 274 profile->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu)); | 275 profile->GetPrefs()->GetBoolean(prefs::kWebAppCreateInAppsMenu)); |
| 275 #endif | 276 #endif |
| 276 | 277 |
| 277 // Layout controls | 278 // Layout controls |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 const SkBitmap& image) { | 449 const SkBitmap& image) { |
| 449 pending_download_ = NULL; | 450 pending_download_ = NULL; |
| 450 | 451 |
| 451 if (!errored && !image.isNull()) { | 452 if (!errored && !image.isNull()) { |
| 452 shortcut_info_.favicon = image; | 453 shortcut_info_.favicon = image; |
| 453 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 454 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
| 454 } else { | 455 } else { |
| 455 FetchIcon(); | 456 FetchIcon(); |
| 456 } | 457 } |
| 457 } | 458 } |
| OLD | NEW |