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/extensions/extension_install_prompt.h" | 5 #include "chrome/browser/extensions/extension_install_prompt.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
400 const { | 400 const { |
401 return l10n_util::GetPluralStringFUTF16( | 401 return l10n_util::GetPluralStringFUTF16( |
402 IDS_EXTENSION_PROMPT_RETAINED_DEVICES, GetRetainedDeviceCount()); | 402 IDS_EXTENSION_PROMPT_RETAINED_DEVICES, GetRetainedDeviceCount()); |
403 } | 403 } |
404 | 404 |
405 bool ExtensionInstallPrompt::Prompt::ShouldShowPermissions() const { | 405 bool ExtensionInstallPrompt::Prompt::ShouldShowPermissions() const { |
406 return GetPermissionCount(ALL_PERMISSIONS) > 0 || | 406 return GetPermissionCount(ALL_PERMISSIONS) > 0 || |
407 type_ == POST_INSTALL_PERMISSIONS_PROMPT; | 407 type_ == POST_INSTALL_PERMISSIONS_PROMPT; |
408 } | 408 } |
409 | 409 |
410 bool ExtensionInstallPrompt::Prompt::ShouldUseTabModalDialog() const { | |
Devlin
2015/12/04 21:53:06
Maybe a comment explaining the reasoning?
asargent_no_longer_on_chrome
2015/12/07 19:25:53
Done.
| |
411 return type_ == INLINE_INSTALL_PROMPT; | |
412 } | |
413 | |
410 void ExtensionInstallPrompt::Prompt::AppendRatingStars( | 414 void ExtensionInstallPrompt::Prompt::AppendRatingStars( |
411 StarAppender appender, void* data) const { | 415 StarAppender appender, void* data) const { |
412 CHECK(appender); | 416 CHECK(appender); |
413 CHECK(AllowWebstoreData(type_)); | 417 CHECK(AllowWebstoreData(type_)); |
414 int rating_integer = floor(average_rating_); | 418 int rating_integer = floor(average_rating_); |
415 double rating_fractional = average_rating_ - rating_integer; | 419 double rating_fractional = average_rating_ - rating_integer; |
416 | 420 |
417 if (rating_fractional > 0.66) { | 421 if (rating_fractional > 0.66) { |
418 rating_integer++; | 422 rating_integer++; |
419 } | 423 } |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
928 if (show_params_->WasParentDestroyed()) { | 932 if (show_params_->WasParentDestroyed()) { |
929 delegate_->InstallUIAbort(false); | 933 delegate_->InstallUIAbort(false); |
930 return; | 934 return; |
931 } | 935 } |
932 | 936 |
933 if (show_dialog_callback_.is_null()) | 937 if (show_dialog_callback_.is_null()) |
934 GetDefaultShowDialogCallback().Run(show_params_.get(), delegate_, prompt_); | 938 GetDefaultShowDialogCallback().Run(show_params_.get(), delegate_, prompt_); |
935 else | 939 else |
936 show_dialog_callback_.Run(show_params_.get(), delegate_, prompt_); | 940 show_dialog_callback_.Run(show_params_.get(), delegate_, prompt_); |
937 } | 941 } |
OLD | NEW |