diff --git a/DEPS b/DEPS index 16d61ad..90acccb7d 100644 --- a/DEPS +++ b/DEPS
@@ -44,7 +44,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '6f1f6d7cea47d2fa95f83685cf4110312826dc3a', + 'v8_revision': 'ea49cd0a053b89c31013b98a4763b9c9c75fe07a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -64,7 +64,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '222e1a425e2d2199a842883dcc330a549f400630', + 'pdfium_revision': 'cddc8eddbd33e8e96540341eb9781403ae423b93', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling openmax_dl # and whatever else without interference from each other. @@ -235,7 +235,7 @@ Var('chromium_git') + '/native_client/src/third_party/scons-2.0.1.git' + '@' + '1c1550e17fc26355d08627fbdec13d8291227067', 'src/third_party/webrtc': - Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + 'e6fddec2d5f2b9883f3d678c9e5623a8e1c6e28b', # commit position 18665 + Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + '0f3c15ea783b5367c8f63ef8d71f51e93d280028', # commit position 18695 'src/third_party/openmax_dl': Var('chromium_git') + '/external/webrtc/deps/third_party/openmax.git' + '@' + Var('openmax_dl_revision'), @@ -437,7 +437,7 @@ # Wayland protocols that add functionality not available in the core protocol. 'src/third_party/wayland-protocols/src': - Var('chromium_git') + '/external/anongit.freedesktop.org/git/wayland/wayland-protocols.git' + '@' + '2e541a36deff5f2e16e25e27f7f93d26822eecc2', + Var('chromium_git') + '/external/anongit.freedesktop.org/git/wayland/wayland-protocols.git' + '@' + '26c99346ab5f2273fe5581bc4f6397bbb834f747', # The libevdev library (Chrome OS version). 'src/third_party/libevdev/src':
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc index 74a3be39..76fa0d4 100644 --- a/base/test/launcher/test_launcher.cc +++ b/base/test/launcher/test_launcher.cc
@@ -996,7 +996,7 @@ std::string test_name = FormatFullTestName(tests_[i].test_case_name, tests_[i].test_name); - results_tracker_.AddTest(test_name, tests_[i].file, tests_[i].line); + results_tracker_.AddTest(test_name); const CommandLine* command_line = CommandLine::ForCurrentProcess(); if (test_name.find("DISABLED") != std::string::npos) { @@ -1049,6 +1049,10 @@ if (Hash(test_name) % total_shards_ != static_cast<uint32_t>(shard_index_)) continue; + // Report test locations after applying all filters, so that we report test + // locations only for those tests that were run as part of this shard. + results_tracker_.AddTestLocation(test_name, tests_[i].file, tests_[i].line); + test_names.push_back(test_name); }
diff --git a/base/test/launcher/test_results_tracker.cc b/base/test/launcher/test_results_tracker.cc index 9d8d57d..46a141c 100644 --- a/base/test/launcher/test_results_tracker.cc +++ b/base/test/launcher/test_results_tracker.cc
@@ -212,13 +212,10 @@ per_iteration_data_.push_back(PerIterationData()); } -void TestResultsTracker::AddTest( - const std::string& test_name, const std::string& file, int line) { +void TestResultsTracker::AddTest(const std::string& test_name) { // Record disabled test names without DISABLED_ prefix so that they are easy // to compare with regular test names, e.g. before or after disabling. all_tests_.insert(TestNameWithoutDisabledPrefix(test_name)); - - test_locations_.insert(std::make_pair(test_name, CodeLocation(file, line))); } void TestResultsTracker::AddDisabledTest(const std::string& test_name) { @@ -227,6 +224,13 @@ disabled_tests_.insert(TestNameWithoutDisabledPrefix(test_name)); } +void TestResultsTracker::AddTestLocation(const std::string& test_name, + const std::string& file, + int line) { + test_locations_.insert(std::make_pair( + TestNameWithoutDisabledPrefix(test_name), CodeLocation(file, line))); +} + void TestResultsTracker::AddTestResult(const TestResult& result) { DCHECK(thread_checker_.CalledOnValidThread());
diff --git a/base/test/launcher/test_results_tracker.h b/base/test/launcher/test_results_tracker.h index 64e5319..d89821d 100644 --- a/base/test/launcher/test_results_tracker.h +++ b/base/test/launcher/test_results_tracker.h
@@ -43,11 +43,16 @@ // Adds |test_name| to the set of discovered tests (this includes all tests // present in the executable, not necessarily run). - void AddTest(const std::string& test_name, const std::string& file, int line); + void AddTest(const std::string& test_name); // Adds |test_name| to the set of disabled tests. void AddDisabledTest(const std::string& test_name); + // Adds location for the |test_name|. + void AddTestLocation(const std::string& test_name, + const std::string& file, + int line); + // Adds |result| to the stored test results. void AddTestResult(const TestResult& result);
diff --git a/base/trace_event/memory_dump_scheduler_unittest.cc b/base/trace_event/memory_dump_scheduler_unittest.cc index 8677978..b4e534a 100644 --- a/base/trace_event/memory_dump_scheduler_unittest.cc +++ b/base/trace_event/memory_dump_scheduler_unittest.cc
@@ -13,6 +13,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +using ::testing::AtMost; using ::testing::Invoke; using ::testing::_; @@ -131,30 +132,44 @@ TEST_F(MemoryDumpSchedulerTest, StartStopQuickly) { const uint32_t kPeriodMs = 1; - const uint32_t kTicks = 10; + const uint32_t kQuickIterations = 5; + const uint32_t kDetailedTicks = 10; WaitableEvent evt(WaitableEvent::ResetPolicy::MANUAL, WaitableEvent::InitialState::NOT_SIGNALED); - MemoryDumpScheduler::Config config; - config.triggers.push_back({MemoryDumpLevelOfDetail::DETAILED, kPeriodMs}); - config.callback = Bind(&CallbackWrapper::OnTick, Unretained(&on_tick_)); + + MemoryDumpScheduler::Config light_config; + light_config.triggers.push_back({MemoryDumpLevelOfDetail::LIGHT, kPeriodMs}); + light_config.callback = Bind(&CallbackWrapper::OnTick, Unretained(&on_tick_)); + + MemoryDumpScheduler::Config detailed_config; + detailed_config.triggers.push_back( + {MemoryDumpLevelOfDetail::DETAILED, kPeriodMs}); + detailed_config.callback = + Bind(&CallbackWrapper::OnTick, Unretained(&on_tick_)); testing::InSequence sequence; - EXPECT_CALL(on_tick_, OnTick(_)).Times(kTicks - 1); - EXPECT_CALL(on_tick_, OnTick(_)) + EXPECT_CALL(on_tick_, OnTick(MemoryDumpLevelOfDetail::LIGHT)) + .Times(AtMost(kQuickIterations)); + EXPECT_CALL(on_tick_, OnTick(MemoryDumpLevelOfDetail::DETAILED)) + .Times(kDetailedTicks - 1); + EXPECT_CALL(on_tick_, OnTick(MemoryDumpLevelOfDetail::DETAILED)) .WillRepeatedly( Invoke([&evt](MemoryDumpLevelOfDetail) { evt.Signal(); })); const TimeTicks tstart = TimeTicks::Now(); - for (int i = 0; i < 5; i++) { + for (unsigned int i = 0; i < kQuickIterations; i++) { + scheduler_->Start(light_config, bg_thread_->task_runner()); scheduler_->Stop(); - scheduler_->Start(config, bg_thread_->task_runner()); } + + scheduler_->Start(detailed_config, bg_thread_->task_runner()); + evt.Wait(); const double time_ms = (TimeTicks::Now() - tstart).InMillisecondsF(); scheduler_->Stop(); // It takes N-1 ms to perform N ticks of 1ms each. - EXPECT_GE(time_ms, kPeriodMs * (kTicks - 1)); + EXPECT_GE(time_ms, kPeriodMs * (kDetailedTicks - 1)); } TEST_F(MemoryDumpSchedulerTest, StopAndStartOnAnotherThread) {
diff --git a/cc/paint/paint_image.cc b/cc/paint/paint_image.cc index a13b972..d751b47 100644 --- a/cc/paint/paint_image.cc +++ b/cc/paint/paint_image.cc
@@ -15,12 +15,14 @@ sk_sp<SkImage> sk_image, AnimationType animation_type, CompletionState completion_state, - size_t frame_count) + size_t frame_count, + bool is_multipart) : id_(id), sk_image_(std::move(sk_image)), animation_type_(animation_type), completion_state_(completion_state), - frame_count_(frame_count) {} + frame_count_(frame_count), + is_multipart_(is_multipart) {} PaintImage::PaintImage(const PaintImage& other) = default; PaintImage::PaintImage(PaintImage&& other) = default; PaintImage::~PaintImage() = default; @@ -32,7 +34,8 @@ return id_ == other.id_ && sk_image_ == other.sk_image_ && animation_type_ == other.animation_type_ && completion_state_ == other.completion_state_ && - frame_count_ == other.frame_count_; + frame_count_ == other.frame_count_ && + is_multipart_ == other.is_multipart_; } PaintImage::Id PaintImage::GetNextId() {
diff --git a/cc/paint/paint_image.h b/cc/paint/paint_image.h index f6a3587..c8b5d60 100644 --- a/cc/paint/paint_image.h +++ b/cc/paint/paint_image.h
@@ -45,7 +45,8 @@ sk_sp<SkImage> sk_image, AnimationType animation_type = AnimationType::STATIC, CompletionState completion_state = CompletionState::DONE, - size_t frame_count = 0); + size_t frame_count = 0, + bool is_multipart = false); PaintImage(const PaintImage& other); PaintImage(PaintImage&& other); ~PaintImage(); @@ -61,6 +62,7 @@ AnimationType animation_type() const { return animation_type_; } CompletionState completion_state() const { return completion_state_; } size_t frame_count() const { return frame_count_; } + bool is_multipart() const { return is_multipart_; } private: Id id_ = kUnknownStableId; @@ -71,6 +73,9 @@ // loaded). 0 indicates either unknown or only a single frame, both of which // should be treated similarly. size_t frame_count_ = 0; + + // Whether the data fetched for this image is a part of a multpart response. + bool is_multipart_ = false; }; } // namespace cc
diff --git a/cc/tiles/checker_image_tracker.cc b/cc/tiles/checker_image_tracker.cc index e076983..1e562cd8 100644 --- a/cc/tiles/checker_image_tracker.cc +++ b/cc/tiles/checker_image_tracker.cc
@@ -26,12 +26,14 @@ bool complete, bool static_image, bool fits_size_constraints, + bool is_multipart, size_t size) { std::ostringstream str; str << "paint_image_id[" << paint_image_id << "] sk_image_id[" << sk_image_id << "] complete[" << complete << "] static[" << static_image << "], fits_size_constraints[" << fits_size_constraints << "], size[" - << size << "]"; + << size << "]" + << " is_multipart[" << is_multipart << "]"; return str.str(); } @@ -180,17 +182,30 @@ size >= kMinImageSizeToCheckerBytes && size <= image_controller_->image_cache_max_limit_bytes(); - // Only checker images that are static and completely loaded and fit within - // the size constraints. - bool can_checker_image = complete && static_image && fits_size_constraints; + // The following conditions must be true for an image to be checkerable: + // + // 1) Complete: The data for the image should have been completely loaded. + // + // 2) Static: Animated images/video frames can not be checkered. + // + // 3) Size constraints: Small images for which the decode is expected to + // be fast and large images which would breach the image cache budget and + // go through the at-raster decode path are not checkered. + // + // 4) Multipart images: Multipart images can be used to display mjpg video + // frames, checkering which would cause each video frame to flash and + // therefore should not be checkered. + bool can_checker_image = complete && static_image && + fits_size_constraints && !image.is_multipart(); if (can_checker_image) it->second.policy = DecodePolicy::ASYNC; - TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("cc.debug"), - "CheckerImageTracker::CheckerImagingDecision", - "can_checker_image", can_checker_image, "image_params", - ToString(image_id, image.sk_image()->uniqueID(), complete, - static_image, fits_size_constraints, size)); + TRACE_EVENT2( + TRACE_DISABLED_BY_DEFAULT("cc.debug"), + "CheckerImageTracker::CheckerImagingDecision", "can_checker_image", + can_checker_image, "image_params", + ToString(image_id, image.sk_image()->uniqueID(), complete, static_image, + fits_size_constraints, image.is_multipart(), size)); } // Update the decode state from the latest image we have seen. Note that it
diff --git a/cc/tiles/checker_image_tracker_unittest.cc b/cc/tiles/checker_image_tracker_unittest.cc index a0dd022..aee6773b 100644 --- a/cc/tiles/checker_image_tracker_unittest.cc +++ b/cc/tiles/checker_image_tracker_unittest.cc
@@ -93,7 +93,8 @@ ImageType image_type, PaintImage::AnimationType animation = PaintImage::AnimationType::STATIC, PaintImage::CompletionState completion = - PaintImage::CompletionState::DONE) { + PaintImage::CompletionState::DONE, + bool is_multipart = false) { int dimension = 0; switch (image_type) { case ImageType::CHECKERABLE: @@ -109,10 +110,10 @@ sk_sp<SkImage> image = CreateDiscardableImage(gfx::Size(dimension, dimension)); - return DrawImage( - PaintImage(PaintImage::GetNextId(), image, animation, completion), - SkIRect::MakeWH(dimension, dimension), kNone_SkFilterQuality, - SkMatrix::I(), gfx::ColorSpace()); + return DrawImage(PaintImage(PaintImage::GetNextId(), image, animation, + completion, 1, is_multipart), + SkIRect::MakeWH(dimension, dimension), + kNone_SkFilterQuality, SkMatrix::I(), gfx::ColorSpace()); } CheckerImageTracker::ImageDecodeQueue BuildImageDecodeQueue( @@ -471,5 +472,21 @@ kHigh_SkFilterQuality); } +TEST_F(CheckerImageTrackerTest, DontCheckerMultiPartImages) { + SetUpTracker(true); + + DrawImage image = CreateImage(ImageType::CHECKERABLE); + EXPECT_FALSE(image.paint_image().is_multipart()); + DrawImage multi_part_image = + CreateImage(ImageType::CHECKERABLE, PaintImage::AnimationType::STATIC, + PaintImage::CompletionState::DONE, true); + EXPECT_TRUE(multi_part_image.paint_image().is_multipart()); + + EXPECT_TRUE(checker_image_tracker_->ShouldCheckerImage( + image, WhichTree::PENDING_TREE)); + EXPECT_FALSE(checker_image_tracker_->ShouldCheckerImage( + multi_part_image, WhichTree::PENDING_TREE)); +} + } // namespace } // namespace cc
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/PhoneNumberUtil.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/PhoneNumberUtil.java index d69cb1fb..2f5623a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/PhoneNumberUtil.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/PhoneNumberUtil.java
@@ -9,6 +9,8 @@ import org.chromium.base.annotations.JNINamespace; +import javax.annotation.Nullable; + /** * Android wrapper of i18n::phonenumbers::PhoneNumberUtil which provides convenient methods to * format and validate phone number. @@ -18,16 +20,29 @@ // Avoid instantiation by accident. private PhoneNumberUtil() {} - /** TextWatcher to watch phone number changes so as to format it dynamically */ - public static class FormatTextWatcher implements TextWatcher { + /** + * TextWatcher to watch phone number changes so as to format it based on country code. + */ + public static class CountryAwareFormatTextWatcher implements TextWatcher { /** Indicates the change was caused by ourselves. */ private boolean mSelfChange; + @Nullable + private String mCountryCode; + + /** + * Updates the country code used to format phone numbers. + * + * @param countryCode The given country code. + */ + public void setCountryCode(@Nullable String countryCode) { + mCountryCode = countryCode; + } @Override public void afterTextChanged(Editable s) { if (mSelfChange) return; - String formattedNumber = formatForDisplay(s.toString()); + String formattedNumber = formatForDisplay(s.toString(), mCountryCode); mSelfChange = true; s.replace(0, s.length(), formattedNumber, 0, formattedNumber.length()); mSelfChange = false; @@ -42,15 +57,21 @@ /** * Formats the given phone number in INTERNATIONAL format - * [i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat::INTERNATIONAL], returning the - * original number if no formatting can be made. For example, the number of the Google Zürich - * office will be formatted as "+41 44 668 1800" in INTERNATIONAL format. + * [i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat::INTERNATIONAL] based + * on region code, returning the original number if no formatting can be made. + * For example, the number of the Google Zürich office will be formatted as + * "+41 44 668 1800" in INTERNATIONAL format. + * + * Note that the region code is from the given phone number if it starts with + * '+', otherwise the region code is deduced from the given country code or + * from application locale if the given country code is null. * * @param phoneNumber The given phone number. + * @param countryCode The given country code. * @return Formatted phone number. */ - public static String formatForDisplay(String phoneNumber) { - return nativeFormatForDisplay(phoneNumber); + public static String formatForDisplay(String phoneNumber, @Nullable String countryCode) { + return nativeFormatForDisplay(phoneNumber, countryCode); } /** @@ -68,18 +89,22 @@ } /** - * Checks whether the given phone number matches a valid pattern according to region code. The - * region code is from the given phone number if it starts with '+', otherwise application - * locale is used to figure out the region code. + * Checks whether the given phone number matches a valid pattern according to + * region code. + * The region code is from the given phone number if it starts with '+', + * otherwise the region code is deduced from the given country code or from + * application locale if the given country code is null. * * @param phoneNumber The given phone number. + * @param countryCode The given country code. + * * @return True if the given number is valid, otherwise return false. */ - public static boolean isValidNumber(String phoneNumber) { - return nativeIsValidNumber(phoneNumber); + public static boolean isValidNumber(String phoneNumber, @Nullable String countryCode) { + return nativeIsValidNumber(phoneNumber, countryCode); } - private static native String nativeFormatForDisplay(String phoneNumber); + private static native String nativeFormatForDisplay(String phoneNumber, String countryCode); private static native String nativeFormatForResponse(String phoneNumber); - private static native boolean nativeIsValidNumber(String phoneNumber); + private static native boolean nativeIsValidNumber(String phoneNumber, String countryCode); } \ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java index 663a8ec..f37ecd6d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java
@@ -45,8 +45,8 @@ private EditorFieldModel mCountryField; @Nullable private EditorFieldModel mPhoneField; - @Nullable - private EditorFieldValidator mPhoneValidator; + private PhoneNumberUtil.CountryAwareFormatTextWatcher mPhoneFormatter; + private CountryAwarePhoneNumberValidator mPhoneValidator; @Nullable private List<AddressUiComponent> mAddressUiComponents; private boolean mAdminAreasLoaded; @@ -56,13 +56,21 @@ private EditorModel mEditor; private ProgressDialog mProgressDialog; + /** Builds an address editor. */ + public AddressEditor() { + mPhoneFormatter = new PhoneNumberUtil.CountryAwareFormatTextWatcher(); + mPhoneValidator = new CountryAwarePhoneNumberValidator(); + } + /** * Adds the given phone number to the autocomplete set, if it's valid. + * Note that here we consider all non-null and non-empty numbers as valid + * since we are doing strict validation of Autofill data. * * @param phoneNumber The phone number to possibly add. */ public void addPhoneNumberIfValid(@Nullable CharSequence phoneNumber) { - if (getPhoneValidator().isValid(phoneNumber)) mPhoneNumbers.add(phoneNumber); + if (TextUtils.isEmpty(phoneNumber)) mPhoneNumbers.add(phoneNumber.toString()); } /** @@ -124,6 +132,8 @@ mEditor.removeAllFields(); showProgressDialog(); mRecentlySelectedCountry = eventData.first; + mPhoneFormatter.setCountryCode(mRecentlySelectedCountry); + mPhoneValidator.setCountryCode(mRecentlySelectedCountry); mCountryChangeCallback = eventData.second; loadAdminAreasForCountry(mRecentlySelectedCountry); } @@ -160,9 +170,12 @@ // Phone number is present and required for all countries. if (mPhoneField == null) { + assert mCountryField.getValue() != null; + mPhoneValidator.setCountryCode(mCountryField.getValue().toString()); + mPhoneFormatter.setCountryCode(mCountryField.getValue().toString()); mPhoneField = EditorFieldModel.createTextInput(EditorFieldModel.INPUT_TYPE_HINT_PHONE, mContext.getString(R.string.autofill_profile_editor_phone_number), - mPhoneNumbers, getPhoneValidator(), null, + mPhoneNumbers, mPhoneFormatter, mPhoneValidator, null, mContext.getString(R.string.payments_field_required_validation_message), mContext.getString(R.string.payments_phone_invalid_validation_message), null); } @@ -397,20 +410,28 @@ mEditor.addField(mPhoneField); } - private EditorFieldValidator getPhoneValidator() { - if (mPhoneValidator == null) { - mPhoneValidator = new EditorFieldValidator() { - @Override - public boolean isValid(@Nullable CharSequence value) { - return value != null && PhoneNumberUtil.isValidNumber(value.toString()); - } + /** Country based phone number validator. */ + private static class CountryAwarePhoneNumberValidator implements EditorFieldValidator { + @Nullable + private String mCountryCode; - @Override - public boolean isLengthMaximum(@Nullable CharSequence value) { - return false; - } - }; + /** + * Sets the country code used to validate the phone number. + * + * @param countryCode The given country code. + */ + public void setCountryCode(@Nullable String countryCode) { + mCountryCode = countryCode; } - return mPhoneValidator; + + @Override + public boolean isValid(@Nullable CharSequence value) { + return value != null && PhoneNumberUtil.isValidNumber(value.toString(), mCountryCode); + } + + @Override + public boolean isLengthMaximum(@Nullable CharSequence value) { + return false; + } } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/CardEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/CardEditor.java index 281c0fb..d092ca71 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/CardEditor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/CardEditor.java
@@ -485,11 +485,12 @@ if (mNumberField == null) { mNumberField = EditorFieldModel.createTextInput( EditorFieldModel.INPUT_TYPE_HINT_CREDIT_CARD, - mContext.getString(R.string.autofill_credit_card_editor_number), null, - mCardNumberValidator, mCardIconGenerator, + mContext.getString(R.string.autofill_credit_card_editor_number), + null /* suggestions */, null /* formatter */, mCardNumberValidator, + mCardIconGenerator, mContext.getString(R.string.payments_field_required_validation_message), mContext.getString(R.string.payments_card_number_invalid_validation_message), - null); + null /* value */); if (mCanScan) { mNumberField.addActionIcon(R.drawable.ic_photo_camera, R.string.autofill_scan_credit_card, new Runnable() { @@ -507,11 +508,13 @@ // Name on card is required. if (mNameField == null) { - mNameField = EditorFieldModel.createTextInput( - EditorFieldModel.INPUT_TYPE_HINT_PERSON_NAME, - mContext.getString(R.string.autofill_credit_card_editor_name), null, null, null, - mContext.getString(R.string.payments_field_required_validation_message), null, - null); + mNameField = + EditorFieldModel.createTextInput(EditorFieldModel.INPUT_TYPE_HINT_PERSON_NAME, + mContext.getString(R.string.autofill_credit_card_editor_name), + null /* suggestions */, null /* formatter */, null /* validator */, + null /* valueIconGenerator */, + mContext.getString(R.string.payments_field_required_validation_message), + null /* invalidErrorMessage */, null /* value */); } mNameField.setValue(card.getName()); editor.addField(mNameField);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ContactEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ContactEditor.java index a9a11a0..0ec3a51 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ContactEditor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ContactEditor.java
@@ -12,6 +12,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.autofill.PersonalDataManager; import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; +import org.chromium.chrome.browser.autofill.PhoneNumberUtil; import org.chromium.chrome.browser.payments.ui.EditorFieldModel; import org.chromium.chrome.browser.payments.ui.EditorFieldModel.EditorFieldValidator; import org.chromium.chrome.browser.payments.ui.EditorModel; @@ -152,7 +153,8 @@ final EditorFieldModel nameField = mRequestPayerName ? EditorFieldModel.createTextInput(EditorFieldModel.INPUT_TYPE_HINT_PERSON_NAME, mContext.getString(R.string.payments_name_field_in_contact_details), - mPayerNames, null, null, + mPayerNames, null /* suggestions */, null /* formatter */, + null /* validator */, mContext.getString(R.string.payments_field_required_validation_message), null, contact.getPayerName()) : null; @@ -160,7 +162,8 @@ final EditorFieldModel phoneField = mRequestPayerPhone ? EditorFieldModel.createTextInput(EditorFieldModel.INPUT_TYPE_HINT_PHONE, mContext.getString(R.string.autofill_profile_editor_phone_number), - mPhoneNumbers, getPhoneValidator(), null, + mPhoneNumbers, new PhoneNumberUtil.CountryAwareFormatTextWatcher(), + getPhoneValidator(), null, mContext.getString(R.string.payments_field_required_validation_message), mContext.getString(R.string.payments_phone_invalid_validation_message), contact.getPayerPhone()) @@ -169,7 +172,7 @@ final EditorFieldModel emailField = mRequestPayerEmail ? EditorFieldModel.createTextInput(EditorFieldModel.INPUT_TYPE_HINT_EMAIL, mContext.getString(R.string.autofill_profile_editor_email_address), - mEmailAddresses, getEmailValidator(), null, + mEmailAddresses, null, getEmailValidator(), null, mContext.getString(R.string.payments_field_required_validation_message), mContext.getString(R.string.payments_email_invalid_validation_message), contact.getPayerEmail())
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDialog.java index c73f272..1b0f937 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDialog.java
@@ -39,7 +39,6 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.VisibleForTesting; import org.chromium.chrome.R; -import org.chromium.chrome.browser.autofill.PhoneNumberUtil; import org.chromium.chrome.browser.help.HelpAndFeedback; import org.chromium.chrome.browser.payments.ui.PaymentRequestUI.PaymentRequestObserverForTest; import org.chromium.chrome.browser.preferences.autofill.CreditCardNumberFormattingTextWatcher; @@ -155,7 +154,6 @@ }; mCardNumberFormatter = new CreditCardNumberFormattingTextWatcher(); - mPhoneFormatter = new PhoneNumberUtil.FormatTextWatcher(); } /** Prevents screenshots of this editor. */ @@ -446,6 +444,8 @@ filter = mCardNumberInputFilter; formatter = mCardNumberFormatter; } else if (fieldModel.getInputTypeHint() == EditorFieldModel.INPUT_TYPE_HINT_PHONE) { + mPhoneFormatter = fieldModel.getFormatter(); + assert mPhoneFormatter != null; formatter = mPhoneFormatter; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java index 08037a6..deb6e9cc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java
@@ -5,6 +5,7 @@ package org.chromium.chrome.browser.payments.ui; import android.text.TextUtils; +import android.text.TextWatcher; import android.util.Pair; import org.chromium.base.Callback; @@ -118,6 +119,8 @@ @Nullable private List<DropdownKeyValue> mDropdownKeyValues; @Nullable private Set<String> mDropdownKeys; @Nullable private List<CharSequence> mSuggestions; + @Nullable + private TextWatcher mFormatter; @Nullable private EditorFieldValidator mValidator; @Nullable private EditorValueIconGenerator mValueIconGenerator; @Nullable private CharSequence mRequiredErrorMessage; @@ -267,6 +270,7 @@ * @param label The human-readable label for user to understand the type of data * that should be entered into this field. * @param suggestions Optional set of values to suggest to the user. + * @param formatter Optional formatter for the values in this field. * @param validator Optional validator for the values in this field. * @param valueIconGenerator Optional icon generator for the values in this field. * @param requiredErrorMessage The optional error message that indicates to the user that they @@ -276,7 +280,8 @@ * @param value Optional initial value of this field. */ public static EditorFieldModel createTextInput(int inputTypeHint, CharSequence label, - @Nullable Set<CharSequence> suggestions, @Nullable EditorFieldValidator validator, + @Nullable Set<CharSequence> suggestions, @Nullable TextWatcher formatter, + @Nullable EditorFieldValidator validator, @Nullable EditorValueIconGenerator valueIconGenerator, @Nullable CharSequence requiredErrorMessage, @Nullable CharSequence invalidErrorMessage, @Nullable CharSequence value) { @@ -284,6 +289,7 @@ EditorFieldModel result = new EditorFieldModel(inputTypeHint); assert result.isTextField(); result.mSuggestions = suggestions == null ? null : new ArrayList<CharSequence>(suggestions); + result.mFormatter = formatter; result.mValidator = validator; result.mValueIconGenerator = valueIconGenerator; result.mInvalidErrorMessage = invalidErrorMessage; @@ -331,6 +337,13 @@ return mActionIconAction; } + /** @return The value formatter or null if not exist. */ + @Nullable + public TextWatcher getFormatter() { + assert isTextField(); + return mFormatter; + } + /** @return The value icon generator or null if not exist. */ public EditorValueIconGenerator getValueIconGenerator() { assert isTextField();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java index 241ef3d..a13e2f50 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java
@@ -95,9 +95,7 @@ @Override public void onSheetOpened() { - if (!mDefaultContentInitialized && mTabModelSelector.getCurrentTab() != null) { - initializeDefaultContent(); - } + if (!mDefaultContentInitialized) initializeDefaultContent(); } @Override
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java index f1d38c1..f9f9d8c2 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java
@@ -135,7 +135,7 @@ 0 /* Afghanistan */, mPaymentRequestTestRule.getReadyToEdit()); mPaymentRequestTestRule.setTextInEditorAndWait( new String[] { - "Alice", "Supreme Court", "Airport Road", "Kabul", "1043", "650-253-0000"}, + "Alice", "Supreme Court", "Airport Road", "Kabul", "1043", "020-253-0000"}, mPaymentRequestTestRule.getEditorTextUpdate()); mPaymentRequestTestRule.clickInEditorAndWait( R.id.payments_edit_done_button, mPaymentRequestTestRule.getReadyToPay()); @@ -146,7 +146,7 @@ mPaymentRequestTestRule.clickCardUnmaskButtonAndWait( DialogInterface.BUTTON_POSITIVE, mPaymentRequestTestRule.getDismissed()); mPaymentRequestTestRule.expectResultContains(new String[] { - "Alice", "Supreme Court", "Airport Road", "Kabul", "1043", "+16502530000"}); + "Alice", "Supreme Court", "Airport Road", "Kabul", "1043", "+93202530000"}); } /** Quickly pressing on "add address" and then [X] should not crash. */
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLoggerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLoggerTest.java index f85070a..3366756 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLoggerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestJourneyLoggerTest.java
@@ -194,7 +194,7 @@ 0 /* Afghanistan */, mPaymentRequestTestRule.getReadyToEdit()); mPaymentRequestTestRule.setTextInEditorAndWait( new String[] { - "Alice", "Supreme Court", "Airport Road", "Kabul", "1043", "650-253-0000"}, + "Alice", "Supreme Court", "Airport Road", "Kabul", "1043", "020-253-0000"}, mPaymentRequestTestRule.getEditorTextUpdate()); mPaymentRequestTestRule.clickInEditorAndWait( R.id.payments_edit_done_button, mPaymentRequestTestRule.getReadyToPay());
diff --git a/chrome/browser/autofill/android/phone_number_util_android.cc b/chrome/browser/autofill/android/phone_number_util_android.cc index 6aff62a..ae89358 100644 --- a/chrome/browser/autofill/android/phone_number_util_android.cc +++ b/chrome/browser/autofill/android/phone_number_util_android.cc
@@ -21,18 +21,15 @@ using ::i18n::phonenumbers::PhoneNumber; using ::i18n::phonenumbers::PhoneNumberUtil; -// Formats the |phone_number| to the specified |format|. Returns the original -// number if the operation is not possible. -std::string FormatPhoneNumber(const std::string& phone_number, - PhoneNumberUtil::PhoneNumberFormat format) { - const std::string default_region_code = - autofill::AutofillCountry::CountryCodeForLocale( - g_browser_process->GetApplicationLocale()); - +// Formats the |phone_number| to the specified |format| for the given country +// |country_code|. Returns the original number if the operation is not possible. +std::string FormatPhoneNumberWithCountryCode( + const std::string& phone_number, + const std::string& country_code, + PhoneNumberUtil::PhoneNumberFormat format) { PhoneNumber parsed_number; PhoneNumberUtil* phone_number_util = PhoneNumberUtil::GetInstance(); - if (phone_number_util->Parse(phone_number, default_region_code, - &parsed_number) != + if (phone_number_util->Parse(phone_number, country_code, &parsed_number) != PhoneNumberUtil::NO_PARSING_ERROR) { return phone_number; } @@ -42,19 +39,52 @@ return formatted_number; } +// Formats the |phone_number| to the specified |format|. Use application locale +// to determine country code. Returns the original number if the operation is +// not possible. +std::string FormatPhoneNumber(const std::string& phone_number, + PhoneNumberUtil::PhoneNumberFormat format) { + return FormatPhoneNumberWithCountryCode( + phone_number, + autofill::AutofillCountry::CountryCodeForLocale( + g_browser_process->GetApplicationLocale()), + format); +} + +// Checks whether the given number |jphone_number| is valid by using +// i18n::phonenumbers::PhoneNumberUtil::IsValidNumber. +bool IsValidNumberImpl(const std::string& phone_number, + const std::string& country_code) { + PhoneNumber parsed_number; + PhoneNumberUtil* phone_number_util = PhoneNumberUtil::GetInstance(); + if (phone_number_util->Parse(phone_number, country_code, &parsed_number) != + PhoneNumberUtil::NO_PARSING_ERROR) { + return false; + } + + return phone_number_util->IsValidNumber(parsed_number); +} + } // namespace -// Formats the given number |jphone_number| to +// Formats the given number |jphone_number| for the given country +// |jcountry_code| to // i18n::phonenumbers::PhoneNumberUtil::PhoneNumberFormat::INTERNATIONAL format // by using i18n::phonenumbers::PhoneNumberUtil::Format. ScopedJavaLocalRef<jstring> FormatForDisplay( JNIEnv* env, const base::android::JavaParamRef<jclass>& jcaller, - const JavaParamRef<jstring>& jphone_number) { + const JavaParamRef<jstring>& jphone_number, + const JavaParamRef<jstring>& jcountry_code) { return ConvertUTF8ToJavaString( env, - FormatPhoneNumber(ConvertJavaStringToUTF8(env, jphone_number), - PhoneNumberUtil::PhoneNumberFormat::INTERNATIONAL)); + jcountry_code.is_null() + ? FormatPhoneNumber(ConvertJavaStringToUTF8(env, jphone_number), + PhoneNumberUtil::PhoneNumberFormat::INTERNATIONAL) + : FormatPhoneNumberWithCountryCode( + ConvertJavaStringToUTF8(env, jphone_number), + ConvertJavaStringToUTF8(env, jcountry_code), + PhoneNumberUtil::PhoneNumberFormat::INTERNATIONAL)); } // Formats the given number |jphone_number| to @@ -71,25 +101,19 @@ PhoneNumberUtil::PhoneNumberFormat::E164)); } -// Checks whether the given number |jphone_number| is valid by using -// i18n::phonenumbers::PhoneNumberUtil::IsValidNumber. +// Checks whether the given number |jphone_number| is valid for a given country +// |jcountry_code| by using i18n::phonenumbers::PhoneNumberUtil::IsValidNumber. jboolean IsValidNumber(JNIEnv* env, const base::android::JavaParamRef<jclass>& jcaller, - const JavaParamRef<jstring>& jphone_number) { + const JavaParamRef<jstring>& jphone_number, + const JavaParamRef<jstring>& jcountry_code) { const std::string phone_number = ConvertJavaStringToUTF8(env, jphone_number); - const std::string default_region_code = - autofill::AutofillCountry::CountryCodeForLocale( - g_browser_process->GetApplicationLocale()); + const std::string country_code = + jcountry_code.is_null() ? autofill::AutofillCountry::CountryCodeForLocale( + g_browser_process->GetApplicationLocale()) + : ConvertJavaStringToUTF8(env, jcountry_code); - PhoneNumber parsed_number; - PhoneNumberUtil* phone_number_util = PhoneNumberUtil::GetInstance(); - if (phone_number_util->Parse(phone_number, default_region_code, - &parsed_number) != - PhoneNumberUtil::NO_PARSING_ERROR) { - return false; - } - - return phone_number_util->IsValidNumber(parsed_number); + return IsValidNumberImpl(phone_number, country_code); } } // namespace autofill
diff --git a/chrome/browser/chromeos/login/kiosk_browsertest.cc b/chrome/browser/chromeos/login/kiosk_browsertest.cc index 4813f64..f41ec5dc 100644 --- a/chrome/browser/chromeos/login/kiosk_browsertest.cc +++ b/chrome/browser/chromeos/login/kiosk_browsertest.cc
@@ -915,7 +915,9 @@ RunAppLaunchNetworkDownTest(); } -IN_PROC_BROWSER_TEST_F(KioskTest, LaunchAppWithNetworkConfigAccelerator) { +// TODO(crbug.com/735442): This test is flaky. +IN_PROC_BROWSER_TEST_F(KioskTest, + DISABLED_LaunchAppWithNetworkConfigAccelerator) { ScopedCanConfigureNetwork can_configure_network(true, false); // Block app loading until the network screen is shown.
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn index 0dd2a76c..50a96e4 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn
@@ -908,6 +908,7 @@ "//third_party/libaddressinput:util", "//third_party/re2", "//third_party/webrtc/modules/desktop_capture", + "//third_party/zlib/google:zip", "//ui/accessibility:ax_gen", "//ui/base", "//ui/base/ime",
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc index 060ec97..d5e81cd 100644 --- a/chrome/browser/printing/print_job.cc +++ b/chrome/browser/printing/print_job.cc
@@ -21,7 +21,6 @@ #include "build/build_config.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/printing/print_job_worker.h" -#include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "printing/printed_document.h" #include "printing/printed_page.h" @@ -78,10 +77,8 @@ settings_ = job->settings(); PrintedDocument* new_doc = - new PrintedDocument(settings_, - source_, - job->cookie(), - content::BrowserThread::GetBlockingPool()); + new PrintedDocument(settings_, source_, job->cookie()); + new_doc->set_page_count(page_count); UpdatePrintedDocument(new_doc);
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win.cc index 4b2faab..356e6f6 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win.h" #include "base/metrics/field_trial.h" +#include "base/metrics/field_trial_params.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" #include "base/win/windows_version.h" @@ -43,6 +44,9 @@ const base::Feature kInBrowserCleanerUIFeature{ "InBrowserCleanerUI", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kCleanerDownloadFeature{"DownloadCleanupToolByBitness", + base::FEATURE_DISABLED_BY_DEFAULT}; + bool IsInSRTPromptFieldTrialGroups() { return !base::StartsWith(base::FieldTrialList::FindFullName(kSRTPromptTrial), kSRTPromptOffGroup, base::CompareCase::SENSITIVE); @@ -70,8 +74,8 @@ GURL GetSRTDownloadURL() { constexpr char kDownloadGroupParam[] = "download_group"; - const std::string download_group = - variations::GetVariationParamValue(kSRTPromptTrial, kDownloadGroupParam); + const std::string download_group = base::GetFieldTrialParamValueByFeature( + kCleanerDownloadFeature, kDownloadGroupParam); if (download_group.empty()) return GetLegacyDownloadURL();
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win_unittest.cc b/chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win_unittest.cc index f7a5b06..a2b1cb53 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win_unittest.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win_unittest.cc
@@ -7,50 +7,46 @@ #include <map> #include <string> -#include "base/metrics/field_trial.h" #include "base/win/windows_version.h" -#include "components/variations/variations_associated_data.h" +#include "components/variations/variations_params_manager.h" #include "testing/gtest/include/gtest/gtest.h" namespace safe_browsing { class SRTDownloadURLTest : public ::testing::Test { protected: - void SetUp() override { - field_trial_list_ = std::make_unique<base::FieldTrialList>(nullptr); - } - - void CreatePromptTrial(const std::string& experiment_name, - const std::string& download_group) { - std::map<std::string, std::string> params; - if (!download_group.empty()) - params["download_group"] = download_group; - - // Assigned trials will go out of scope when field_trial_list_ goes out - // of scope. + void CreatePromptTrial(const std::string& experiment_name) { + // Assigned trials will go out of scope when variations_ goes out of scope. constexpr char kTrialName[] = "SRTPromptFieldTrial"; - variations::AssociateVariationParams(kTrialName, experiment_name, params); base::FieldTrialList::CreateFieldTrial(kTrialName, experiment_name); } + void CreateDownloadFeature(const std::string& download_group_name) { + constexpr char kFeatureName[] = "DownloadCleanupToolByBitness"; + std::map<std::string, std::string> params; + params["download_group"] = download_group_name; + variations_.SetVariationParamsWithFeatureAssociations( + "A trial name", params, {kFeatureName}); + } + private: - std::unique_ptr<base::FieldTrialList> field_trial_list_; + variations::testing::VariationParamsManager variations_; }; TEST_F(SRTDownloadURLTest, Stable) { - CreatePromptTrial("On", ""); + CreatePromptTrial("On"); EXPECT_EQ("/dl/softwareremovaltool/win/chrome_cleanup_tool.exe", GetSRTDownloadURL().path()); } TEST_F(SRTDownloadURLTest, Canary) { - CreatePromptTrial("SRTCanary", ""); + CreatePromptTrial("SRTCanary"); EXPECT_EQ("/dl/softwareremovaltool/win/c/chrome_cleanup_tool.exe", GetSRTDownloadURL().path()); } TEST_F(SRTDownloadURLTest, Experiment) { - CreatePromptTrial("Experiment", "experiment"); + CreateDownloadFeature("experiment"); std::string expected_path; if (base::win::OSInfo::GetInstance()->architecture() == base::win::OSInfo::X86_ARCHITECTURE) {
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc index 82ae7443..73ee029b 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
@@ -208,14 +208,14 @@ sb_service_factory.SetTestUIManager(ui_manager_.get()); auto* safe_browsing_service = sb_service_factory.CreateSafeBrowsingService(); + TestingBrowserProcess::GetGlobal()->SetSafeBrowsingService( + safe_browsing_service); + g_browser_process->safe_browsing_service()->Initialize(); // A profile was created already but SafeBrowsingService wasn't around to // get notified of it, so include that notification now. safe_browsing_service->AddPrefService( Profile::FromBrowserContext(web_contents()->GetBrowserContext()) ->GetPrefs()); - TestingBrowserProcess::GetGlobal()->SetSafeBrowsingService( - safe_browsing_service); - g_browser_process->safe_browsing_service()->Initialize(); } void TearDown() override {
diff --git a/chrome/browser/safe_browsing/threat_details_unittest.cc b/chrome/browser/safe_browsing/threat_details_unittest.cc index 1be5e57a..144b16d2 100644 --- a/chrome/browser/safe_browsing/threat_details_unittest.cc +++ b/chrome/browser/safe_browsing/threat_details_unittest.cc
@@ -240,13 +240,15 @@ } protected: - void InitResource(UnsafeResource* resource, - SBThreatType threat_type, + void InitResource(SBThreatType threat_type, + ThreatSource threat_source, bool is_subresource, - const GURL& url) { + const GURL& url, + UnsafeResource* resource) { resource->url = url; resource->is_subresource = is_subresource; resource->threat_type = threat_type; + resource->threat_source = threat_source; resource->web_contents_getter = SafeBrowsingUIManager::UnsafeResource::GetWebContentsGetter( web_contents()->GetRenderProcessHost()->GetID(), @@ -300,6 +302,9 @@ VerifyElement(*actual_dom_map[expected_element.id()], expected_element); } + EXPECT_TRUE(report_pb.client_properties().has_url_api_type()); + EXPECT_EQ(expected_pb.client_properties().url_api_type(), + report_pb.client_properties().url_api_type()); EXPECT_EQ(expected_pb.complete(), report_pb.complete()); } @@ -387,8 +392,8 @@ ui::PAGE_TRANSITION_TYPED); UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_MALWARE, true /* is_subresource */, - GURL(kThreatURL)); + InitResource(SB_THREAT_TYPE_URL_MALWARE, ThreatSource::CLIENT_SIDE_DETECTION, + true /* is_subresource */, GURL(kThreatURL), &resource); scoped_refptr<ThreatDetailsWrap> report = new ThreatDetailsWrap( ui_manager_.get(), web_contents(), resource, NULL, history_service()); @@ -430,8 +435,8 @@ ->NavigateAndCommit(GURL(kLandingURL)); UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_PHISHING, - true /* is_subresource */, GURL(kThreatURL)); + InitResource(SB_THREAT_TYPE_URL_PHISHING, ThreatSource::DATA_SAVER, + true /* is_subresource */, GURL(kThreatURL), &resource); resource.original_url = GURL(kOriginalLandingURL); scoped_refptr<ThreatDetailsWrap> report = new ThreatDetailsWrap( @@ -445,6 +450,8 @@ ClientSafeBrowsingReportRequest expected; expected.set_type(ClientSafeBrowsingReportRequest::URL_PHISHING); + expected.mutable_client_properties()->set_url_api_type( + ClientSafeBrowsingReportRequest::FLYWHEEL); expected.set_url(kThreatURL); expected.set_page_url(kLandingURL); expected.set_referrer_url(""); @@ -476,8 +483,8 @@ ->NavigateAndCommit(GURL(kLandingURL)); UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_UNWANTED, - true /* is_subresource */, GURL(kThreatURL)); + InitResource(SB_THREAT_TYPE_URL_UNWANTED, ThreatSource::LOCAL_PVER3, + true /* is_subresource */, GURL(kThreatURL), &resource); scoped_refptr<ThreatDetailsWrap> report = new ThreatDetailsWrap( ui_manager_.get(), web_contents(), resource, NULL, history_service()); @@ -503,6 +510,8 @@ ClientSafeBrowsingReportRequest expected; expected.set_type(ClientSafeBrowsingReportRequest::URL_UNWANTED); + expected.mutable_client_properties()->set_url_api_type( + ClientSafeBrowsingReportRequest::PVER3_NATIVE); expected.set_url(kThreatURL); expected.set_page_url(kLandingURL); expected.set_referrer_url(""); @@ -606,6 +615,8 @@ ClientSafeBrowsingReportRequest expected; expected.set_type(ClientSafeBrowsingReportRequest::URL_UNWANTED); + expected.mutable_client_properties()->set_url_api_type( + ClientSafeBrowsingReportRequest::PVER4_NATIVE); expected.set_url(kThreatURL); expected.set_page_url(kLandingURL); expected.set_referrer_url(""); @@ -676,8 +687,8 @@ elem_dom_inner_script->mutable_attribute(0)->set_value(kDOMChildUrl2); UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_UNWANTED, - true /* is_subresource */, GURL(kThreatURL)); + InitResource(SB_THREAT_TYPE_URL_UNWANTED, ThreatSource::LOCAL_PVER4, + true /* is_subresource */, GURL(kThreatURL), &resource); // Send both sets of nodes, from different render frames. { @@ -840,8 +851,9 @@ pb_element->mutable_attribute(0)->set_value(kDOMChildUrl2); UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_UNWANTED, - true /* is_subresource */, GURL(kThreatURL)); + InitResource(SB_THREAT_TYPE_URL_UNWANTED, + ThreatSource::PASSWORD_PROTECTION_SERVICE, + true /* is_subresource */, GURL(kThreatURL), &resource); scoped_refptr<ThreatDetailsWrap> report = new ThreatDetailsWrap( ui_manager_.get(), web_contents(), resource, NULL, history_service()); base::HistogramTester histograms; @@ -867,8 +879,8 @@ ->NavigateAndCommit(GURL(kLandingURL)); UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_MALWARE, true /* is_subresource */, - GURL(kThreatURL)); + InitResource(SB_THREAT_TYPE_URL_MALWARE, ThreatSource::REMOTE, + true /* is_subresource */, GURL(kThreatURL), &resource); resource.original_url = GURL(kOriginalLandingURL); // add some redirect urls @@ -886,6 +898,8 @@ ClientSafeBrowsingReportRequest expected; expected.set_type(ClientSafeBrowsingReportRequest::URL_MALWARE); + expected.mutable_client_properties()->set_url_api_type( + ClientSafeBrowsingReportRequest::ANDROID_SAFETYNET); expected.set_url(kThreatURL); expected.set_page_url(kLandingURL); expected.set_referrer_url(""); @@ -943,8 +957,8 @@ // Create UnsafeResource for the pending main page load. UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_MALWARE, - false /* is_subresource */, GURL(kLandingURL)); + InitResource(SB_THREAT_TYPE_URL_MALWARE, ThreatSource::UNKNOWN, + false /* is_subresource */, GURL(kLandingURL), &resource); // Start ThreatDetails collection. scoped_refptr<ThreatDetailsWrap> report = new ThreatDetailsWrap( @@ -998,8 +1012,8 @@ // Create UnsafeResource for fake sub-resource of landing page. UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_MALWARE, true /* is_subresource */, - GURL(kThreatURL)); + InitResource(SB_THREAT_TYPE_URL_MALWARE, ThreatSource::LOCAL_PVER4, + true /* is_subresource */, GURL(kThreatURL), &resource); // Start a pending load before creating ThreatDetails. controller().LoadURL(GURL(kPendingURL), @@ -1018,6 +1032,8 @@ ClientSafeBrowsingReportRequest expected; expected.set_type(ClientSafeBrowsingReportRequest::URL_MALWARE); + expected.mutable_client_properties()->set_url_api_type( + ClientSafeBrowsingReportRequest::PVER4_NATIVE); expected.set_url(kThreatURL); expected.set_page_url(kLandingURL); // Note that the referrer policy is not actually enacted here, since that's @@ -1049,8 +1065,8 @@ // Simulate a subresource malware hit (this could happen if the WebContents // was created with window.open, and had content injected into it). UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_MALWARE, true /* is_subresource */, - GURL(kThreatURL)); + InitResource(SB_THREAT_TYPE_URL_MALWARE, ThreatSource::CLIENT_SIDE_DETECTION, + true /* is_subresource */, GURL(kThreatURL), &resource); // Do ThreatDetails collection. scoped_refptr<ThreatDetailsWrap> report = new ThreatDetailsWrap( @@ -1081,8 +1097,9 @@ ->NavigateAndCommit(GURL(kLandingURL)); UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING, - true /* is_subresource */, GURL(kThreatURL)); + InitResource(SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING, + ThreatSource::CLIENT_SIDE_DETECTION, true /* is_subresource */, + GURL(kThreatURL), &resource); scoped_refptr<ThreatDetailsWrap> report = new ThreatDetailsWrap(ui_manager_.get(), web_contents(), resource, @@ -1164,8 +1181,9 @@ ->NavigateAndCommit(GURL(kLandingURL)); UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING, - true /* is_subresource */, GURL(kThreatURLHttps)); + InitResource(SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING, + ThreatSource::CLIENT_SIDE_DETECTION, true /* is_subresource */, + GURL(kThreatURLHttps), &resource); scoped_refptr<ThreatDetailsWrap> report = new ThreatDetailsWrap(ui_manager_.get(), web_contents(), resource, @@ -1244,8 +1262,9 @@ ->NavigateAndCommit(GURL(kLandingURL)); UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE, - true /* is_subresource */, GURL(kThreatURL)); + InitResource(SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE, + ThreatSource::LOCAL_PVER3, true /* is_subresource */, + GURL(kThreatURL), &resource); scoped_refptr<ThreatDetailsWrap> report = new ThreatDetailsWrap(ui_manager_.get(), web_contents(), resource, @@ -1268,6 +1287,8 @@ ClientSafeBrowsingReportRequest expected; expected.set_type(ClientSafeBrowsingReportRequest::URL_CLIENT_SIDE_MALWARE); + expected.mutable_client_properties()->set_url_api_type( + ClientSafeBrowsingReportRequest::PVER3_NATIVE); expected.set_url(kThreatURL); expected.set_page_url(kLandingURL); expected.set_referrer_url(""); @@ -1302,8 +1323,8 @@ ->NavigateAndCommit(GURL(kLandingURL)); UnsafeResource resource; - InitResource(&resource, SB_THREAT_TYPE_URL_MALWARE, true /* is_subresource */, - GURL(kThreatURL)); + InitResource(SB_THREAT_TYPE_URL_MALWARE, ThreatSource::LOCAL_PVER3, + true /* is_subresource */, GURL(kThreatURL), &resource); scoped_refptr<ThreatDetailsWrap> report = new ThreatDetailsWrap( ui_manager_.get(), web_contents(), resource, NULL, history_service()); @@ -1321,6 +1342,8 @@ ClientSafeBrowsingReportRequest expected; expected.set_type(ClientSafeBrowsingReportRequest::URL_MALWARE); + expected.mutable_client_properties()->set_url_api_type( + ClientSafeBrowsingReportRequest::PVER3_NATIVE); expected.set_url(kThreatURL); expected.set_page_url(kLandingURL); expected.set_referrer_url("");
diff --git a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc index bf704cd..0e1ec6ae 100644 --- a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc +++ b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
@@ -62,9 +62,9 @@ previous->Hide(); PasswordGenerationPopupControllerImpl* controller = - new PasswordGenerationPopupControllerImpl( - bounds, form, max_length, password_manager, driver, observer, - web_contents, container_view); + new PasswordGenerationPopupControllerImpl(bounds, form, max_length, + driver, observer, web_contents, + container_view); return controller->GetWeakPtr(); } @@ -72,14 +72,12 @@ const gfx::RectF& bounds, const PasswordForm& form, int max_length, - password_manager::PasswordManager* password_manager, password_manager::PasswordManagerDriver* driver, PasswordGenerationPopupObserver* observer, content::WebContents* web_contents, gfx::NativeView container_view) : view_(NULL), form_(form), - password_manager_(password_manager), driver_(driver), observer_(observer), generator_(new PasswordGenerator(max_length)), @@ -148,7 +146,6 @@ return; driver_->GeneratedPasswordAccepted(current_password_); - password_manager_->SetHasGeneratedPasswordForForm(driver_, form_, true); Hide(); }
diff --git a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.h b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.h index 168a6d90..c789dd1 100644 --- a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.h +++ b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.h
@@ -76,7 +76,6 @@ const gfx::RectF& bounds, const PasswordForm& form, int max_length, - password_manager::PasswordManager* password_manager, password_manager::PasswordManagerDriver* driver, PasswordGenerationPopupObserver* observer, content::WebContents* web_contents, @@ -127,7 +126,6 @@ void CalculateBounds(); PasswordForm form_; - password_manager::PasswordManager* password_manager_; password_manager::PasswordManagerDriver* driver_; // May be NULL.
diff --git a/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc b/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc index 3e23018..122f19fa 100644 --- a/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc +++ b/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc
@@ -28,7 +28,6 @@ gfx::RectF(0, 0, 10, 10), PasswordForm(), 10, - nullptr /* PasswordManager*/, password_manager::ContentPasswordManagerDriverFactory:: FromWebContents(web_contents) ->GetDriverForFrame(web_contents->GetMainFrame()),
diff --git a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc index bb1afe81..0c8ce60 100644 --- a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc +++ b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc
@@ -151,8 +151,7 @@ header->SetHorizontalAlignment(gfx::ALIGN_LEFT); header->SetBorder(views::CreateEmptyBorder( vertical_padding, - provider->GetDistanceMetric( - views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN), + provider->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS).left(), vertical_padding, 0)); scroll_container->AddChildView(header); }
diff --git a/chrome/browser/ui/views/extensions/media_galleries_dialog_views_browsertest.cc b/chrome/browser/ui/views/extensions/media_galleries_dialog_views_browsertest.cc new file mode 100644 index 0000000..9b13277 --- /dev/null +++ b/chrome/browser/ui/views/extensions/media_galleries_dialog_views_browsertest.cc
@@ -0,0 +1,83 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/macros.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/utf_string_conversions.h" +#include "chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/test/test_browser_dialog.h" +#include "chrome/browser/ui/views/extensions/media_galleries_dialog_views.h" +#include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "components/storage_monitor/storage_info.h" +#include "content/public/browser/page_navigator.h" +#include "content/public/common/referrer.h" +#include "content/public/test/browser_test_utils.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/page_transition_types.h" +#include "ui/base/window_open_disposition.h" +#include "ui/views/controls/button/checkbox.h" +#include "url/gurl.h" +#include "url/url_constants.h" + +namespace { + +MediaGalleryPrefInfo MakePrefInfo(MediaGalleryPrefId id) { + MediaGalleryPrefInfo gallery; + gallery.pref_id = id; + gallery.device_id = storage_monitor::StorageInfo::MakeDeviceId( + storage_monitor::StorageInfo::FIXED_MASS_STORAGE, + base::Uint64ToString(id)); + gallery.display_name = base::ASCIIToUTF16("Display Name"); + return gallery; +} + +} // namespace + +class MediaGalleriesInteractiveDialogTest : public DialogBrowserTest { + public: + MediaGalleriesInteractiveDialogTest() {} + ~MediaGalleriesInteractiveDialogTest() override {} + + void PreRunTestOnMainThread() override { + DialogBrowserTest::PreRunTestOnMainThread(); + const GURL about_blank(url::kAboutBlankURL); + content::WebContents* content = browser()->OpenURL(content::OpenURLParams( + about_blank, content::Referrer(), WindowOpenDisposition::CURRENT_TAB, + ui::PAGE_TRANSITION_TYPED, true)); + EXPECT_CALL(controller_, WebContents()) + .WillRepeatedly(testing::Return(content)); + content::TestNavigationManager manager(content, about_blank); + manager.WaitForNavigationFinished(); + } + + void ShowDialog(const std::string& name) override { + std::vector<base::string16> headers = {base::string16(), + base::ASCIIToUTF16("header2")}; + MediaGalleriesDialogController::Entries attached_permissions = { + MediaGalleriesDialogController::Entry(MakePrefInfo(1), true), + MediaGalleriesDialogController::Entry(MakePrefInfo(2), false)}; + ON_CALL(controller_, GetSectionHeaders()) + .WillByDefault(testing::Return(headers)); + EXPECT_CALL(controller_, GetSectionEntries(testing::_)) + .Times(testing::AnyNumber()); + EXPECT_CALL(controller_, GetSectionEntries(0)) + .WillRepeatedly(testing::Return(attached_permissions)); + + dialog_ = base::MakeUnique<MediaGalleriesDialogViews>(&controller_); + } + + private: + testing::NiceMock<MediaGalleriesDialogControllerMock> controller_; + std::unique_ptr<MediaGalleriesDialogViews> dialog_; + + DISALLOW_COPY_AND_ASSIGN(MediaGalleriesInteractiveDialogTest); +}; + +IN_PROC_BROWSER_TEST_F(MediaGalleriesInteractiveDialogTest, + InvokeDialog_DisplayDialog) { + RunDialog(); +}
diff --git a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc index 616c5ba..7551ac38 100644 --- a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc +++ b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc
@@ -31,10 +31,10 @@ DCHECK(button_listener != NULL); SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal)); ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); - const int border_horiz_margin = provider->GetDistanceMetric( - views::DISTANCE_BUBBLE_CONTENTS_HORIZONTAL_MARGIN); + const gfx::Insets border_margin = + provider->GetInsetsMetric(views::INSETS_BUBBLE_CONTENTS); SetBorder(views::CreateEmptyBorder( - 0, border_horiz_margin, trailing_vertical_space, border_horiz_margin)); + 0, border_margin.left(), trailing_vertical_space, border_margin.right())); if (menu_controller) set_context_menu_controller(menu_controller);
diff --git a/chrome/browser/ui/views/harmony/harmony_layout_provider.cc b/chrome/browser/ui/views/harmony/harmony_layout_provider.cc index d7abdc2..5dfe5751 100644 --- a/chrome/browser/ui/views/harmony/harmony_layout_provider.cc +++ b/chrome/browser/ui/views/harmony/harmony_layout_provider.cc
@@ -7,6 +7,9 @@ gfx::Insets HarmonyLayoutProvider::GetInsetsMetric(int metric) const { DCHECK_LT(metric, views::VIEWS_INSETS_MAX); switch (metric) { + case views::INSETS_BUBBLE_CONTENTS: + case views::INSETS_DIALOG_CONTENTS: + return gfx::Insets(kHarmonyLayoutUnit, kHarmonyLayoutUnit); case views::INSETS_VECTOR_IMAGE_BUTTON: return gfx::Insets(kHarmonyLayoutUnit / 4); default: @@ -18,10 +21,6 @@ DCHECK_GE(metric, views::VIEWS_INSETS_MAX); switch (metric) { case views::DISTANCE_BUBBLE_BUTTON_TOP_MARGIN: - case views::DISTANCE_BUBBLE_CONTENTS_HORIZONTAL_MARGIN: - case views::DISTANCE_BUBBLE_CONTENTS_VERTICAL_MARGIN: - case views::DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN: - case views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN: return kHarmonyLayoutUnit; case DISTANCE_CONTROL_LIST_VERTICAL: return kHarmonyLayoutUnit * 3 / 4;
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc index 38641812..645b9fa8 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
@@ -486,8 +486,9 @@ // In non-material, titles are inset from the dialog margin. Ensure the // horizontal insets match. set_title_margins( - gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric( - views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN), + gfx::Insets(ChromeLayoutProvider::Get() + ->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS) + .top(), side_margin, 0, side_margin)); } views::BubbleDialogDelegateView::CreateBubble(this);
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.js b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.js index be7b755..b54503f 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.js +++ b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.js
@@ -312,19 +312,20 @@ TEST_F('AutoScrollExtensionSettingsWebUITest', 'testAutoScroll', function() { var checkHasScrollbar = function() { - assertGT(document.body.scrollHeight, document.body.clientHeight); + assertGT(document.scrollingElement.scrollHeight, + document.body.clientHeight); this.nextStep(); }; var checkIsScrolled = function() { - assertGT(document.body.scrollTop, 0); + assertGT(document.scrollingElement.scrollTop, 0); this.nextStep(); }; var checkScrolledToTop = function() { - assertEquals(0, document.body.scrollTop); + assertEquals(0, document.scrollingElement.scrollTop); this.nextStep(); }; var scrollToTop = function() { - document.body.scrollTop = 0; + document.scrollingElement.scrollTop = 0; this.nextStep(); }; // Test that a) autoscroll works on first page load and b) updating the
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index 840c600..f6a7719 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn
@@ -216,7 +216,6 @@ "//chrome/common/media_router/mojo:dial_utility_interfaces", "//chrome/common/net", "//chrome/common/profiling", - "//chrome/common/safe_browsing:proto", "//chrome/installer/util:with_no_strings", "//components/cast_certificate", "//components/cdm/common", @@ -243,7 +242,6 @@ "//components/policy:generated", "//components/policy/core/common", "//components/prefs", - "//components/safe_browsing:csd_proto", "//components/signin/core/common", "//components/strings", "//components/translate/content/common", @@ -252,7 +250,6 @@ "//components/variations", "//components/visitedlink/common", "//content/public/common", - "//crypto", "//extensions/common:common_constants", "//extensions/features", "//google_apis", @@ -270,7 +267,6 @@ "//third_party/icu", "//third_party/re2", "//third_party/widevine/cdm:headers", - "//third_party/zlib/google:zip", "//ui/accessibility", "//ui/base", "//ui/gfx/ipc", @@ -489,43 +485,7 @@ } if (safe_browsing_mode != 0) { - sources += [ - "safe_browsing/file_type_policies.cc", - "safe_browsing/file_type_policies.h", - ] - - if (safe_browsing_mode == 1) { - sources += [ - "safe_browsing/archive_analyzer_results.cc", - "safe_browsing/archive_analyzer_results.h", - "safe_browsing/binary_feature_extractor.cc", - "safe_browsing/binary_feature_extractor.h", - "safe_browsing/binary_feature_extractor_mac.cc", - "safe_browsing/binary_feature_extractor_posix.cc", - "safe_browsing/binary_feature_extractor_win.cc", - "safe_browsing/download_protection_util.cc", - "safe_browsing/download_protection_util.h", - "safe_browsing/ipc_protobuf_message_macros.h", - "safe_browsing/ipc_protobuf_message_null_macros.h", - "safe_browsing/mach_o_image_reader_mac.cc", - "safe_browsing/mach_o_image_reader_mac.h", - "safe_browsing/pe_image_reader_win.cc", - "safe_browsing/pe_image_reader_win.h", - "safe_browsing/protobuf_message_log_macros.h", - "safe_browsing/protobuf_message_param_traits.h", - "safe_browsing/protobuf_message_read_macros.h", - "safe_browsing/protobuf_message_size_macros.h", - "safe_browsing/protobuf_message_write_macros.h", - "safe_browsing/zip_analyzer.cc", - "safe_browsing/zip_analyzer.h", - ] - - public_deps += [ "//ipc" ] - - # safe_archive_analyzer.mojom has a [Native] trait that depends on - # the protobuf headers in the sources list above. - allow_circular_includes_from = [ ":mojo_bindings" ] - } + public_deps += [ "//chrome/common/safe_browsing" ] } if (is_linux) {
diff --git a/chrome/common/safe_browsing/BUILD.gn b/chrome/common/safe_browsing/BUILD.gn index 55ccf63..fb98a0b 100644 --- a/chrome/common/safe_browsing/BUILD.gn +++ b/chrome/common/safe_browsing/BUILD.gn
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//chrome/common/features.gni") import("//third_party/protobuf/proto_library.gni") proto_library("proto") { @@ -12,3 +13,53 @@ "permission_report.proto", ] } + +source_set("safe_browsing") { + sources = [ + "file_type_policies.cc", + "file_type_policies.h", + ] + + if (safe_browsing_mode == 1) { + sources += [ + "archive_analyzer_results.cc", + "archive_analyzer_results.h", + "binary_feature_extractor.cc", + "binary_feature_extractor.h", + "binary_feature_extractor_mac.cc", + "binary_feature_extractor_posix.cc", + "binary_feature_extractor_win.cc", + "download_protection_util.cc", + "download_protection_util.h", + "ipc_protobuf_message_macros.h", + "ipc_protobuf_message_null_macros.h", + "mach_o_image_reader_mac.cc", + "mach_o_image_reader_mac.h", + "pe_image_reader_win.cc", + "pe_image_reader_win.h", + "protobuf_message_log_macros.h", + "protobuf_message_param_traits.h", + "protobuf_message_read_macros.h", + "protobuf_message_size_macros.h", + "protobuf_message_write_macros.h", + "zip_analyzer.cc", + "zip_analyzer.h", + ] + } + + public_deps = [ + "//base:i18n", + "//chrome/browser:resources", + "//chrome/common:mojo_bindings", + "//chrome/common/safe_browsing:proto", + "//components/safe_browsing:csd_proto", + "//crypto", + "//ipc", + "//third_party/zlib/google:zip", + "//ui/base", + ] + + # safe_archive_analyzer.mojom has a [Native] trait that depends on + # the protobuf headers in the sources list above. + allow_circular_includes_from = [ "//chrome/common:mojo_bindings" ] +}
diff --git a/chrome/common/safe_browsing/OWNERS b/chrome/common/safe_browsing/OWNERS index 20619dda..a044ef7 100644 --- a/chrome/common/safe_browsing/OWNERS +++ b/chrome/common/safe_browsing/OWNERS
@@ -2,6 +2,10 @@ nparker@chromium.org vakh@chromium.org +# This is for the common case of adding or renaming files. If you're doing +# structural changes, use usual OWNERS rules. +per-file BUILD.gn=* + per-file *_messages*.h=set noparent per-file *_messages*.h=file://ipc/SECURITY_OWNERS
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 6ae4d61..4250591 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2099,6 +2099,7 @@ "../browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc", "../browser/ui/views/extensions/extension_message_bubble_view_browsertest_nonmac.cc", "../browser/ui/views/extensions/extension_uninstall_dialog_view_browsertest.cc", + "../browser/ui/views/extensions/media_galleries_dialog_views_browsertest.cc", "../browser/ui/views/frame/browser_non_client_frame_view_browsertest.cc", "../browser/ui/views/frame/browser_view_browsertest.cc", "../browser/ui/views/location_bar/zoom_bubble_view_browsertest.cc",
diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn index f190c82..ad67a975 100644 --- a/chrome/utility/BUILD.gn +++ b/chrome/utility/BUILD.gn
@@ -56,6 +56,7 @@ "//skia", "//sql", "//third_party/libxml", + "//third_party/zlib/google:zip", ] if (!is_android) {
diff --git a/components/autofill/content/renderer/password_generation_agent.cc b/components/autofill/content/renderer/password_generation_agent.cc index f9fe4c9..e7986765 100644 --- a/components/autofill/content/renderer/password_generation_agent.cc +++ b/components/autofill/content/renderer/password_generation_agent.cc
@@ -334,6 +334,7 @@ void PasswordGenerationAgent::GeneratedPasswordAccepted( const base::string16& password) { password_is_generated_ = true; + password_edited_ = false; password_generation::LogPasswordGenerationEvent( password_generation::PASSWORD_ACCEPTED); LogMessage(Logger::STRING_GENERATION_RENDERER_GENERATED_PASSWORD_ACCEPTED); @@ -565,6 +566,7 @@ void PasswordGenerationAgent::PasswordNoLongerGenerated() { // Do not treat the password as generated, either here or in the browser. password_is_generated_ = false; + password_edited_ = false; generation_element_.SetShouldRevealPassword(false); for (blink::WebInputElement& password : generation_form_data_->password_elements)
diff --git a/components/autofill/core/browser/autofill_field.h b/components/autofill/core/browser/autofill_field.h index ed74fdf..ebe5d0b 100644 --- a/components/autofill/core/browser/autofill_field.h +++ b/components/autofill/core/browser/autofill_field.h
@@ -96,6 +96,13 @@ return generation_type_; } + void set_generated_password_changed(bool generated_password_changed) { + generated_password_changed_ = generated_password_changed; + } + bool generated_password_changed() const { + return generated_password_changed_; + } + void set_form_classifier_outcome( AutofillUploadContents::Field::FormClassifierOutcome outcome) { form_classifier_outcome_ = outcome; @@ -176,6 +183,9 @@ // The type of password generation event, if it happened. AutofillUploadContents::Field::PasswordGenerationType generation_type_; + // Whether the generated password was changed by user. + bool generated_password_changed_; + // The outcome of HTML parsing based form classifier. AutofillUploadContents::Field::FormClassifierOutcome form_classifier_outcome_;
diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc index 10a83809..4319c23 100644 --- a/components/autofill/core/browser/form_structure.cc +++ b/components/autofill/core/browser/form_structure.cc
@@ -1098,8 +1098,11 @@ AutofillUploadContents::Field* added_field = upload->add_field(); added_field->set_autofill_type(field_type); - if (field->generation_type()) + if (field->generation_type()) { added_field->set_generation_type(field->generation_type()); + added_field->set_generated_password_changed( + field->generated_password_changed()); + } if (field->form_classifier_outcome()) { added_field->set_form_classifier_outcome(
diff --git a/components/autofill/core/browser/form_structure_unittest.cc b/components/autofill/core/browser/form_structure_unittest.cc index ac80971..3a161b5 100644 --- a/components/autofill/core/browser/form_structure_unittest.cc +++ b/components/autofill/core/browser/form_structure_unittest.cc
@@ -2363,6 +2363,7 @@ form_structure->field(i)->set_generation_type( AutofillUploadContents::Field:: MANUALLY_TRIGGERED_GENERATION_ON_SIGN_UP_FORM); + form_structure->field(i)->set_generated_password_changed(true); form_structure->field(i)->set_form_classifier_outcome( AutofillUploadContents::Field::GENERATION_ELEMENT); } else { @@ -2436,6 +2437,7 @@ MANUALLY_TRIGGERED_GENERATION_ON_SIGN_UP_FORM); upload_password_field->set_properties_mask(FieldPropertiesFlags::HAD_FOCUS | FieldPropertiesFlags::USER_TYPED); + upload_password_field->set_generated_password_changed(true); std::string expected_upload_string; ASSERT_TRUE(upload.SerializeToString(&expected_upload_string));
diff --git a/components/autofill/core/browser/proto/server.proto b/components/autofill/core/browser/proto/server.proto index e84e202..ee556e5 100644 --- a/components/autofill/core/browser/proto/server.proto +++ b/components/autofill/core/browser/proto/server.proto
@@ -33,7 +33,7 @@ // This message contains information about the field types in a single form. // It is sent by the toolbar to contribute to the field type statistics. -// Next available id: 22 +// Next available id: 23 message AutofillUploadContents { required string client_version = 1; required fixed64 form_signature = 2; @@ -98,6 +98,10 @@ // The value of the id attribute, if it differs from the name attribute. // Otherwise, this field is absent. optional string id = 21; + + // True iff the user changed generated password. If there was no generation, + // the field is absent. + optional bool generated_password_changed = 22; } // Signature of the form action host (e.g. Hash64Bit("example.com")). optional fixed64 action_signature = 13;
diff --git a/components/password_manager/content/browser/content_password_manager_driver.cc b/components/password_manager/content/browser/content_password_manager_driver.cc index 3a847908..88fa1f0 100644 --- a/components/password_manager/content/browser/content_password_manager_driver.cc +++ b/components/password_manager/content/browser/content_password_manager_driver.cc
@@ -272,8 +272,7 @@ password_form.origin, BadMessageReason::CPMD_BAD_ORIGIN_PASSWORD_NO_LONGER_GENERATED)) return; - GetPasswordManager()->SetHasGeneratedPasswordForForm(this, password_form, - false); + GetPasswordManager()->OnPasswordNoLongerGenerated(password_form); } void ContentPasswordManagerDriver::SaveGenerationFieldDetectedByClassifier(
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc index 043391c..863d482 100644 --- a/components/password_manager/core/browser/password_form_manager.cc +++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -217,6 +217,7 @@ is_new_login_(true), has_autofilled_(false), has_generated_password_(false), + generated_password_changed_(false), is_manual_generation_(false), generation_popup_was_shown_(false), form_classifier_outcome_(kNoOutcome), @@ -441,6 +442,25 @@ old_primary_key ? &old_primary_key.value() : nullptr); } +void PasswordFormManager::PresaveGeneratedPassword( + const autofill::PasswordForm& form) { + form_saver()->PresaveGeneratedPassword(form); + metrics_recorder_.SetHasGeneratedPassword(true); + if (has_generated_password_) { + generated_password_changed_ = true; + } else { + SetHasGeneratedPassword(true); + generated_password_changed_ = false; + } +} + +void PasswordFormManager::PasswordNoLongerGenerated() { + DCHECK(has_generated_password_); + form_saver()->RemovePresavedPassword(); + SetHasGeneratedPassword(false); + generated_password_changed_ = false; +} + void PasswordFormManager::SetSubmittedForm(const autofill::PasswordForm& form) { bool is_change_password_form = !form.new_password_value.empty() && !form.password_value.empty(); @@ -859,6 +879,7 @@ autofill::AutofillField* field = form_structure->field(i); if (field->name == generation_element_) { field->set_generation_type(type); + field->set_generated_password_changed(generated_password_changed_); break; } } @@ -1194,10 +1215,10 @@ } void PasswordFormManager::OnNoInteraction(bool is_update) { - if (is_update) + if (is_update) { UploadPasswordVote(observed_form_, autofill::PROBABLY_NEW_PASSWORD, std::string()); - else { + } else { UploadPasswordVote(pending_credentials_, autofill::UNKNOWN_TYPE, std::string()); }
diff --git a/components/password_manager/core/browser/password_form_manager.h b/components/password_manager/core/browser/password_form_manager.h index 6bab1697..ae90dfc 100644 --- a/components/password_manager/core/browser/password_form_manager.h +++ b/components/password_manager/core/browser/password_form_manager.h
@@ -153,11 +153,26 @@ void LogSubmitPassed(); void LogSubmitFailed(); + // Called when generated password is accepted or changed by user. + void PresaveGeneratedPassword(const autofill::PasswordForm& form); + + // Called when user removed a generated password. + void PasswordNoLongerGenerated(); + // These functions are used to determine if this form has had it's password // auto generated by the browser. bool has_generated_password() const { return has_generated_password_; } void SetHasGeneratedPassword(bool generated_password); + // These functions are used to determine if this form has generated password + // changed by user. + bool generated_password_changed() const { + return generated_password_changed_; + } + void set_generated_password_changed(bool generated_password_changed) { + generated_password_changed_ = generated_password_changed; + } + bool is_manual_generation() { return is_manual_generation_; } void set_is_manual_generation(bool is_manual_generation) { is_manual_generation_ = is_manual_generation; @@ -458,6 +473,9 @@ // Whether this form has an auto generated password. bool has_generated_password_; + // Whether this form has a generated password changed by user. + bool generated_password_changed_; + // Whether password generation was manually triggered. bool is_manual_generation_;
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc index 51de9de7..225ac0f 100644 --- a/components/password_manager/core/browser/password_form_manager_unittest.cc +++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -90,6 +90,9 @@ void(const autofill::PasswordForm& pending, std::map<base::string16, const PasswordForm*>* best_matches, const autofill::PasswordForm** preferred_match)); + MOCK_METHOD1(PresaveGeneratedPassword, + void(const autofill::PasswordForm& generated)); + MOCK_METHOD0(RemovePresavedPassword, void()); // Convenience downcasting method. static MockFormSaver& Get(PasswordFormManager* form_manager) { @@ -153,9 +156,10 @@ return true; } -MATCHER_P2(CheckUploadedGenerationTypesAndSignature, +MATCHER_P3(CheckUploadedGenerationTypesAndSignature, form_signature, expected_generation_types, + generated_password_changed, "Unexpected generation types or form signature") { if (form_signature != arg.FormSignatureAsStr()) { // Unexpected form's signature. @@ -184,6 +188,12 @@ << ", but found " << field->generation_type(); return false; } + + if (field->generation_type() != + autofill::AutofillUploadContents::Field::IGNORED_GENERATION_POPUP) { + EXPECT_EQ(generated_password_changed, + field->generated_password_changed()); + } } } return true; @@ -605,11 +615,13 @@ void GeneratedVoteUploadTest(bool is_manual_generation, bool is_change_password_form, bool has_generated_password, + bool generated_password_changed, SavePromptInteraction interaction) { SCOPED_TRACE(testing::Message() << "is_manual_generation=" << is_manual_generation << " is_change_password_form=" << is_change_password_form << " has_generated_password=" << has_generated_password + << " generated_password_changed=" << generated_password_changed << " interaction=" << interaction); PasswordForm form(*observed_form()); form.form_data = saved_match()->form_data; @@ -656,6 +668,8 @@ form_manager.set_generation_element(generation_element); form_manager.set_generation_popup_was_shown(true); form_manager.SetHasGeneratedPassword(has_generated_password); + if (has_generated_password) + form_manager.set_generated_password_changed(generated_password_changed); // Figure out expected generation event type. autofill::AutofillUploadContents::Field::PasswordGenerationType @@ -673,7 +687,8 @@ *client()->mock_driver()->mock_autofill_download_manager(), StartUploadRequest( CheckUploadedGenerationTypesAndSignature( - form_structure.FormSignatureAsStr(), expected_generation_types), + form_structure.FormSignatureAsStr(), expected_generation_types, + generated_password_changed), false, expected_available_field_types, std::string(), true)); form_manager.ProvisionallySave( @@ -2529,7 +2544,6 @@ TEST_F(PasswordFormManagerTest, TestSavingOnChangePasswordFormGenerationNoStoredForms) { fake_form_fetcher()->SetNonFederated(std::vector<const PasswordForm*>(), 0u); - form_manager()->SetHasGeneratedPassword(true); // User submits change password form and there is no stored credentials. PasswordForm credentials = *observed_form(); @@ -2538,6 +2552,7 @@ credentials.new_password_element = ASCIIToUTF16("NewPasswd"); credentials.new_password_value = ASCIIToUTF16("new_password"); credentials.preferred = true; + form_manager()->PresaveGeneratedPassword(credentials); form_manager()->ProvisionallySave( credentials, PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); @@ -2564,7 +2579,6 @@ TEST_F(PasswordFormManagerTest, TestUpdatingOnChangePasswordFormGeneration) { fake_form_fetcher()->SetNonFederated({saved_match()}, 0u); - form_manager()->SetHasGeneratedPassword(true); // User submits credentials for the change password form, and old password is // coincide with password from an existing credentials, so stored credentials @@ -2575,6 +2589,7 @@ credentials.new_password_element = ASCIIToUTF16("NewPasswd"); credentials.new_password_value = ASCIIToUTF16("new_password"); credentials.preferred = true; + form_manager()->PresaveGeneratedPassword(credentials); form_manager()->ProvisionallySave( credentials, PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); @@ -2600,7 +2615,6 @@ TEST_F(PasswordFormManagerTest, TestSavingOnChangePasswordFormGenerationNoMatchedForms) { fake_form_fetcher()->SetNonFederated({saved_match()}, 0u); - form_manager()->SetHasGeneratedPassword(true); // User submits credentials for the change password form, and old password is // not coincide with password from existing credentials, so new credentials @@ -2612,6 +2626,7 @@ credentials.new_password_element = ASCIIToUTF16("NewPasswd"); credentials.new_password_value = ASCIIToUTF16("new_password"); credentials.preferred = true; + form_manager()->PresaveGeneratedPassword(credentials); form_manager()->ProvisionallySave( credentials, PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); @@ -2710,15 +2725,42 @@ for (bool is_manual_generation : kFalseTrue) { for (bool is_change_password_form : kFalseTrue) { for (bool has_generated_password : kFalseTrue) { - for (SavePromptInteraction interaction : kSavePromptInterations) { - GeneratedVoteUploadTest(is_manual_generation, is_change_password_form, - has_generated_password, interaction); + for (bool generated_password_changed : kFalseTrue) { + for (SavePromptInteraction interaction : kSavePromptInterations) { + GeneratedVoteUploadTest(is_manual_generation, + is_change_password_form, + has_generated_password, + generated_password_changed, interaction); + } } } } } } +TEST_F(PasswordFormManagerTest, PresaveGeneratedPasswordAndRemoveIt) { + PasswordForm credentials = *observed_form(); + + // Simulate the user accepted a generated password. + EXPECT_CALL(MockFormSaver::Get(form_manager()), + PresaveGeneratedPassword(credentials)); + form_manager()->PresaveGeneratedPassword(credentials); + EXPECT_TRUE(form_manager()->has_generated_password()); + EXPECT_FALSE(form_manager()->generated_password_changed()); + + // Simulate the user changed the presaved password. + credentials.password_value = ASCIIToUTF16("changed_password"); + EXPECT_CALL(MockFormSaver::Get(form_manager()), + PresaveGeneratedPassword(credentials)); + form_manager()->PresaveGeneratedPassword(credentials); + EXPECT_TRUE(form_manager()->has_generated_password()); + EXPECT_TRUE(form_manager()->generated_password_changed()); + + // Simulate the user removed the presaved password. + EXPECT_CALL(MockFormSaver::Get(form_manager()), RemovePresavedPassword()); + form_manager()->PasswordNoLongerGenerated(); +} + TEST_F(PasswordFormManagerTest, FormClassifierVoteUpload) { const bool kFalseTrue[] = {false, true}; for (bool found_generation_element : kFalseTrue) {
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc index 61f01ab3..4499d51b 100644 --- a/components/password_manager/core/browser/password_manager.cc +++ b/components/password_manager/core/browser/password_manager.cc
@@ -197,27 +197,23 @@ DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage()); PasswordFormManager* form_manager = GetMatchingPendingManager(form); if (form_manager) { - form_manager->form_saver()->PresaveGeneratedPassword(form); + form_manager->PresaveGeneratedPassword(form); + UMA_HISTOGRAM_BOOLEAN("PasswordManager.GeneratedFormHasNoFormManager", + false); return; } + + UMA_HISTOGRAM_BOOLEAN("PasswordManager.GeneratedFormHasNoFormManager", true); } -void PasswordManager::SetHasGeneratedPasswordForForm( - password_manager::PasswordManagerDriver* driver, - const PasswordForm& form, - bool password_is_generated) { +void PasswordManager::OnPasswordNoLongerGenerated(const PasswordForm& form) { DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage()); PasswordFormManager* form_manager = GetMatchingPendingManager(form); if (form_manager) { - if (!password_is_generated) - form_manager->form_saver()->RemovePresavedPassword(); - form_manager->SetHasGeneratedPassword(password_is_generated); + form_manager->PasswordNoLongerGenerated(); return; } - - UMA_HISTOGRAM_BOOLEAN("PasswordManager.GeneratedFormHasNoFormManager", - password_is_generated); } void PasswordManager::SetGenerationElementAndReasonForForm(
diff --git a/components/password_manager/core/browser/password_manager.h b/components/password_manager/core/browser/password_manager.h index b85165d..c3eb149 100644 --- a/components/password_manager/core/browser/password_manager.h +++ b/components/password_manager/core/browser/password_manager.h
@@ -101,14 +101,10 @@ void GenerationAvailableForForm(const autofill::PasswordForm& form); // Presaves the form with generated password. - void OnPresaveGeneratedPassword(const autofill::PasswordForm& password_form); + void OnPresaveGeneratedPassword(const autofill::PasswordForm& form); - // Update the state of generation for this form. - // If |password_is_generated| == false, removes the presaved form. - void SetHasGeneratedPasswordForForm( - password_manager::PasswordManagerDriver* driver, - const autofill::PasswordForm& form, - bool password_is_generated); + // Stops treating a password as generated. + void OnPasswordNoLongerGenerated(const autofill::PasswordForm& form); // Update the generation element and whether generation was triggered // manually.
diff --git a/components/password_manager/core/browser/password_manager_unittest.cc b/components/password_manager/core/browser/password_manager_unittest.cc index d0895e8c8..3fcca5a3 100644 --- a/components/password_manager/core/browser/password_manager_unittest.cc +++ b/components/password_manager/core/browser/password_manager_unittest.cc
@@ -14,6 +14,7 @@ #include "base/message_loop/message_loop.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "components/password_manager/core/browser/form_fetcher_impl.h" #include "components/password_manager/core/browser/mock_password_store.h" @@ -306,7 +307,8 @@ // Simulate the user generating the password and submitting the form. EXPECT_CALL(client_, IsSavingAndFillingEnabledForCurrentPage()) .WillRepeatedly(Return(true)); - manager()->SetHasGeneratedPasswordForForm(&driver_, form, true); + EXPECT_CALL(*store_, AddLogin(_)); + manager()->OnPresaveGeneratedPassword(form); OnPasswordFormSubmitted(form); // The user should not need to confirm saving as they have already given @@ -315,7 +317,8 @@ // occured. EXPECT_CALL(client_, PromptUserToSaveOrUpdatePasswordPtr(_)).Times(0); PasswordForm form_to_save; - EXPECT_CALL(*store_, AddLogin(_)).WillOnce(SaveArg<0>(&form_to_save)); + EXPECT_CALL(*store_, UpdateLoginWithPrimaryKey(_, _)) + .WillOnce(SaveArg<0>(&form_to_save)); EXPECT_CALL(client_, AutomaticPasswordSaveIndicator()); // Now the password manager waits for the navigation to complete. @@ -1219,7 +1222,8 @@ EXPECT_CALL(client_, IsSavingAndFillingEnabledForCurrentPage()) .WillRepeatedly(Return(true)); - manager()->SetHasGeneratedPasswordForForm(&driver_, form, true); + EXPECT_CALL(*store_, AddLogin(_)); + manager()->OnPresaveGeneratedPassword(form); // Do not save generated password when the password form reappears. EXPECT_CALL(client_, PromptUserToSaveOrUpdatePasswordPtr(_)).Times(0); @@ -1246,7 +1250,8 @@ EXPECT_CALL(client_, IsSavingAndFillingEnabledForCurrentPage()) .WillRepeatedly(Return(true)); - manager()->SetHasGeneratedPasswordForForm(&driver_, form, true); + EXPECT_CALL(*store_, AddLogin(_)); + manager()->OnPresaveGeneratedPassword(form); // Simulate user editing and submitting a different password. Verify that // the edited password is the one that is saved. @@ -1279,11 +1284,13 @@ EXPECT_CALL(client_, IsSavingAndFillingEnabledForCurrentPage()) .WillRepeatedly(Return(true)); - manager()->SetHasGeneratedPasswordForForm(&driver_, form, true); + EXPECT_CALL(*store_, AddLogin(_)); + manager()->OnPresaveGeneratedPassword(form); // Simulate user removing generated password and adding a new one. form.new_password_value = ASCIIToUTF16("different_password"); - manager()->SetHasGeneratedPasswordForForm(&driver_, form, false); + EXPECT_CALL(*store_, RemoveLogin(_)); + manager()->OnPasswordNoLongerGenerated(form); OnPasswordFormSubmitted(form); @@ -1311,11 +1318,13 @@ EXPECT_CALL(client_, IsSavingAndFillingEnabledForCurrentPage()) .WillRepeatedly(Return(true)); - manager()->SetHasGeneratedPasswordForForm(&driver_, form, true); + EXPECT_CALL(*store_, AddLogin(_)); + manager()->OnPresaveGeneratedPassword(form); // Simulate user removing generated password and adding a new one. form.new_password_value = ASCIIToUTF16("different_password"); - manager()->SetHasGeneratedPasswordForForm(&driver_, form, false); + EXPECT_CALL(*store_, RemoveLogin(_)); + manager()->OnPasswordNoLongerGenerated(form); OnPasswordFormSubmitted(form); @@ -1342,7 +1351,8 @@ EXPECT_CALL(client_, IsSavingAndFillingEnabledForCurrentPage()) .WillRepeatedly(Return(true)); - manager()->SetHasGeneratedPasswordForForm(&driver_, form, true); + EXPECT_CALL(*store_, AddLogin(_)); + manager()->OnPresaveGeneratedPassword(form); // Simulate user changing the password and username, without ever completely // deleting the password. @@ -1352,7 +1362,8 @@ EXPECT_CALL(client_, PromptUserToSaveOrUpdatePasswordPtr(_)).Times(0); PasswordForm form_to_save; - EXPECT_CALL(*store_, AddLogin(_)).WillOnce(SaveArg<0>(&form_to_save)); + EXPECT_CALL(*store_, UpdateLoginWithPrimaryKey(_, _)) + .WillOnce(SaveArg<0>(&form_to_save)); EXPECT_CALL(client_, AutomaticPasswordSaveIndicator()); observed.clear(); @@ -1375,11 +1386,12 @@ manager()->OnPasswordFormsParsed(&driver_, observed); manager()->OnPasswordFormsRendered(&driver_, observed, true); + base::HistogramTester histogram_tester; + // The user accepts a generated password. form.password_value = base::ASCIIToUTF16("password"); EXPECT_CALL(*store_, AddLogin(form)).WillOnce(Return()); manager()->OnPresaveGeneratedPassword(form); - manager()->SetHasGeneratedPasswordForForm(&driver_, form, true); // The user updates the generated password. PasswordForm updated_form(form); @@ -1387,10 +1399,36 @@ EXPECT_CALL(*store_, UpdateLoginWithPrimaryKey(updated_form, form)) .WillOnce(Return()); manager()->OnPresaveGeneratedPassword(updated_form); + histogram_tester.ExpectUniqueSample( + "PasswordManager.GeneratedFormHasNoFormManager", false, 2); // The user removes the generated password. EXPECT_CALL(*store_, RemoveLogin(updated_form)).WillOnce(Return()); - manager()->SetHasGeneratedPasswordForForm(&driver_, updated_form, false); + manager()->OnPasswordNoLongerGenerated(updated_form); +} + +TEST_F(PasswordManagerTest, PasswordGenerationPresavePassword_NoFormManager) { + // Checks that GeneratedFormHasNoFormManager metric is sent if there is no + // corresponding PasswordFormManager for the given form. It should be uncommon + // case. + std::vector<PasswordForm> observed; + EXPECT_CALL(client_, IsSavingAndFillingEnabledForCurrentPage()) + .WillRepeatedly(Return(true)); + EXPECT_CALL(*store_, GetLogins(_, _)) + .WillRepeatedly(WithArg<1>(InvokeEmptyConsumerWithForms())); + manager()->OnPasswordFormsParsed(&driver_, observed); + manager()->OnPasswordFormsRendered(&driver_, observed, true); + + base::HistogramTester histogram_tester; + + // The user accepts a generated password. + PasswordForm form(MakeFormWithOnlyNewPasswordField()); + form.password_value = base::ASCIIToUTF16("password"); + EXPECT_CALL(*store_, AddLogin(_)).Times(0); + + manager()->OnPresaveGeneratedPassword(form); + histogram_tester.ExpectUniqueSample( + "PasswordManager.GeneratedFormHasNoFormManager", true, 1); } TEST_F(PasswordManagerTest, PasswordGenerationPresavePasswordAndLogin) { @@ -1428,7 +1466,6 @@ // The user accepts generated password and makes successful login. EXPECT_CALL(*store_, AddLogin(form)).WillOnce(Return()); manager()->OnPresaveGeneratedPassword(form); - manager()->SetHasGeneratedPasswordForForm(&driver_, form, true); ::testing::Mock::VerifyAndClearExpectations(store_.get()); if (!found_matched_logins_in_store)
diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc index b7cce0b..2011f0cf 100644 --- a/components/printing/renderer/print_web_view_helper.cc +++ b/components/printing/renderer/print_web_view_helper.cc
@@ -759,8 +759,10 @@ // Backup size and offset if it's a local frame. blink::WebView* web_view = frame_.view(); if (blink::WebFrame* web_frame = web_view->MainFrame()) { + // TODO(lukasza, weili): Support restoring scroll offset of a remote main + // frame - https://crbug.com/734815. if (web_frame->IsWebLocalFrame()) - prev_scroll_offset_ = web_frame->GetScrollOffset(); + prev_scroll_offset_ = web_frame->ToWebLocalFrame()->GetScrollOffset(); } prev_view_size_ = web_view->Size(); @@ -861,8 +863,10 @@ blink::WebView* web_view = frame_.GetFrame()->View(); web_view->Resize(prev_view_size_); if (blink::WebFrame* web_frame = web_view->MainFrame()) { + // TODO(lukasza, weili): Support restoring scroll offset of a remote main + // frame - https://crbug.com/734815. if (web_frame->IsWebLocalFrame()) - web_frame->SetScrollOffset(prev_scroll_offset_); + web_frame->ToWebLocalFrame()->SetScrollOffset(prev_scroll_offset_); } }
diff --git a/components/safe_browsing/browser/threat_details.cc b/components/safe_browsing/browser/threat_details.cc index 0b7a7dc..b1fe8d6 100644 --- a/components/safe_browsing/browser/threat_details.cc +++ b/components/safe_browsing/browser/threat_details.cc
@@ -18,6 +18,7 @@ #include "components/safe_browsing/browser/threat_details_cache.h" #include "components/safe_browsing/browser/threat_details_history.h" #include "components/safe_browsing/common/safebrowsing_messages.h" +#include "components/safe_browsing_db/hit_report.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" @@ -131,6 +132,25 @@ return base::StringPrintf("%d-%d", frame_tree_node_id, element_node_id); } +using CSBRR = safe_browsing::ClientSafeBrowsingReportRequest; +CSBRR::SafeBrowsingUrlApiType GetUrlApiTypeForThreatSource( + safe_browsing::ThreatSource source) { + switch (source) { + case safe_browsing::ThreatSource::DATA_SAVER: + return CSBRR::FLYWHEEL; + case safe_browsing::ThreatSource::LOCAL_PVER3: + return CSBRR::PVER3_NATIVE; + case safe_browsing::ThreatSource::LOCAL_PVER4: + return CSBRR::PVER4_NATIVE; + case safe_browsing::ThreatSource::REMOTE: + return CSBRR::ANDROID_SAFETYNET; + case safe_browsing::ThreatSource::UNKNOWN: + case safe_browsing::ThreatSource::CLIENT_SIDE_DETECTION: + case safe_browsing::ThreatSource::PASSWORD_PROTECTION_SERVICE: + break; + } + return CSBRR::SAFE_BROWSING_URL_API_TYPE_UNSPECIFIED; +} } // namespace // The default ThreatDetailsFactory. Global, made a singleton so we @@ -589,6 +609,9 @@ } report_->set_complete(cache_result_); + report_->mutable_client_properties()->set_url_api_type( + GetUrlApiTypeForThreatSource(resource_.threat_source)); + // Send the report, using the SafeBrowsingService. std::string serialized; if (!report_->SerializeToString(&serialized)) {
diff --git a/components/safe_browsing/csd.proto b/components/safe_browsing/csd.proto index d84cc15..eb6fe64 100644 --- a/components/safe_browsing/csd.proto +++ b/components/safe_browsing/csd.proto
@@ -994,6 +994,29 @@ // DANGEROUS_DOWNLOAD_WARNING, DANGEROUS_DOWNLOAD_BY_API or // PASSWORD_PROTECTION_PHISHING_URL. optional bytes token = 15; + + enum SafeBrowsingUrlApiType { + SAFE_BROWSING_URL_API_TYPE_UNSPECIFIED = 0; + // Native implementation of Safe Browsing API v3 protocol. + PVER3_NATIVE = 1; + // Native implementation of Safe Browsing API v4 protocol. + PVER4_NATIVE = 2; + // Android SafetyNet API. + // https://developer.android.com/training/safetynet/safebrowsing.html + ANDROID_SAFETYNET = 3; + // Flywheel (data compression service). + FLYWHEEL = 4; + } + + // The information propagated from the client about various environment + // variables including SDK version, Google Play Services version and so on. + message SafeBrowsingClientProperties { + optional string client_version = 1; + optional int64 google_play_services_version = 2; + optional bool is_instant_apps = 3; + optional SafeBrowsingUrlApiType url_api_type = 4; + } + optional SafeBrowsingClientProperties client_properties = 17; } // An HTML Element on the page (eg: iframe, div, script, etc).
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc index 83e4dd3..439da33 100644 --- a/content/browser/renderer_host/media/audio_input_renderer_host.cc +++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc
@@ -159,6 +159,14 @@ base::RetainedRef(controller), message)); } +void AudioInputRendererHost::OnMuted(media::AudioInputController* controller, + bool is_muted) { + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::Bind(&AudioInputRendererHost::DoNotifyMutedState, this, + base::RetainedRef(controller), is_muted)); +} + void AudioInputRendererHost::set_renderer_pid(int32_t renderer_pid) { DCHECK_CURRENTLY_ON(BrowserThread::IO); renderer_pid_ = renderer_pid; @@ -235,6 +243,19 @@ LogMessage(entry->stream_id, message, false); } +void AudioInputRendererHost::DoNotifyMutedState( + media::AudioInputController* controller, + bool is_muted) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + AudioEntry* entry = LookupByController(controller); + DCHECK(entry); + LogMessage(entry->stream_id, + base::StringPrintf("OnMuted: State changed to: %s", + (is_muted ? "muted" : "not muted")), + true); + Send(new AudioInputMsg_NotifyStreamMuted(entry->stream_id, is_muted)); +} + bool AudioInputRendererHost::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(AudioInputRendererHost, message)
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.h b/content/browser/renderer_host/media/audio_input_renderer_host.h index d9a2d0a..47682e3 100644 --- a/content/browser/renderer_host/media/audio_input_renderer_host.h +++ b/content/browser/renderer_host/media/audio_input_renderer_host.h
@@ -115,6 +115,7 @@ media::AudioInputController::ErrorCode error_code) override; void OnLog(media::AudioInputController* controller, const std::string& message) override; + void OnMuted(media::AudioInputController* controller, bool is_muted) override; // Sets the PID renderer. This is used for constructing the debug recording // filename. @@ -177,6 +178,10 @@ void DoLog(media::AudioInputController* controller, const std::string& message); + // Notify renderer of a change to a stream's muted state. + void DoNotifyMutedState(media::AudioInputController* controller, + bool is_muted); + // Send an error message to the renderer. void SendErrorMessage(int stream_id, ErrorCode error_code);
diff --git a/content/browser/speech/speech_recognizer_impl.h b/content/browser/speech/speech_recognizer_impl.h index 5be62ca5..4c30dad 100644 --- a/content/browser/speech/speech_recognizer_impl.h +++ b/content/browser/speech/speech_recognizer_impl.h
@@ -148,6 +148,8 @@ media::AudioInputController::ErrorCode error_code) override; void OnLog(media::AudioInputController* controller, const std::string& message) override {} + void OnMuted(media::AudioInputController* controller, + bool is_muted) override {} // AudioInputController::SyncWriter methods. void Write(const media::AudioBus* data,
diff --git a/content/common/media/audio_messages.h b/content/common/media/audio_messages.h index 773b16c8..1fed287 100644 --- a/content/common/media/audio_messages.h +++ b/content/common/media/audio_messages.h
@@ -71,6 +71,12 @@ // Notification message sent from browser to renderer for state update. IPC_MESSAGE_CONTROL1(AudioInputMsg_NotifyStreamError, int /* stream id */) +// Notification message sent from browser to renderer when stream mutes or +// unmutes. +IPC_MESSAGE_CONTROL2(AudioInputMsg_NotifyStreamMuted, + int /* stream id */, + bool /* is muted? */) + // Messages sent from the renderer to the browser. // Message sent to the browser to request the use of an audio output
diff --git a/content/renderer/media/audio_input_message_filter.cc b/content/renderer/media/audio_input_message_filter.cc index 46b4e4c..145215b 100644 --- a/content/renderer/media/audio_input_message_filter.cc +++ b/content/renderer/media/audio_input_message_filter.cc
@@ -87,6 +87,7 @@ IPC_MESSAGE_HANDLER(AudioInputMsg_NotifyStreamCreated, OnStreamCreated) IPC_MESSAGE_HANDLER(AudioInputMsg_NotifyStreamError, OnStreamError) + IPC_MESSAGE_HANDLER(AudioInputMsg_NotifyStreamMuted, OnStreamMuted) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -156,6 +157,17 @@ delegate->OnError(); } +void AudioInputMessageFilter::OnStreamMuted(int stream_id, bool is_muted) { + DCHECK(io_task_runner_->BelongsToCurrentThread()); + media::AudioInputIPCDelegate* delegate = delegates_.Lookup(stream_id); + if (!delegate) { + DLOG(WARNING) << "Got audio stream muted event for a non-existent or " + "removed audio renderer."; + return; + } + delegate->OnMuted(is_muted); +} + AudioInputMessageFilter::AudioInputIPCImpl::AudioInputIPCImpl( const scoped_refptr<AudioInputMessageFilter>& filter, int render_frame_id)
diff --git a/content/renderer/media/audio_input_message_filter.h b/content/renderer/media/audio_input_message_filter.h index 4f48bccf..60952c9 100644 --- a/content/renderer/media/audio_input_message_filter.h +++ b/content/renderer/media/audio_input_message_filter.h
@@ -79,6 +79,9 @@ // encountered an error. void OnStreamError(int stream_id); + // Received when a stream is muted or unmuted. + void OnStreamMuted(int stream_id, bool is_muted); + // A map of stream ids to delegates. IDMap<media::AudioInputIPCDelegate*> delegates_;
diff --git a/content/renderer/media/external_media_stream_audio_source.cc b/content/renderer/media/external_media_stream_audio_source.cc index 56bc5178..4549d4c 100644 --- a/content/renderer/media/external_media_stream_audio_source.cc +++ b/content/renderer/media/external_media_stream_audio_source.cc
@@ -76,4 +76,8 @@ StopSourceOnError(why); } +void ExternalMediaStreamAudioSource::OnCaptureMuted(bool is_muted) { + SetMutedState(is_muted); +} + } // namespace content
diff --git a/content/renderer/media/external_media_stream_audio_source.h b/content/renderer/media/external_media_stream_audio_source.h index f520ae09..615508f8 100644 --- a/content/renderer/media/external_media_stream_audio_source.h +++ b/content/renderer/media/external_media_stream_audio_source.h
@@ -40,6 +40,7 @@ double volume, bool key_pressed) final; void OnCaptureError(const std::string& message) final; + void OnCaptureMuted(bool is_muted) final; // The external source provided to the constructor. scoped_refptr<media::AudioCapturerSource> source_;
diff --git a/content/renderer/media/local_media_stream_audio_source.cc b/content/renderer/media/local_media_stream_audio_source.cc index 522d8241..2c7f1aa8 100644 --- a/content/renderer/media/local_media_stream_audio_source.cc +++ b/content/renderer/media/local_media_stream_audio_source.cc
@@ -110,4 +110,8 @@ StopSourceOnError(why); } +void LocalMediaStreamAudioSource::OnCaptureMuted(bool is_muted) { + SetMutedState(is_muted); +} + } // namespace content
diff --git a/content/renderer/media/local_media_stream_audio_source.h b/content/renderer/media/local_media_stream_audio_source.h index 0b92751..ad44f3c 100644 --- a/content/renderer/media/local_media_stream_audio_source.h +++ b/content/renderer/media/local_media_stream_audio_source.h
@@ -40,6 +40,7 @@ double volume, bool key_pressed) final; void OnCaptureError(const std::string& message) final; + void OnCaptureMuted(bool is_muted) final; // The RenderFrame that will consume the audio data. Used when creating // AudioInputDevices via the AudioDeviceFactory.
diff --git a/content/renderer/media/media_stream_audio_source.cc b/content/renderer/media/media_stream_audio_source.cc index be556185..19ea853 100644 --- a/content/renderer/media/media_stream_audio_source.cc +++ b/content/renderer/media/media_stream_audio_source.cc
@@ -147,4 +147,10 @@ FROM_HERE, base::Bind(&MediaStreamSource::StopSource, GetWeakPtr())); } +void MediaStreamAudioSource::SetMutedState(bool muted_state) { + // TODO(ossu): Propagate this muted state into blink. + DVLOG(3) << "MediaStreamAudioSource::SetMutedState state=" << muted_state + << " (not implemented)"; +} + } // namespace content
diff --git a/content/renderer/media/media_stream_audio_source.h b/content/renderer/media/media_stream_audio_source.h index 392dac04..5b8a001 100644 --- a/content/renderer/media/media_stream_audio_source.h +++ b/content/renderer/media/media_stream_audio_source.h
@@ -132,6 +132,9 @@ // thread to stop the source soon. void StopSourceOnError(const std::string& why); + // Sets muted state and notifies it to all registered tracks. + void SetMutedState(bool state); + private: // MediaStreamSource override. void DoStopSource() final;
diff --git a/content/renderer/media/media_stream_source.h b/content/renderer/media/media_stream_source.h index 4ed5f07..c476ad7 100644 --- a/content/renderer/media/media_stream_source.h +++ b/content/renderer/media/media_stream_source.h
@@ -45,6 +45,9 @@ // WebMediaStreamSource::readyState to ended. void StopSource(); + // Sets the source's state to muted or to live. + void SetSourceMuted(bool is_muted); + // Sets device information about a source that has been created by a // JavaScript call to GetUserMedia. F.E a camera or microphone. void SetDeviceInfo(const StreamDeviceInfo& device_info);
diff --git a/content/renderer/media/webrtc/processed_local_audio_source.cc b/content/renderer/media/webrtc/processed_local_audio_source.cc index 75b7d4a..a4fb2da 100644 --- a/content/renderer/media/webrtc/processed_local_audio_source.cc +++ b/content/renderer/media/webrtc/processed_local_audio_source.cc
@@ -342,6 +342,10 @@ StopSourceOnError(message); } +void ProcessedLocalAudioSource::OnCaptureMuted(bool is_muted) { + SetMutedState(is_muted); +} + media::AudioParameters ProcessedLocalAudioSource::GetInputFormat() const { return audio_processor_ ? audio_processor_->InputFormat() : media::AudioParameters();
diff --git a/content/renderer/media/webrtc/processed_local_audio_source.h b/content/renderer/media/webrtc/processed_local_audio_source.h index dead7af..c712472 100644 --- a/content/renderer/media/webrtc/processed_local_audio_source.h +++ b/content/renderer/media/webrtc/processed_local_audio_source.h
@@ -95,6 +95,7 @@ double volume, bool key_pressed) override; void OnCaptureError(const std::string& message) override; + void OnCaptureMuted(bool is_muted) override; private: // Helper function to get the source buffer size based on whether audio
diff --git a/content/renderer/pepper/pepper_platform_audio_input.cc b/content/renderer/pepper/pepper_platform_audio_input.cc index cdb8073..80580711 100644 --- a/content/renderer/pepper/pepper_platform_audio_input.cc +++ b/content/renderer/pepper/pepper_platform_audio_input.cc
@@ -112,6 +112,8 @@ void PepperPlatformAudioInput::OnError() {} +void PepperPlatformAudioInput::OnMuted(bool is_muted) {} + void PepperPlatformAudioInput::OnIPCClosed() { ipc_.reset(); } PepperPlatformAudioInput::~PepperPlatformAudioInput() {
diff --git a/content/renderer/pepper/pepper_platform_audio_input.h b/content/renderer/pepper/pepper_platform_audio_input.h index cf7a06f..54f21acd 100644 --- a/content/renderer/pepper/pepper_platform_audio_input.h +++ b/content/renderer/pepper/pepper_platform_audio_input.h
@@ -60,6 +60,7 @@ int length, int total_segments) override; void OnError() override; + void OnMuted(bool is_muted) override; void OnIPCClosed() override; protected:
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc index 156dea90..aace371 100644 --- a/headless/app/headless_shell.cc +++ b/headless/app/headless_shell.cc
@@ -15,9 +15,11 @@ #include "base/files/file_path.h" #include "base/json/json_writer.h" #include "base/location.h" +#include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" #include "base/numerics/safe_conversions.h" #include "base/strings/string_number_conversions.h" +#include "base/task_scheduler/post_task.h" #include "content/public/app/content_main.h" #include "content/public/common/content_switches.h" #include "headless/app/headless_shell.h" @@ -74,6 +76,8 @@ #if !defined(CHROME_MULTIPLE_DLL_CHILD) void HeadlessShell::OnStart(HeadlessBrowser* browser) { browser_ = browser; + file_task_runner_ = base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::BACKGROUND}); HeadlessBrowserContext::Builder context_builder = browser_->CreateBrowserContextBuilder(); @@ -410,7 +414,7 @@ if (file_name.empty()) file_name = base::FilePath().AppendASCII(default_file_name); - file_proxy_.reset(new base::FileProxy(browser_->BrowserFileThread().get())); + file_proxy_ = base::MakeUnique<base::FileProxy>(file_task_runner_.get()); if (!file_proxy_->CreateOrOpen( file_name, base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE, base::Bind(&HeadlessShell::OnFileOpened, weak_factory_.GetWeakPtr(),
diff --git a/headless/app/headless_shell.h b/headless/app/headless_shell.h index 4e83d06..4aef3fd6 100644 --- a/headless/app/headless_shell.h +++ b/headless/app/headless_shell.h
@@ -10,6 +10,7 @@ #include "base/files/file_proxy.h" #include "base/memory/weak_ptr.h" +#include "base/sequenced_task_runner.h" #include "headless/app/shell_navigation_request.h" #include "headless/public/devtools/domains/emulation.h" #include "headless/public/devtools/domains/inspector.h" @@ -101,6 +102,7 @@ HeadlessBrowserContext* browser_context_; #endif bool processed_page_ready_; + scoped_refptr<base::SequencedTaskRunner> file_task_runner_; std::unique_ptr<base::FileProxy> file_proxy_; std::unique_ptr<DeterministicDispatcher> deterministic_dispatcher_; base::WeakPtrFactory<HeadlessShell> weak_factory_;
diff --git a/headless/lib/browser/headless_browser_context_impl.cc b/headless/lib/browser/headless_browser_context_impl.cc index 976c0987..baa97ce9 100644 --- a/headless/lib/browser/headless_browser_context_impl.cc +++ b/headless/lib/browser/headless_browser_context_impl.cc
@@ -249,8 +249,6 @@ new HeadlessURLRequestContextGetter( content::BrowserThread::GetTaskRunnerForThread( content::BrowserThread::IO), - content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::FILE), protocol_handlers, context_options_->TakeProtocolHandlers(), std::move(request_interceptors), context_options_.get(), browser_->browser_main_parts()->net_log()));
diff --git a/headless/lib/browser/headless_browser_impl.cc b/headless/lib/browser/headless_browser_impl.cc index 672047a..0f64f11b9 100644 --- a/headless/lib/browser/headless_browser_impl.cc +++ b/headless/lib/browser/headless_browser_impl.cc
@@ -82,12 +82,6 @@ } scoped_refptr<base::SingleThreadTaskRunner> -HeadlessBrowserImpl::BrowserFileThread() const { - return content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::FILE); -} - -scoped_refptr<base::SingleThreadTaskRunner> HeadlessBrowserImpl::BrowserIOThread() const { return content::BrowserThread::GetTaskRunnerForThread( content::BrowserThread::IO);
diff --git a/headless/lib/browser/headless_browser_impl.h b/headless/lib/browser/headless_browser_impl.h index 03b9a3f..1f8d6e5 100644 --- a/headless/lib/browser/headless_browser_impl.h +++ b/headless/lib/browser/headless_browser_impl.h
@@ -35,8 +35,6 @@ // HeadlessBrowser implementation: HeadlessBrowserContext::Builder CreateBrowserContextBuilder() override; - scoped_refptr<base::SingleThreadTaskRunner> BrowserFileThread() - const override; scoped_refptr<base::SingleThreadTaskRunner> BrowserIOThread() const override; scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread() const override;
diff --git a/headless/lib/browser/headless_content_browser_client.cc b/headless/lib/browser/headless_content_browser_client.cc index 6f2d431..943026d 100644 --- a/headless/lib/browser/headless_content_browser_client.cc +++ b/headless/lib/browser/headless_content_browser_client.cc
@@ -13,6 +13,7 @@ #include "base/json/json_reader.h" #include "base/memory/ptr_util.h" #include "base/path_service.h" +#include "base/task_scheduler/post_task.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" @@ -183,8 +184,8 @@ content::BrowserContext* context, content::StoragePartition* partition, const storage::OptionalQuotaSettingsCallback& callback) { - content::BrowserThread::PostTaskAndReplyWithResult( - content::BrowserThread::FILE, FROM_HERE, + base::PostTaskWithTraitsAndReplyWithResult( + FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, base::Bind(&storage::CalculateNominalDynamicSettings, partition->GetPath(), context->IsOffTheRecord()), callback);
diff --git a/headless/lib/browser/headless_url_request_context_getter.cc b/headless/lib/browser/headless_url_request_context_getter.cc index 1a0f4327..cf3d9b3 100644 --- a/headless/lib/browser/headless_url_request_context_getter.cc +++ b/headless/lib/browser/headless_url_request_context_getter.cc
@@ -9,7 +9,7 @@ #include <vector> #include "base/memory/ptr_util.h" -#include "base/single_thread_task_runner.h" +#include "base/task_scheduler/post_task.h" #include "content/public/browser/browser_thread.h" #include "headless/lib/browser/headless_browser_context_options.h" #include "headless/lib/browser/headless_network_delegate.h" @@ -22,14 +22,14 @@ HeadlessURLRequestContextGetter::HeadlessURLRequestContextGetter( scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, content::ProtocolHandlerMap* protocol_handlers, ProtocolHandlerMap context_protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptors, HeadlessBrowserContextOptions* options, net::NetLog* net_log) : io_task_runner_(std::move(io_task_runner)), - file_task_runner_(std::move(file_task_runner)), + file_task_runner_(base::CreateSingleThreadTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::BACKGROUND})), user_agent_(options->user_agent()), host_resolver_rules_(options->host_resolver_rules()), proxy_server_(options->proxy_server()), @@ -68,8 +68,7 @@ // TODO(skyostil): Make these configurable. builder.set_data_enabled(true); builder.set_file_enabled(true); - builder.SetFileTaskRunner(content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::FILE)); + builder.SetFileTaskRunner(file_task_runner_); if (!proxy_server_.IsEmpty()) { builder.set_proxy_service( net::ProxyService::CreateFixed(proxy_server_.ToString())); @@ -103,8 +102,7 @@ scoped_refptr<base::SingleThreadTaskRunner> HeadlessURLRequestContextGetter::GetNetworkTaskRunner() const { - return content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::IO); + return io_task_runner_; } net::HostResolver* HeadlessURLRequestContextGetter::host_resolver() const {
diff --git a/headless/lib/browser/headless_url_request_context_getter.h b/headless/lib/browser/headless_url_request_context_getter.h index 35de6a0a..5dcaa22 100644 --- a/headless/lib/browser/headless_url_request_context_getter.h +++ b/headless/lib/browser/headless_url_request_context_getter.h
@@ -32,7 +32,6 @@ public: HeadlessURLRequestContextGetter( scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, content::ProtocolHandlerMap* protocol_handlers, ProtocolHandlerMap context_protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptors, @@ -51,6 +50,8 @@ private: scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; + // TODO(eseckler): This should become a SequencedTaskRunner once net:: APIs + // accept a SequencedTaskRunner, see https://crbug.com/735368. scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; // The |options| object given to the constructor is not guaranteed to outlive
diff --git a/headless/public/headless_browser.h b/headless/public/headless_browser.h index 92b2610a..dc431c73 100644 --- a/headless/public/headless_browser.h +++ b/headless/public/headless_browser.h
@@ -72,10 +72,6 @@ HeadlessBrowserContext* browser_context) = 0; virtual HeadlessBrowserContext* GetDefaultBrowserContext() = 0; - // Returns a task runner for submitting work to the browser file thread. - virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserFileThread() - const = 0; - // Returns a task runner for submitting work to the browser io thread. virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserIOThread() const = 0;
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd index 4d53719..ec5f170 100644 --- a/ios/chrome/app/strings/ios_strings.grd +++ b/ios/chrome/app/strings/ios_strings.grd
@@ -581,9 +581,6 @@ <message name="IDS_IOS_CONTEXT_MENU_SEARCHWEBFORIMAGE" desc="Context menu text for option to perform a search for image [Length: 25em] [iOS only]"> Search <ph name="SEARCH_ENGINE">$1<ex>Google</ex></ph> For This Image </message> - <message name="IDS_IOS_COPY_URL" desc="The 'Copy URL' option in context menu which is shown if there is currently a search query shown in the omnibox and will put the URL for the search into the pasteboard. [Length: 10em] [iOS only]"> - Copy URL - </message> <message name="IDS_IOS_COPY_VERSION_HINT" desc="The accessibility hint for the label showing the Chrome version. [iOS only]"> Double tap to copy. </message>
diff --git a/ios/chrome/browser/passwords/password_generation_agent.mm b/ios/chrome/browser/passwords/password_generation_agent.mm index 67671677..57790216 100644 --- a/ios/chrome/browser/passwords/password_generation_agent.mm +++ b/ios/chrome/browser/passwords/password_generation_agent.mm
@@ -356,9 +356,8 @@ return; if (strongSelf->_passwordManager) { // Might be null in tests. - strongSelf->_passwordManager->SetHasGeneratedPasswordForForm( - strongSelf->_passwordManagerDriver, - *strongSelf->_possibleAccountCreationForm, true); + strongSelf->_passwordManager->OnPresaveGeneratedPassword( + *strongSelf->_possibleAccountCreationForm); } if (strongSelf->_accessoryViewReadyCompletion) { strongSelf->_accessoryViewReadyCompletion(
diff --git a/ios/chrome/browser/ui/authentication/chrome_signin_view_controller.mm b/ios/chrome/browser/ui/authentication/chrome_signin_view_controller.mm index 6cf3491..9323b06 100644 --- a/ios/chrome/browser/ui/authentication/chrome_signin_view_controller.mm +++ b/ios/chrome/browser/ui/authentication/chrome_signin_view_controller.mm
@@ -358,7 +358,7 @@ _interactionManager = ios::GetChromeBrowserProvider() ->GetChromeIdentityService() - ->NewChromeIdentityInteractionManager(_browserState, self); + ->CreateChromeIdentityInteractionManager(_browserState, self); __weak ChromeSigninViewController* weakSelf = self; SigninCompletionCallback completion = ^(ChromeIdentity* identity, NSError* error) {
diff --git a/ios/chrome/browser/ui/authentication/signin_interaction_controller.mm b/ios/chrome/browser/ui/authentication/signin_interaction_controller.mm index 797f568..0f9905c 100644 --- a/ios/chrome/browser/ui/authentication/signin_interaction_controller.mm +++ b/ios/chrome/browser/ui/authentication/signin_interaction_controller.mm
@@ -115,8 +115,8 @@ [self showSigninViewControllerWithIdentity:nil identityAdded:NO]; } else { identityInteractionManager_ = - identityService->NewChromeIdentityInteractionManager(browserState_, - self); + identityService->CreateChromeIdentityInteractionManager(browserState_, + self); if (!identityInteractionManager_) { // Abort sign-in if the ChromeIdentityInteractionManager returned is // nil (this can happen when the iOS internal provider is not used). @@ -162,7 +162,7 @@ identityInteractionManager_ = ios::GetChromeBrowserProvider() ->GetChromeIdentityService() - ->NewChromeIdentityInteractionManager(browserState_, self); + ->CreateChromeIdentityInteractionManager(browserState_, self); __weak SigninInteractionController* weakSelf = self; [identityInteractionManager_ reauthenticateUserWithID:base::SysUTF8ToNSString(idToReauthenticate) @@ -181,7 +181,7 @@ identityInteractionManager_ = ios::GetChromeBrowserProvider() ->GetChromeIdentityService() - ->NewChromeIdentityInteractionManager(browserState_, self); + ->CreateChromeIdentityInteractionManager(browserState_, self); __weak SigninInteractionController* weakSelf = self; [identityInteractionManager_ addAccountWithCompletion:^(ChromeIdentity* identity, NSError* error) {
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm index a579c9f..46174f3 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm
@@ -29,10 +29,8 @@ const CGFloat kMaxSearchFieldFrameMargin = 200; const CGFloat kDoodleTopMarginIPad = 82; -const CGFloat kDoodleTopMarginIPhonePortrait = 66; -const CGFloat kDoodleTopMarginIPhoneLandscape = 56; -const CGFloat kSearchFieldTopMarginIPhonePortrait = 32; -const CGFloat kSearchFieldTopMarginIPhoneLandscape = 16; +const CGFloat kDoodleTopMarginIPhone = 56; +const CGFloat kSearchFieldTopMarginIPhone = 16; const CGFloat kNTPSearchFieldBottomPadding = 16; const CGFloat kTopSpacingMaterialPortrait = 56; @@ -93,19 +91,13 @@ CGFloat doodleTopMargin() { if (IsIPadIdiom()) return kDoodleTopMarginIPad; - if (IsPortrait()) - return kDoodleTopMarginIPhonePortrait; - return kDoodleTopMarginIPhoneLandscape; + return kDoodleTopMarginIPhone; } CGFloat searchFieldTopMargin() { - if (IsIPadIdiom()) { + if (IsIPadIdiom()) return kDoodleTopMarginIPad; - } else if (IsPortrait()) { - return kSearchFieldTopMarginIPhonePortrait; - } else { - return kSearchFieldTopMarginIPhoneLandscape; - } + return kSearchFieldTopMarginIPhone; } CGFloat searchFieldWidth(CGFloat superviewWidth) {
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm index f31738e4..a46a48d 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm
@@ -99,7 +99,7 @@ // Test. EXPECT_EQ(120, heightLogo); EXPECT_EQ(60, heightNoLogo); - EXPECT_EQ(66, topMargin); + EXPECT_EQ(56, topMargin); } TEST_F(ContentSuggestionsCollectionUtilsTest, doodleFrameIPhoneLandscape) { @@ -148,7 +148,7 @@ CGFloat topMargin = searchFieldTopMargin(); // Test. - EXPECT_EQ(32, topMargin); + EXPECT_EQ(16, topMargin); EXPECT_EQ(width - 2 * margin, resultWidth); } @@ -182,8 +182,8 @@ SetAsIPhone(); // Action, tests. - EXPECT_EQ(284, heightForLogoHeader(YES, YES)); - EXPECT_EQ(284, heightForLogoHeader(YES, NO)); + EXPECT_EQ(258, heightForLogoHeader(YES, YES)); + EXPECT_EQ(258, heightForLogoHeader(YES, NO)); } TEST_F(ContentSuggestionsCollectionUtilsTest, SizeIPhone6) {
diff --git a/ios/chrome/browser/ui/ntp/google_landing_consumer.h b/ios/chrome/browser/ui/ntp/google_landing_consumer.h index 311f8c09..87768db 100644 --- a/ios/chrome/browser/ui/ntp/google_landing_consumer.h +++ b/ios/chrome/browser/ui/ntp/google_landing_consumer.h
@@ -21,9 +21,6 @@ // Exposes view and methods to drive the doodle. - (void)setLogoVendor:(id<LogoVendor>)logoVendor; -// |YES| if this consumer is incognito. -- (void)setIsOffTheRecord:(BOOL)isOffTheRecord; - // |YES| if this consumer is has voice search enabled. - (void)setVoiceSearchIsEnabled:(BOOL)voiceSearchIsEnabled;
diff --git a/ios/chrome/browser/ui/ntp/google_landing_mediator.mm b/ios/chrome/browser/ui/ntp/google_landing_mediator.mm index 46028db3..72227e7 100644 --- a/ios/chrome/browser/ui/ntp/google_landing_mediator.mm +++ b/ios/chrome/browser/ui/ntp/google_landing_mediator.mm
@@ -171,7 +171,6 @@ } - (void)setUp { - [_consumer setIsOffTheRecord:_browserState->IsOffTheRecord()]; [_consumer setVoiceSearchIsEnabled:ios::GetChromeBrowserProvider() ->GetVoiceSearchProvider() ->IsVoiceSearchEnabled()];
diff --git a/ios/chrome/browser/ui/ntp/google_landing_view_controller.mm b/ios/chrome/browser/ui/ntp/google_landing_view_controller.mm index 447643f..8d476fb 100644 --- a/ios/chrome/browser/ui/ntp/google_landing_view_controller.mm +++ b/ios/chrome/browser/ui/ntp/google_landing_view_controller.mm
@@ -54,44 +54,6 @@ } // namespace -@interface GoogleLandingViewController (UsedByGoogleLandingView) -// Update frames for subviews depending on the interface orientation. -- (void)updateSubviewFrames; -// Resets the collection view's inset to 0. -- (void)resetSectionInset; -- (void)reloadData; -@end - -// Subclassing the main UIScrollView allows calls for setFrame. -@interface GoogleLandingView : UIView { - GoogleLandingViewController* _googleLanding; -} - -- (void)setFrameDelegate:(GoogleLandingViewController*)delegate; - -@end - -@implementation GoogleLandingView - -- (void)setFrameDelegate:(GoogleLandingViewController*)delegate { - _googleLanding = delegate; -} - -- (void)setFrame:(CGRect)frame { - // On iPad and in fullscreen, the collection view's inset is very large. - // When Chrome enters slide over mode, the previously set inset is larger than - // the newly set collection view's width, which makes the collection view - // throw an exception. - // To prevent this from happening, we reset the inset to 0 before changing the - // frame. - [_googleLanding resetSectionInset]; - [super setFrame:frame]; - [_googleLanding updateSubviewFrames]; - [_googleLanding reloadData]; -} - -@end - @interface GoogleLandingViewController ()<OverscrollActionsControllerDelegate, UICollectionViewDataSource, UICollectionViewDelegate, @@ -146,26 +108,18 @@ base::scoped_nsobject<NSLayoutConstraint> _searchFieldWidthConstraint; base::scoped_nsobject<NSLayoutConstraint> _searchFieldHeightConstraint; base::scoped_nsobject<NSLayoutConstraint> _searchFieldTopMarginConstraint; - base::scoped_nsobject<NSMutableArray> _supplementaryViews; base::scoped_nsobject<NewTabPageHeaderView> _headerView; base::scoped_nsobject<WhatsNewHeaderView> _promoHeaderView; base::WeakNSProtocol<id<GoogleLandingDataSource>> _dataSource; base::WeakNSProtocol<id<UrlLoader, OmniboxFocuser>> _dispatcher; } -// Redeclare the |view| property to be the GoogleLandingView subclass instead of -// a generic UIView. -@property(nonatomic, readwrite, strong) GoogleLandingView* view; - // Whether the Google logo or doodle is being shown. @property(nonatomic, assign) BOOL logoIsShowing; // Exposes view and methods to drive the doodle. @property(nonatomic, assign) id<LogoVendor> logoVendor; -// |YES| if this consumer is incognito. -@property(nonatomic, assign) BOOL isOffTheRecord; - // |YES| if this consumer is has voice search enabled. @property(nonatomic, assign) BOOL voiceSearchIsEnabled; @@ -193,6 +147,9 @@ // pushed into the header view. @property(nonatomic, assign) BOOL canGoBack; +// Left margin to center the items. Used for the inset. +@property(nonatomic, assign) CGFloat leftMargin; + // Returns the height to use for the What's New promo view. - (CGFloat)promoHeaderHeight; // Add fake search field and voice search microphone. @@ -217,8 +174,6 @@ // If Google is not the default search engine, hide the logo, doodle and // fakebox. - (void)updateLogoAndFakeboxDisplay; -// Helper method to set UICollectionViewFlowLayout insets for most visited. -- (void)setFlowLayoutInset:(UICollectionViewFlowLayout*)layout; // Instructs the UICollectionView and UIView to reload it's data and layout. - (void)reloadData; // Adds the constraints for the |logoView|, the |searchField| related to the @@ -226,6 +181,8 @@ - (void)addConstraintsForLogoView:(UIView*)logoView searchField:(UIView*)searchField andHeaderView:(UIView*)headerView; +// Updates the constraints of the headers to fit |width|. +- (void)updateConstraintsForWidth:(CGFloat)width; // Returns the size of |self.mostVisitedData|. - (NSUInteger)numberOfItems; // Returns the number of non empty tiles (as opposed to the placeholder tiles). @@ -244,11 +201,9 @@ @implementation GoogleLandingViewController -@dynamic view; @synthesize logoVendor = _logoVendor; // Property declared in NewTabPagePanelProtocol. @synthesize delegate = _delegate; -@synthesize isOffTheRecord = _isOffTheRecord; @synthesize logoIsShowing = _logoIsShowing; @synthesize promoText = _promoText; @synthesize promoIcon = _promoIcon; @@ -258,17 +213,12 @@ @synthesize canGoForward = _canGoForward; @synthesize canGoBack = _canGoBack; @synthesize voiceSearchIsEnabled = _voiceSearchIsEnabled; - -- (void)loadView { - self.view = [[[GoogleLandingView alloc] - initWithFrame:[UIScreen mainScreen].bounds] autorelease]; -} +@synthesize leftMargin = _leftMargin; - (void)viewDidLoad { [super viewDidLoad]; [self.view setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth]; - [self.view setFrameDelegate:self]; // Initialise |shiftTilesDownStartTime| to a sentinel value to indicate that // the animation has not yet started. @@ -287,14 +237,15 @@ action:@selector(blurOmnibox)]); [_swipeGestureRecognizer setDirection:UISwipeGestureRecognizerDirectionDown]; + self.leftMargin = + content_suggestions::centeredTilesMarginForWidth([self viewWidth]); + [self addSearchField]; [self addMostVisited]; [self addOverscrollActions]; [self reload]; -} - -- (void)viewDidLayoutSubviews { - [self updateSubviewFrames]; + _viewLoaded = YES; + [self.logoVendor fetchDoodle]; } - (void)viewWillTransitionToSize:(CGSize)size @@ -302,6 +253,12 @@ (id<UIViewControllerTransitionCoordinator>)coordinator { [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; + self.leftMargin = + content_suggestions::centeredTilesMarginForWidth(size.width); + + // Reload the data to have the right number of items for the new orientation. + [self reloadData]; + void (^alongsideBlock)(id<UIViewControllerTransitionCoordinatorContext>) = ^( id<UIViewControllerTransitionCoordinatorContext> context) { if (IsIPadIdiom() && _scrolledToTop) { @@ -310,27 +267,32 @@ return; }; - // Invalidate the layout so that the collection view's header size is reset - // for the new orientation. - if (!_scrolledToTop) { - [[_mostVisitedView collectionViewLayout] invalidateLayout]; - } - // Call -scrollViewDidScroll: so that the omnibox's frame is adjusted for // the scroll view's offset. [self scrollViewDidScroll:_mostVisitedView]; // Updates the constraints. - [_searchFieldWidthConstraint - setConstant:content_suggestions::searchFieldWidth(size.width)]; - [_searchFieldTopMarginConstraint - setConstant:content_suggestions::searchFieldTopMargin()]; - [_doodleTopMarginConstraint - setConstant:content_suggestions::doodleTopMargin()]; + [self updateConstraintsForWidth:size.width]; + BOOL isScrollableNTP = !IsIPadIdiom() || IsCompactTablet(); + if (isScrollableNTP && _scrolledToTop) { + // Set the scroll view's offset to the pinned offset to keep the omnibox + // at the top of the screen if it isn't already. + CGFloat pinnedOffsetY = [self pinnedOffsetY]; + if ([_mostVisitedView contentOffset].y < pinnedOffsetY) { + [_mostVisitedView setContentOffset:CGPointMake(0, pinnedOffsetY)]; + } else { + [self updateSearchField]; + } + } + }; [coordinator animateAlongsideTransition:alongsideBlock completion:nil]; } +- (void)viewDidLayoutSubviews { + [self updateConstraintsForWidth:[self viewWidth]]; +} + - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [_mostVisitedView setDelegate:nil]; @@ -404,7 +366,6 @@ if (self.logoVendor.showingLogo != self.logoIsShowing) { self.logoVendor.showingLogo = self.logoIsShowing; if (_viewLoaded) { - [self updateSubviewFrames]; [_doodleHeightConstraint setConstant:content_suggestions::doodleHeight(self.logoIsShowing)]; @@ -503,64 +464,6 @@ [sender chromeExecuteCommand:command]; } -- (void)setFlowLayoutInset:(UICollectionViewFlowLayout*)layout { - CGFloat leftMargin = - content_suggestions::centeredTilesMarginForWidth([self viewWidth]); - [layout setSectionInset:UIEdgeInsetsMake(0, leftMargin, 0, leftMargin)]; -} - -- (void)resetSectionInset { - UICollectionViewFlowLayout* flowLayout = - (UICollectionViewFlowLayout*)[_mostVisitedView collectionViewLayout]; - [flowLayout setSectionInset:UIEdgeInsetsZero]; -} - -- (void)updateSubviewFrames { - _mostVisitedCellSize = [self mostVisitedCellSize]; - UICollectionViewFlowLayout* flowLayout = - base::mac::ObjCCastStrict<UICollectionViewFlowLayout>( - [_mostVisitedView collectionViewLayout]); - [flowLayout setItemSize:_mostVisitedCellSize]; - - [self setFlowLayoutInset:flowLayout]; - [flowLayout invalidateLayout]; - [_promoHeaderView - setSideMargin:content_suggestions::centeredTilesMarginForWidth( - [self viewWidth])]; - - // On the iPhone 6 Plus, if the app is started in landscape after a fresh - // install, the UICollectionViewLayout incorrectly sizes the widths of the - // supplementary views to the portrait width. Correct that here to ensure - // that the header is property laid out to the UICollectionView's width. - // crbug.com/491131 - CGFloat collectionViewWidth = CGRectGetWidth([_mostVisitedView bounds]); - CGFloat collectionViewMinX = CGRectGetMinX([_mostVisitedView bounds]); - for (UIView* supplementaryView in _supplementaryViews.get()) { - CGRect supplementaryViewFrame = supplementaryView.frame; - supplementaryViewFrame.origin.x = collectionViewMinX; - supplementaryViewFrame.size.width = collectionViewWidth; - supplementaryView.frame = supplementaryViewFrame; - } - - BOOL isScrollableNTP = !IsIPadIdiom() || IsCompactTablet(); - if (isScrollableNTP && _scrolledToTop) { - // Set the scroll view's offset to the pinned offset to keep the omnibox - // at the top of the screen if it isn't already. - CGFloat pinnedOffsetY = [self pinnedOffsetY]; - if ([_mostVisitedView contentOffset].y < pinnedOffsetY) { - [_mostVisitedView setContentOffset:CGPointMake(0, pinnedOffsetY)]; - } else { - [self updateSearchField]; - } - } - - if (!_viewLoaded) { - _viewLoaded = YES; - [self.logoVendor fetchDoodle]; - } - [self.delegate updateNtpBarShadowForPanelController:self]; -} - // Initialize and add a panel with most visited sites. - (void)addMostVisited { CGRect mostVisitedFrame = [self.view bounds]; @@ -588,10 +491,7 @@ [_mostVisitedView setBounces:YES]; [_mostVisitedView setShowsHorizontalScrollIndicator:NO]; [_mostVisitedView setShowsVerticalScrollIndicator:NO]; - [_mostVisitedView registerClass:[WhatsNewHeaderView class] - forSupplementaryViewOfKind:UICollectionElementKindSectionHeader - withReuseIdentifier:@"whatsNew"]; - [_mostVisitedView registerClass:[NewTabPageHeaderView class] + [_mostVisitedView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"header"]; [_mostVisitedView setAccessibilityIdentifier:@"Google Landing"]; @@ -796,6 +696,18 @@ ]]; } +- (void)updateConstraintsForWidth:(CGFloat)width { + [_promoHeaderView + setSideMargin:content_suggestions::centeredTilesMarginForWidth(width) + forWidth:width]; + [_doodleTopMarginConstraint + setConstant:content_suggestions::doodleTopMargin()]; + [_searchFieldWidthConstraint + setConstant:content_suggestions::searchFieldWidth(width)]; + [_searchFieldTopMarginConstraint + setConstant:content_suggestions::searchFieldTopMargin()]; +} + #pragma mark - ToolbarOwner - (ToolbarController*)relinquishedToolbarController { @@ -808,6 +720,12 @@ #pragma mark - UICollectionView Methods. +- (UIEdgeInsets)collectionView:(UICollectionView*)collectionView + layout:(UICollectionViewLayout*)collectionViewLayout + insetForSectionAtIndex:(NSInteger)section { + return UIEdgeInsetsMake(0, self.leftMargin, 0, self.leftMargin); +} + - (CGSize)collectionView:(UICollectionView*)collectionView layout: (UICollectionViewLayout*)collectionViewLayout @@ -870,16 +788,14 @@ atIndexPath:(NSIndexPath*)indexPath { DCHECK(kind == UICollectionElementKindSectionHeader); - if (!_supplementaryViews) - _supplementaryViews.reset([[NSMutableArray alloc] init]); - if (indexPath.section == SectionWithOmnibox) { + UICollectionReusableView* reusableView = + [collectionView dequeueReusableSupplementaryViewOfKind: + UICollectionElementKindSectionHeader + withReuseIdentifier:@"header" + forIndexPath:indexPath]; if (!_headerView) { - _headerView.reset([[collectionView - dequeueReusableSupplementaryViewOfKind: - UICollectionElementKindSectionHeader - withReuseIdentifier:@"header" - forIndexPath:indexPath] retain]); + _headerView.reset([[NewTabPageHeaderView alloc] init]); [_headerView addSubview:[self.logoVendor view]]; [_headerView addSubview:_searchTapTarget]; self.logoVendor.view.translatesAutoresizingMaskIntoConstraints = NO; @@ -900,30 +816,36 @@ [_headerView setCanGoForward:self.canGoForward]; [_headerView setCanGoBack:self.canGoBack]; } - [_supplementaryViews addObject:_headerView]; + [_headerView setTranslatesAutoresizingMaskIntoConstraints:NO]; } - return _headerView; + [reusableView addSubview:_headerView]; + AddSameConstraints(reusableView, _headerView); + + return reusableView; } if (indexPath.section == SectionWithMostVisited) { + UICollectionReusableView* reusableView = + [collectionView dequeueReusableSupplementaryViewOfKind: + UICollectionElementKindSectionHeader + withReuseIdentifier:@"header" + forIndexPath:indexPath]; if (!_promoHeaderView) { - _promoHeaderView.reset([[collectionView - dequeueReusableSupplementaryViewOfKind: - UICollectionElementKindSectionHeader - withReuseIdentifier:@"whatsNew" - forIndexPath:indexPath] retain]); + _promoHeaderView.reset([[WhatsNewHeaderView alloc] init]); [_promoHeaderView setSideMargin:content_suggestions::centeredTilesMarginForWidth( - [self viewWidth])]; + [self viewWidth]) + forWidth:[self viewWidth]]; [_promoHeaderView setDelegate:self]; if (self.promoCanShow) { [_promoHeaderView setText:self.promoText]; [_promoHeaderView setIcon:self.promoIcon]; [self.dataSource promoViewed]; } - [_supplementaryViews addObject:_promoHeaderView]; } - return _promoHeaderView; + [reusableView addSubview:_promoHeaderView]; + AddSameConstraints(reusableView, _promoHeaderView); + return reusableView; } NOTREACHED(); @@ -1040,27 +962,25 @@ IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB) action:action]; - if (!self.isOffTheRecord) { - // Open in Incognito Tab. - action = ^{ - base::scoped_nsobject<GoogleLandingViewController> strongSelf( - [weakSelf retain]); - if (!strongSelf) - return; - MostVisitedCell* cell = (MostVisitedCell*)sender.view; - [[strongSelf dataSource] logMostVisitedClick:index - tileType:cell.tileType]; - [[strongSelf dispatcher] webPageOrderedOpen:url - referrer:web::Referrer() - inIncognito:YES - inBackground:NO - appendTo:kCurrentTab]; - }; - [_contextMenuCoordinator - addItemWithTitle:l10n_util::GetNSStringWithFixup( - IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB) - action:action]; - } + // Open in Incognito Tab. + action = ^{ + base::scoped_nsobject<GoogleLandingViewController> strongSelf( + [weakSelf retain]); + if (!strongSelf) + return; + MostVisitedCell* cell = (MostVisitedCell*)sender.view; + [[strongSelf dataSource] logMostVisitedClick:index + tileType:cell.tileType]; + [[strongSelf dispatcher] webPageOrderedOpen:url + referrer:web::Referrer() + inIncognito:YES + inBackground:NO + appendTo:kCurrentTab]; + }; + [_contextMenuCoordinator + addItemWithTitle:l10n_util::GetNSStringWithFixup( + IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB) + action:action]; // Remove the most visited url. NSString* title = @@ -1120,7 +1040,8 @@ // Returns the Y value to use for the scroll view's contentOffset when scrolling // the omnibox to the top of the screen. - (CGFloat)pinnedOffsetY { - CGFloat headerHeight = [_headerView frame].size.height; + CGFloat headerHeight = content_suggestions::heightForLogoHeader( + self.logoIsShowing, self.promoCanShow); CGFloat offsetY = headerHeight - ntp_header::kScrolledToTopOmniboxBottomMargin; if (!IsIPadIdiom()) @@ -1143,6 +1064,9 @@ - (void)wasShown { _isShowing = YES; [_headerView hideToolbarViewsForNewTabPage]; + // The view is not loaded with the width it is displayed with. Reloading the + // data after being displayed ensure that we got the right number of items. + [self reloadData]; } - (void)wasHidden {
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm b/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm index a81ec0d06..945cc38 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm
@@ -80,7 +80,6 @@ toolbarView.frame = toolbarFrame; [toolbarView setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; - [self setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; [self addSubview:[_toolbarController view]]; }
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.mm b/ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.mm index ef9a0fd..deeb6f8 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.mm
@@ -30,10 +30,9 @@ const CGFloat kButtonYOffset = 4.0; const CGFloat kBackButtonLeading = 0; const CGFloat kForwardButtonLeading = 48; -const CGFloat kOmniboxFocuserLeading = 96; const CGSize kBackButtonSize = {48, 48}; const CGSize kForwardButtonSize = {48, 48}; -const CGSize kOmniboxFocuserSize = {128, 48}; +const CGFloat kOmniboxFocuserTrailing = 96; enum { NTPToolbarButtonNameBack = NumberOfToolbarButtonNames, @@ -85,19 +84,27 @@ [_forwardButton setAutoresizingMask:UIViewAutoresizingFlexibleTrailingMargin() | UIViewAutoresizingFlexibleBottomMargin]; - LayoutRect omniboxFocuserLayout = - LayoutRectMake(kOmniboxFocuserLeading, boundingWidth, kButtonYOffset, - kOmniboxFocuserSize.width, kOmniboxFocuserSize.height); - _omniboxFocuser = [[UIButton alloc] - initWithFrame:LayoutRectGetRect(omniboxFocuserLayout)]; + _omniboxFocuser = [[UIButton alloc] init]; [_omniboxFocuser setAccessibilityLabel:l10n_util::GetNSString(IDS_ACCNAME_LOCATION)]; - [_omniboxFocuser setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; + _omniboxFocuser.translatesAutoresizingMaskIntoConstraints = NO; [self.view addSubview:_backButton]; [self.view addSubview:_forwardButton]; [self.view addSubview:_omniboxFocuser]; + [NSLayoutConstraint activateConstraints:@[ + [_omniboxFocuser.leadingAnchor + constraintEqualToAnchor:_forwardButton.trailingAnchor], + [_omniboxFocuser.trailingAnchor + constraintEqualToAnchor:self.view.trailingAnchor + constant:-kOmniboxFocuserTrailing], + [_omniboxFocuser.topAnchor + constraintEqualToAnchor:_forwardButton.topAnchor], + [_omniboxFocuser.bottomAnchor + constraintEqualToAnchor:_forwardButton.bottomAnchor] + ]]; + [_backButton setImageEdgeInsets:UIEdgeInsetsMakeDirected(0, 0, 0, -10)]; [_forwardButton setImageEdgeInsets:UIEdgeInsetsMakeDirected(0, -7, 0, 0)];
diff --git a/ios/chrome/browser/ui/ntp/whats_new_header_view.h b/ios/chrome/browser/ui/ntp/whats_new_header_view.h index ac306164..b87a138 100644 --- a/ios/chrome/browser/ui/ntp/whats_new_header_view.h +++ b/ios/chrome/browser/ui/ntp/whats_new_header_view.h
@@ -27,7 +27,7 @@ - (void)setIcon:(WhatsNewIcon)icon; // Sets the value to use for the left and right margin. -- (void)setSideMargin:(CGFloat)sideMargin; +- (void)setSideMargin:(CGFloat)sideMargin forWidth:(CGFloat)width; // Returns the minimum height required for WhatsNewHeaderView to fit in |width|, // for a given |text|.
diff --git a/ios/chrome/browser/ui/ntp/whats_new_header_view.mm b/ios/chrome/browser/ui/ntp/whats_new_header_view.mm index c4a7aef6..43c43f9 100644 --- a/ios/chrome/browser/ui/ntp/whats_new_header_view.mm +++ b/ios/chrome/browser/ui/ntp/whats_new_header_view.mm
@@ -131,11 +131,11 @@ [_infoIconImageView setImage:image]; } -- (void)setSideMargin:(CGFloat)sideMargin { +- (void)setSideMargin:(CGFloat)sideMargin forWidth:(CGFloat)width { _sideMargin = sideMargin; [self setNeedsUpdateConstraints]; CGFloat maxLabelWidth = - self.frame.size.width - 2 * sideMargin - kInfoIconSize - kLabelLeftMargin; + width - 2 * sideMargin - kInfoIconSize - kLabelLeftMargin; [_promoLabel.get() setPreferredMaxLayoutWidth:maxLabelWidth]; }
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h index ea1f8329..564c329e 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h +++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h
@@ -19,13 +19,6 @@ // that allows the delegate to handle the copy. - (BOOL)onCopy; -// Called when the OmniboxTextField performs a 'Copy URL' operation. -- (BOOL)onCopyURL; - -// Returns true if the 'Copy URL' operation can performed (i.e. the text in the -// omnibox still reflects the current navigation entry). -- (BOOL)canCopyURL; - // Called before the OmniboxTextField performs a paste operation. - (void)willPaste;
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm index f8d793a..2be9472a 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.mm
@@ -99,10 +99,6 @@ UIFont* _font; UIColor* _displayedTextColor; UIColor* _displayedTintColor; - - // The 'Copy URL' menu item is sometimes shown in the edit menu, so keep it - // around to make adding/removing easier. - UIMenuItem* _copyUrlMenuItem; } @synthesize leftViewImageId = _leftViewImageId; @@ -931,51 +927,7 @@ return NSMakeRange(start, length); } -- (BOOL)becomeFirstResponder { - if (![super becomeFirstResponder]) - return NO; - - if (!_copyUrlMenuItem) { - NSString* const kTitle = l10n_util::GetNSString(IDS_IOS_COPY_URL); - _copyUrlMenuItem = - [[UIMenuItem alloc] initWithTitle:kTitle action:@selector(copyUrl:)]; - } - - // Add the "Copy URL" menu item to the |sharedMenuController| if necessary. - UIMenuController* menuController = [UIMenuController sharedMenuController]; - if (menuController.menuItems) { - if (![menuController.menuItems containsObject:_copyUrlMenuItem]) { - menuController.menuItems = - [menuController.menuItems arrayByAddingObject:_copyUrlMenuItem]; - } - } else { - menuController.menuItems = [NSArray arrayWithObject:_copyUrlMenuItem]; - } - return YES; -} - -- (BOOL)resignFirstResponder { - if (![super resignFirstResponder]) - return NO; - - // Remove the "Copy URL" menu item from the |sharedMenuController|. - UIMenuController* menuController = [UIMenuController sharedMenuController]; - NSMutableArray* menuItems = - [NSMutableArray arrayWithArray:menuController.menuItems]; - [menuItems removeObject:_copyUrlMenuItem]; - menuController.menuItems = menuItems; - return YES; -} - -- (void)copyUrl:(id)sender { - [[self delegate] onCopyURL]; -} - - (BOOL)canPerformAction:(SEL)action withSender:(id)sender { - if (action == @selector(copyUrl:)) { - return [[self delegate] canCopyURL]; - } - // Disable the "Define" menu item. iOS7 implements this with a private // selector. Avoid using private APIs by instead doing a string comparison. if ([NSStringFromSelector(action) hasSuffix:@"define:"]) {
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios_unittest.mm b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios_unittest.mm index 6d2beb9..76a939ea 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios_unittest.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_text_field_ios_unittest.mm
@@ -40,16 +40,6 @@ void TearDown() override { [textfield_ removeFromSuperview]; } - BOOL IsCopyUrlInMenu() { - UIMenuController* menuController = [UIMenuController sharedMenuController]; - NSString* const kTitle = l10n_util::GetNSString(IDS_IOS_COPY_URL); - for (UIMenuItem* item in menuController.menuItems) { - if ([item.title isEqual:kTitle]) - return YES; - } - return NO; - }; - void ExpectRectEqual(CGRect expectedRect, CGRect actualRect) { EXPECT_EQ(expectedRect.origin.x, actualRect.origin.x); EXPECT_EQ(expectedRect.origin.y, actualRect.origin.y); @@ -122,36 +112,6 @@ OmniboxTextFieldIOS* textfield_; }; -TEST_F(OmniboxTextFieldIOSTest, BecomeFirstResponderAddsCopyURLMenuItem) { - // The 'Copy URL' menu item should not be present before this test runs. - EXPECT_FALSE(IsCopyUrlInMenu()); - - // Call |becomeFirstResponder| and verify the Copy URL menu item was added. - UIMenuController* menuController = [UIMenuController sharedMenuController]; - NSUInteger expectedItems = [menuController.menuItems count] + 1; - [textfield_ becomeFirstResponder]; - EXPECT_EQ(expectedItems, [menuController.menuItems count]); - EXPECT_TRUE(IsCopyUrlInMenu()); - - // Call |becomeFirstResponder| again and verify the Copy URL menu item is not - // added again. - [textfield_ becomeFirstResponder]; - EXPECT_EQ(expectedItems, [menuController.menuItems count]); - EXPECT_TRUE(IsCopyUrlInMenu()); -} - -TEST_F(OmniboxTextFieldIOSTest, ResignFirstResponderRemovesCopyURLMenuItem) { - // Call |becomeFirstResponder| to add the 'Copy URL' menu item so this test - // can remove it. - [textfield_ becomeFirstResponder]; - - UIMenuController* menuController = [UIMenuController sharedMenuController]; - NSUInteger expectedItems = [menuController.menuItems count] - 1; - [textfield_ resignFirstResponder]; - EXPECT_EQ(expectedItems, [menuController.menuItems count]); - EXPECT_FALSE(IsCopyUrlInMenu()); -} - TEST_F(OmniboxTextFieldIOSTest, enterPreEditState_preEditTextAlignment_short) { [textfield_ setText:@"s"]; [textfield_ becomeFirstResponder];
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h index 69c2c48d..8e75d66 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h +++ b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h
@@ -94,8 +94,6 @@ void OnAccept(); void OnClear(); bool OnCopy(); - bool OnCopyURL(); - bool CanCopyURL(); void WillPaste(); void OnDeleteBackward();
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm index 44aaead..3114bc7d 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm
@@ -148,14 +148,6 @@ return editView_->OnCopy(); } -- (BOOL)onCopyURL { - return editView_->OnCopyURL(); -} - -- (BOOL)canCopyURL { - return editView_->CanCopyURL(); -} - - (void)willPaste { editView_->WillPaste(); } @@ -590,12 +582,8 @@ GURL url; bool write_url = false; - // Don't adjust the text (e.g. add http://) if the omnibox is currently - // showing non-URL text (e.g. search terms instead of the URL). - if (!CanCopyURL()) { - model()->AdjustTextForCopy(start_location, is_select_all, &text, &url, - &write_url); - } + model()->AdjustTextForCopy(start_location, is_select_all, &text, &url, + &write_url); // Create the pasteboard item manually because the pasteboard expects a single // item with multiple representations. This is expressed as a single @@ -611,23 +599,6 @@ return true; } -bool OmniboxViewIOS::OnCopyURL() { - // Create the pasteboard item manually because the pasteboard expects a single - // item with multiple representations. This is expressed as a single - // NSDictionary with multiple keys, one for each representation. - GURL url = controller_->GetToolbarModel()->GetURL(); - NSDictionary* item = @{ - (NSString*)kUTTypePlainText : base::SysUTF8ToNSString(url.spec()), - (NSString*)kUTTypeURL : net::NSURLWithGURL(url) - }; - [UIPasteboard generalPasteboard].items = [NSArray arrayWithObject:item]; - return true; -} - -bool OmniboxViewIOS::CanCopyURL() { - return false; -} - void OmniboxViewIOS::WillPaste() { model()->OnPaste(); }
diff --git a/ios/chrome/browser/ui/settings/accounts_collection_view_controller.mm b/ios/chrome/browser/ui/settings/accounts_collection_view_controller.mm index 0e38ee80..ea44570f 100644 --- a/ios/chrome/browser/ui/settings/accounts_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/accounts_collection_view_controller.mm
@@ -447,7 +447,7 @@ UINavigationController* settingsDetails = ios::GetChromeBrowserProvider() ->GetChromeIdentityService() - ->NewWebAndAppSettingDetails( + ->CreateWebAndAppSettingDetailsController( [self authService]->GetAuthenticatedIdentity(), self); UIImage* closeIcon = [ChromeIcon closeIcon]; SEL action = @selector(closeGoogleActivitySettings:); @@ -509,9 +509,10 @@ - (void)showAccountDetails:(ChromeIdentity*)identity { if ([_alertCoordinator isVisible]) return; - UIViewController* accountDetails = ios::GetChromeBrowserProvider() - ->GetChromeIdentityService() - ->NewAccountDetails(identity, self); + UIViewController* accountDetails = + ios::GetChromeBrowserProvider() + ->GetChromeIdentityService() + ->CreateAccountDetailsController(identity, self); if (!accountDetails) { // Failed to create a new account details. Ignored. return;
diff --git a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h index faabe2f..7f9e7c90 100644 --- a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h +++ b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h
@@ -25,11 +25,10 @@ static FakeChromeIdentityService* GetInstanceFromChromeProvider(); // ChromeIdentityService implementation. - base::scoped_nsobject<UINavigationController> NewAccountDetails( + UINavigationController* CreateAccountDetailsController( ChromeIdentity* identity, id<ChromeIdentityBrowserOpener> browser_opener) override; - base::scoped_nsobject<ChromeIdentityInteractionManager> - NewChromeIdentityInteractionManager( + ChromeIdentityInteractionManager* CreateChromeIdentityInteractionManager( ios::ChromeBrowserState* browser_state, id<ChromeIdentityInteractionManagerDelegate> delegate) const override;
diff --git a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.mm b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.mm index d68a339..52d10a8 100644 --- a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.mm +++ b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.mm
@@ -142,25 +142,25 @@ ios::GetChromeBrowserProvider()->GetChromeIdentityService()); } -base::scoped_nsobject<UINavigationController> -FakeChromeIdentityService::NewAccountDetails( +UINavigationController* +FakeChromeIdentityService::CreateAccountDetailsController( ChromeIdentity* identity, id<ChromeIdentityBrowserOpener> browser_opener) { base::scoped_nsobject<UIViewController> accountDetailsViewController( [[FakeAccountDetailsViewController alloc] initWithIdentity:identity]); - base::scoped_nsobject<UINavigationController> navigationController( - [[UINavigationController alloc] - initWithRootViewController:accountDetailsViewController]); + UINavigationController* navigationController = + [[[UINavigationController alloc] + initWithRootViewController:accountDetailsViewController] autorelease]; return navigationController; } -base::scoped_nsobject<ChromeIdentityInteractionManager> -FakeChromeIdentityService::NewChromeIdentityInteractionManager( +ChromeIdentityInteractionManager* +FakeChromeIdentityService::CreateChromeIdentityInteractionManager( ios::ChromeBrowserState* browser_state, id<ChromeIdentityInteractionManagerDelegate> delegate) const { - base::scoped_nsobject<ChromeIdentityInteractionManager> manager( - [[FakeChromeIdentityInteractionManager alloc] init]); - manager.get().delegate = delegate; + ChromeIdentityInteractionManager* manager = + [[[FakeChromeIdentityInteractionManager alloc] init] autorelease]; + manager.delegate = delegate; return manager; }
diff --git a/media/audio/audio_input_controller.cc b/media/audio/audio_input_controller.cc index 996b937..e3d994f 100644 --- a/media/audio/audio_input_controller.cc +++ b/media/audio/audio_input_controller.cc
@@ -26,6 +26,7 @@ namespace { const int kMaxInputChannels = 3; +constexpr int kCheckMutedStateIntervalSeconds = 1; #if defined(AUDIO_POWER_MONITORING) // Time in seconds between two successive measurements of audio power levels. @@ -199,6 +200,7 @@ AudioInputController::~AudioInputController() { DCHECK(!audio_callback_); DCHECK(!stream_); + DCHECK(!check_muted_state_timer_.IsRunning()); } // static @@ -358,6 +360,14 @@ // Finally, keep the stream pointer around, update the state and notify. stream_ = stream_to_control; handler_->OnCreated(this); + + // Check the current muted state and start the repeating timer to keep that + // updated. + CheckMutedState(); + check_muted_state_timer_.Start( + FROM_HERE, base::TimeDelta::FromSeconds(kCheckMutedStateIntervalSeconds), + this, &AudioInputController::CheckMutedState); + DCHECK(check_muted_state_timer_.IsRunning()); } void AudioInputController::DoRecord() { @@ -387,9 +397,12 @@ if (!stream_) return; + check_muted_state_timer_.Stop(); + std::string log_string; static const char kLogStringPrefix[] = "AIC::DoClose:"; + // Allow calling unconditionally and bail if we don't have a stream to close. if (audio_callback_) { stream_->Stop(); @@ -665,6 +678,17 @@ #endif } +void AudioInputController::CheckMutedState() { + DCHECK(task_runner_->BelongsToCurrentThread()); + DCHECK(stream_); + const bool new_state = stream_->IsMuted(); + if (new_state != is_muted_) { + is_muted_ = new_state; + // We don't log OnMuted here, but leave that for AudioInputRendererHost. + handler_->OnMuted(this, is_muted_); + } +} + // static AudioInputController::StreamType AudioInputController::ParamsToStreamType( const AudioParameters& params) {
diff --git a/media/audio/audio_input_controller.h b/media/audio/audio_input_controller.h index 8b71705..b037996 100644 --- a/media/audio/audio_input_controller.h +++ b/media/audio/audio_input_controller.h
@@ -13,7 +13,9 @@ #include "base/files/file.h" #include "base/memory/weak_ptr.h" +#include "base/optional.h" #include "base/single_thread_task_runner.h" +#include "base/timer/timer.h" #include "media/audio/audio_debug_file_writer.h" #include "media/audio/audio_io.h" #include "media/audio/audio_manager_base.h" @@ -107,6 +109,11 @@ ErrorCode error_code) = 0; virtual void OnLog(AudioInputController* controller, const std::string& message) = 0; + // Initially, an AudioInputController is considered not muted. If the + // underlying stream is actually muted, an OnMuted callback will follow + // shortly after OnCreated. It is also called whenever the muted state of + // the underlying stream changes. + virtual void OnMuted(AudioInputController* controller, bool is_muted) = 0; protected: virtual ~EventHandler() {} @@ -323,6 +330,8 @@ float* average_power_dbfs, int* mic_volume_percent); + void CheckMutedState(); + static StreamType ParamsToStreamType(const AudioParameters& params); // Gives access to the task runner of the creating thread. @@ -367,6 +376,9 @@ // Time when the stream started recording. base::TimeTicks stream_create_time_; + bool is_muted_ = false; + base::RepeatingTimer check_muted_state_timer_; + #if BUILDFLAG(ENABLE_WEBRTC) // Used for audio debug recordings. Accessed on audio thread. AudioDebugRecordingHelper debug_recording_helper_;
diff --git a/media/audio/audio_input_controller_unittest.cc b/media/audio/audio_input_controller_unittest.cc index ad3b04ef..fc290e65 100644 --- a/media/audio/audio_input_controller_unittest.cc +++ b/media/audio/audio_input_controller_unittest.cc
@@ -14,6 +14,7 @@ #include "base/threading/thread.h" #include "media/audio/audio_device_description.h" #include "media/audio/audio_thread_impl.h" +#include "media/audio/fake_audio_input_stream.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -32,6 +33,10 @@ static const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO; static const int kSamplesPerPacket = kSampleRate / 10; +// AudioInputController will poll once every second, so wait at most a bit +// more than that for the callbacks. +static const int kOnMuteWaitTimeoutMs = 1500; + ACTION_P(QuitRunLoop, run_loop) { run_loop->QuitWhenIdle(); } @@ -62,6 +67,7 @@ MOCK_METHOD2(OnLog, void(AudioInputController* controller, const std::string& message)); + MOCK_METHOD2(OnMuted, void(AudioInputController* controller, bool is_muted)); private: DISALLOW_COPY_AND_ASSIGN(MockAudioInputControllerEventHandler); @@ -223,4 +229,84 @@ base::RunLoop().Run(); } +namespace { +void RunLoopWithTimeout(base::RunLoop* run_loop, base::TimeDelta timeout) { + base::OneShotTimer timeout_timer; + timeout_timer.Start(FROM_HERE, timeout, run_loop->QuitClosure()); + run_loop->Run(); +} +} + +// Test that AudioInputController sends OnMute callbacks properly. +TEST_F(AudioInputControllerTest, TestOnmutedCallbackInitiallyUnmuted) { + const auto timeout = base::TimeDelta::FromMilliseconds(kOnMuteWaitTimeoutMs); + MockAudioInputControllerEventHandler event_handler; + MockSyncWriter sync_writer; + scoped_refptr<AudioInputController> controller; + WaitableEvent callback_event(WaitableEvent::ResetPolicy::AUTOMATIC, + WaitableEvent::InitialState::NOT_SIGNALED); + + AudioParameters params(AudioParameters::AUDIO_FAKE, kChannelLayout, + kSampleRate, kBitsPerSample, kSamplesPerPacket); + + base::RunLoop unmute_run_loop; + base::RunLoop mute_run_loop; + base::RunLoop setup_run_loop; + EXPECT_CALL(event_handler, OnCreated(_)).Times(Exactly(1)); + EXPECT_CALL(event_handler, OnLog(_, _)).Times(Exactly(3)); + EXPECT_CALL(sync_writer, Close()).Times(Exactly(1)); + EXPECT_CALL(event_handler, OnMuted(_, true)) + .WillOnce(InvokeWithoutArgs([&] { mute_run_loop.Quit(); })); + EXPECT_CALL(event_handler, OnMuted(_, false)) + .WillOnce(InvokeWithoutArgs([&] { unmute_run_loop.Quit(); })); + + FakeAudioInputStream::SetGlobalMutedState(false); + controller = AudioInputController::Create( + audio_manager_.get(), &event_handler, &sync_writer, nullptr, params, + AudioDeviceDescription::kDefaultDeviceId, false); + ASSERT_TRUE(controller.get()); + setup_run_loop.RunUntilIdle(); + + FakeAudioInputStream::SetGlobalMutedState(true); + RunLoopWithTimeout(&mute_run_loop, timeout); + FakeAudioInputStream::SetGlobalMutedState(false); + RunLoopWithTimeout(&unmute_run_loop, timeout); + + CloseAudioController(controller.get()); +} + +TEST_F(AudioInputControllerTest, TestOnmutedCallbackInitiallyMuted) { + const auto timeout = base::TimeDelta::FromMilliseconds(kOnMuteWaitTimeoutMs); + MockAudioInputControllerEventHandler event_handler; + MockSyncWriter sync_writer; + scoped_refptr<AudioInputController> controller; + WaitableEvent callback_event(WaitableEvent::ResetPolicy::AUTOMATIC, + WaitableEvent::InitialState::NOT_SIGNALED); + + AudioParameters params(AudioParameters::AUDIO_FAKE, kChannelLayout, + kSampleRate, kBitsPerSample, kSamplesPerPacket); + + base::RunLoop unmute_run_loop; + base::RunLoop setup_run_loop; + EXPECT_CALL(event_handler, OnCreated(_)).Times(Exactly(1)); + EXPECT_CALL(event_handler, OnLog(_, _)).Times(Exactly(3)); + EXPECT_CALL(sync_writer, Close()).Times(Exactly(1)); + EXPECT_CALL(event_handler, OnMuted(_, true)) + .WillOnce(InvokeWithoutArgs([&] { setup_run_loop.QuitWhenIdle(); })); + EXPECT_CALL(event_handler, OnMuted(_, false)) + .WillOnce(InvokeWithoutArgs([&] { unmute_run_loop.Quit(); })); + + FakeAudioInputStream::SetGlobalMutedState(true); + controller = AudioInputController::Create( + audio_manager_.get(), &event_handler, &sync_writer, nullptr, params, + AudioDeviceDescription::kDefaultDeviceId, false); + ASSERT_TRUE(controller.get()); + RunLoopWithTimeout(&setup_run_loop, timeout); + + FakeAudioInputStream::SetGlobalMutedState(false); + RunLoopWithTimeout(&unmute_run_loop, timeout); + + CloseAudioController(controller.get()); +} + } // namespace media
diff --git a/media/audio/audio_input_device.cc b/media/audio/audio_input_device.cc index 6696638..eb31a57 100644 --- a/media/audio/audio_input_device.cc +++ b/media/audio/audio_input_device.cc
@@ -225,6 +225,14 @@ } } +void AudioInputDevice::OnMuted(bool is_muted) { + DCHECK(task_runner()->BelongsToCurrentThread()); + // Do nothing if the stream has been closed. + if (state_ < CREATING_STREAM) + return; + callback_->OnCaptureMuted(is_muted); +} + void AudioInputDevice::OnIPCClosed() { DCHECK(task_runner()->BelongsToCurrentThread()); state_ = IPC_CLOSED;
diff --git a/media/audio/audio_input_device.h b/media/audio/audio_input_device.h index 4aeb64e0..3072e2f 100644 --- a/media/audio/audio_input_device.h +++ b/media/audio/audio_input_device.h
@@ -106,6 +106,7 @@ int length, int total_segments) override; void OnError() override; + void OnMuted(bool is_muted) override; void OnIPCClosed() override; private:
diff --git a/media/audio/audio_input_device_unittest.cc b/media/audio/audio_input_device_unittest.cc index cad3331..1642ad0 100644 --- a/media/audio/audio_input_device_unittest.cc +++ b/media/audio/audio_input_device_unittest.cc
@@ -54,6 +54,7 @@ bool key_pressed)); MOCK_METHOD1(OnCaptureError, void(const std::string& message)); + MOCK_METHOD1(OnCaptureMuted, void(bool is_muted)); }; // Used to terminate a loop from a different thread than the loop belongs to.
diff --git a/media/audio/audio_input_ipc.h b/media/audio/audio_input_ipc.h index e69f33d..058d4d0 100644 --- a/media/audio/audio_input_ipc.h +++ b/media/audio/audio_input_ipc.h
@@ -35,6 +35,9 @@ // Called when state of an audio stream has changed. virtual void OnError() = 0; + // Called when an audio stream is muted or unmuted. + virtual void OnMuted(bool is_muted) = 0; + // Called when the AudioInputIPC object is going away and/or when the // IPC channel has been closed and no more IPC requests can be made. // Implementations should delete their owned AudioInputIPC instance
diff --git a/media/audio/fake_audio_input_stream.cc b/media/audio/fake_audio_input_stream.cc index 52d7218..188d05c 100644 --- a/media/audio/fake_audio_input_stream.cc +++ b/media/audio/fake_audio_input_stream.cc
@@ -4,6 +4,7 @@ #include "media/audio/fake_audio_input_stream.h" +#include "base/atomicops.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" @@ -19,6 +20,10 @@ namespace media { +namespace { +base::subtle::AtomicWord g_fake_input_streams_are_muted = 0; +} + AudioInputStream* FakeAudioInputStream::MakeFakeStream( AudioManagerBase* manager, const AudioParameters& params) { @@ -81,7 +86,7 @@ bool FakeAudioInputStream::IsMuted() { DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread()); - return false; + return base::subtle::NoBarrier_Load(&g_fake_input_streams_are_muted) != 0; } bool FakeAudioInputStream::SetAutomaticGainControl(bool enabled) { @@ -136,4 +141,9 @@ BeepingSource::BeepOnce(); } +void FakeAudioInputStream::SetGlobalMutedState(bool is_muted) { + base::subtle::NoBarrier_Store(&g_fake_input_streams_are_muted, + (is_muted ? 1 : 0)); +} + } // namespace media
diff --git a/media/audio/fake_audio_input_stream.h b/media/audio/fake_audio_input_stream.h index d9b186a..bafa7a1 100644 --- a/media/audio/fake_audio_input_stream.h +++ b/media/audio/fake_audio_input_stream.h
@@ -54,6 +54,10 @@ // input stream. static void BeepOnce(); + // Set the muted state for _all_ FakeAudioInputStreams. The value is global, + // so it can be set before any FakeAudioInputStreams have been created. + static void SetGlobalMutedState(bool is_muted); + private: FakeAudioInputStream(AudioManagerBase* manager, const AudioParameters& params);
diff --git a/media/base/audio_capturer_source.h b/media/base/audio_capturer_source.h index d355a1b0..6e34ddc 100644 --- a/media/base/audio_capturer_source.h +++ b/media/base/audio_capturer_source.h
@@ -41,6 +41,9 @@ // Signals an error has occurred. virtual void OnCaptureError(const std::string& message) = 0; + // Signals the muted state has changed. + virtual void OnCaptureMuted(bool is_muted) = 0; + protected: virtual ~CaptureCallback() {} };
diff --git a/pdf/pdfium/fuzzers/pdfium_fuzzer_helper.cc b/pdf/pdfium/fuzzers/pdfium_fuzzer_helper.cc index 9598caa..d15d621 100644 --- a/pdf/pdfium/fuzzers/pdfium_fuzzer_helper.cc +++ b/pdf/pdfium/fuzzers/pdfium_fuzzer_helper.cc
@@ -192,8 +192,8 @@ FORM_DoDocumentAAction(form.get(), FPDFDOC_AACTION_WC); } -bool PDFiumFuzzerHelper::RenderPage(const FPDF_DOCUMENT& doc, - const FPDF_FORMHANDLE& form, +bool PDFiumFuzzerHelper::RenderPage(FPDF_DOCUMENT doc, + FPDF_FORMHANDLE form, const int page_index) { std::unique_ptr<void, FPDFPageDeleter> page(FPDF_LoadPage(doc, page_index)); if (!page)
diff --git a/pdf/pdfium/fuzzers/pdfium_fuzzer_helper.h b/pdf/pdfium/fuzzers/pdfium_fuzzer_helper.h index 7c4f3a3..c46c7ff 100644 --- a/pdf/pdfium/fuzzers/pdfium_fuzzer_helper.h +++ b/pdf/pdfium/fuzzers/pdfium_fuzzer_helper.h
@@ -22,7 +22,7 @@ PDFiumFuzzerHelper(); private: - bool RenderPage(const FPDF_DOCUMENT& doc, - const FPDF_FORMHANDLE& form, + bool RenderPage(FPDF_DOCUMENT doc, + FPDF_FORMHANDLE form, const int page_index); };
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc index 28e80d0..385a55b 100644 --- a/pdf/pdfium/pdfium_engine.cc +++ b/pdf/pdfium/pdfium_engine.cc
@@ -1532,7 +1532,7 @@ return buffer; } -pp::Buffer_Dev PDFiumEngine::GetFlattenedPrintData(const FPDF_DOCUMENT& doc) { +pp::Buffer_Dev PDFiumEngine::GetFlattenedPrintData(FPDF_DOCUMENT doc) { pp::Buffer_Dev buffer; ScopedSubstFont scoped_subst_font(this); int page_count = FPDF_GetPageCount(doc); @@ -1608,7 +1608,7 @@ } void PDFiumEngine::FitContentsToPrintableAreaIfRequired( - const FPDF_DOCUMENT& doc, + FPDF_DOCUMENT doc, const PP_PrintSettings_Dev& print_settings) { // Check to see if we need to fit pdf contents to printer paper size. if (print_settings.print_scaling_option !=
diff --git a/pdf/pdfium/pdfium_engine.h b/pdf/pdfium/pdfium_engine.h index 6620c77..ca45b676 100644 --- a/pdf/pdfium/pdfium_engine.h +++ b/pdf/pdfium/pdfium_engine.h
@@ -312,9 +312,9 @@ uint32_t page_range_count, const PP_PrintSettings_Dev& print_settings); - pp::Buffer_Dev GetFlattenedPrintData(const FPDF_DOCUMENT& doc); + pp::Buffer_Dev GetFlattenedPrintData(FPDF_DOCUMENT doc); void FitContentsToPrintableAreaIfRequired( - const FPDF_DOCUMENT& doc, + FPDF_DOCUMENT doc, const PP_PrintSettings_Dev& print_settings); void SaveSelectedFormForPrint();
diff --git a/printing/printed_document.cc b/printing/printed_document.cc index dc4f0f1..319b479 100644 --- a/printing/printed_document.cc +++ b/printing/printed_document.cc
@@ -23,6 +23,8 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/task_scheduler/post_task.h" +#include "base/threading/thread_restrictions.h" #include "base/time/time.h" #include "base/values.h" #include "printing/page_number.h" @@ -42,6 +44,8 @@ void DebugDumpPageTask(const base::string16& doc_name, const PrintedPage* page) { + base::ThreadRestrictions::AssertIOAllowed(); + if (g_debug_dump_info.Get().empty()) return; @@ -62,6 +66,8 @@ void DebugDumpDataTask(const base::string16& doc_name, const base::FilePath::StringType& extension, const base::RefCountedMemory* data) { + base::ThreadRestrictions::AssertIOAllowed(); + base::FilePath path = PrintedDocument::CreateDebugDumpPath(doc_name, extension); if (path.empty()) @@ -72,8 +78,7 @@ } void DebugDumpSettings(const base::string16& doc_name, - const PrintSettings& settings, - base::TaskRunner* blocking_runner) { + const PrintSettings& settings) { base::DictionaryValue job_settings; PrintSettingsToJobSettingsDebug(settings, &job_settings); std::string settings_str; @@ -81,18 +86,18 @@ job_settings, base::JSONWriter::OPTIONS_PRETTY_PRINT, &settings_str); scoped_refptr<base::RefCountedMemory> data = base::RefCountedString::TakeString(&settings_str); - blocking_runner->PostTask(FROM_HERE, base::Bind(&DebugDumpDataTask, doc_name, - FILE_PATH_LITERAL(".json"), - base::RetainedRef(data))); + base::PostTaskWithTraits( + FROM_HERE, {base::TaskPriority::BACKGROUND, base::MayBlock()}, + base::BindOnce(&DebugDumpDataTask, doc_name, FILE_PATH_LITERAL(".json"), + base::RetainedRef(data))); } } // namespace PrintedDocument::PrintedDocument(const PrintSettings& settings, PrintedPagesSource* source, - int cookie, - base::TaskRunner* blocking_runner) - : mutable_(source), immutable_(settings, source, cookie, blocking_runner) { + int cookie) + : mutable_(source), immutable_(settings, source, cookie) { // Records the expected page count if a range is setup. if (!settings.ranges().empty()) { // If there is a range, set the number of page @@ -103,7 +108,7 @@ } if (!g_debug_dump_info.Get().empty()) - DebugDumpSettings(name(), settings, blocking_runner); + DebugDumpSettings(name(), settings); } PrintedDocument::~PrintedDocument() { @@ -134,9 +139,9 @@ } if (!g_debug_dump_info.Get().empty()) { - immutable_.blocking_runner_->PostTask( - FROM_HERE, - base::Bind(&DebugDumpPageTask, name(), base::RetainedRef(page))); + base::PostTaskWithTraits( + FROM_HERE, {base::TaskPriority::BACKGROUND, base::MayBlock()}, + base::BindOnce(&DebugDumpPageTask, name(), base::RetainedRef(page))); } } @@ -234,8 +239,9 @@ const base::FilePath::StringType& extension) { if (g_debug_dump_info.Get().empty()) return; - immutable_.blocking_runner_->PostTask( - FROM_HERE, base::Bind(&DebugDumpDataTask, name(), extension, data)); + base::PostTaskWithTraits( + FROM_HERE, {base::TaskPriority::BACKGROUND, base::MayBlock()}, + base::BindOnce(&DebugDumpDataTask, name(), extension, data)); } PrintedDocument::Mutable::Mutable(PrintedPagesSource* source) @@ -252,16 +258,10 @@ PrintedDocument::Immutable::Immutable(const PrintSettings& settings, PrintedPagesSource* source, - int cookie, - base::TaskRunner* blocking_runner) - : settings_(settings), - name_(source->RenderSourceName()), - cookie_(cookie), - blocking_runner_(blocking_runner) { -} + int cookie) + : settings_(settings), name_(source->RenderSourceName()), cookie_(cookie) {} -PrintedDocument::Immutable::~Immutable() { -} +PrintedDocument::Immutable::~Immutable() {} #if defined(OS_ANDROID) // This function is not used on android.
diff --git a/printing/printed_document.h b/printing/printed_document.h index 56c397f..77b1984 100644 --- a/printing/printed_document.h +++ b/printing/printed_document.h
@@ -18,7 +18,6 @@ namespace base { class RefCountedMemory; -class TaskRunner; } namespace printing { @@ -41,8 +40,7 @@ // originating source and settings. PrintedDocument(const PrintSettings& settings, PrintedPagesSource* source, - int cookie, - base::TaskRunner* blocking_runner); + int cookie); // Sets a page's data. 0-based. Takes metafile ownership. // Note: locks for a short amount of time. @@ -154,8 +152,7 @@ struct Immutable { Immutable(const PrintSettings& settings, PrintedPagesSource* source, - int cookie, - base::TaskRunner* blocking_runner); + int cookie); ~Immutable(); // Print settings used to generate this document. Immutable. @@ -171,9 +168,6 @@ // simpler hash of PrintSettings since a new document is made each time the // print settings change. int cookie_; - - // Native thread for blocking operations, like file access. - scoped_refptr<base::TaskRunner> blocking_runner_; }; // All writable data member access must be guarded by this lock. Needs to be
diff --git a/sandbox/win/src/sync_policy.cc b/sandbox/win/src/sync_policy.cc index 7ef094f..5dd8549f 100644 --- a/sandbox/win/src/sync_policy.cc +++ b/sandbox/win/src/sync_policy.cc
@@ -195,7 +195,7 @@ HANDLE local_handle = NULL; status = NtCreateEvent(&local_handle, EVENT_ALL_ACCESS, &object_attributes, static_cast<EVENT_TYPE>(event_type), - static_cast<BOOLEAN>(initial_state)); + static_cast<BOOLEAN>(initial_state != 0)); if (NULL == local_handle) return status;
diff --git a/services/ui/ws/window_server.cc b/services/ui/ws/window_server.cc index 907540b..f1b282c9 100644 --- a/services/ui/ws/window_server.cc +++ b/services/ui/ws/window_server.cc
@@ -79,6 +79,11 @@ for (auto& pair : tree_map_) pair.second->PrepareForWindowServerShutdown(); + // Shutdown GPU before destroying PlatformWindows for displays so that + // GLSurfaces corresponding to a windows AcceleratedWidget gets destroyed + // first. + gpu_host_.reset(); + // Destroys the window trees results in querying for the display. Tear down // the displays first so that the trees are notified of the display going // away while the display is still valid. @@ -559,8 +564,10 @@ } void WindowServer::OnDisplayDestroyed(Display* display) { - gpu_host_->OnAcceleratedWidgetDestroyed( - display->platform_display()->GetAcceleratedWidget()); + if (gpu_host_) { + gpu_host_->OnAcceleratedWidgetDestroyed( + display->platform_display()->GetAcceleratedWidget()); + } } void WindowServer::OnNoMoreDisplays() {
diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/root-scroller-apply-filter-to-parent-expected.html b/third_party/WebKit/LayoutTests/fast/scrolling/root-scroller-apply-filter-to-parent-expected.html index d97b9abc..57f52fe 100644 --- a/third_party/WebKit/LayoutTests/fast/scrolling/root-scroller-apply-filter-to-parent-expected.html +++ b/third_party/WebKit/LayoutTests/fast/scrolling/root-scroller-apply-filter-to-parent-expected.html
@@ -18,6 +18,7 @@ width: 100%; height: 100%; overflow: auto; + will-change: transform; background-image:linear-gradient(0deg, transparent 50%, #0a0 50%), linear-gradient(90deg, #a00 50%, #0a0 50%); background-size:75px 75px,75px 75px;
diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/root-scroller-apply-filter-to-parent.html b/third_party/WebKit/LayoutTests/fast/scrolling/root-scroller-apply-filter-to-parent.html index 8c7fcc8..ee98401 100644 --- a/third_party/WebKit/LayoutTests/fast/scrolling/root-scroller-apply-filter-to-parent.html +++ b/third_party/WebKit/LayoutTests/fast/scrolling/root-scroller-apply-filter-to-parent.html
@@ -18,6 +18,7 @@ width: 100%; height: 100%; overflow: auto; + will-change: transform; background-image:linear-gradient(0deg, transparent 50%, #0a0 50%), linear-gradient(90deg, #a00 50%, #0a0 50%); background-size:75px 75px,75px 75px;
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/basic-scrollbar-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/basic-scrollbar-expected.png index e28f35c0..7145a28 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/basic-scrollbar-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/basic-scrollbar-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png index c7e1686..6674039 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/border-box-rect-clips-scrollbars-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/custom-scrollbar-appearance-property-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/custom-scrollbar-appearance-property-expected.png index 5581b2c..157ee435a 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/custom-scrollbar-appearance-property-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/custom-scrollbar-appearance-property-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/disabled-scrollbar-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/disabled-scrollbar-expected.png index c19a18a..9d1dad9c 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/disabled-scrollbar-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/disabled-scrollbar-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png index fa57ebad..20a4550 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbar-buttons-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbar-buttons-expected.png index e73a7343..7d1f4e3 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbar-buttons-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbar-buttons-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbar-orientation-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbar-orientation-expected.png index 6b71014..805e6f4 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbar-orientation-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbar-orientation-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbars-on-positioned-content-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbars-on-positioned-content-expected.png index d559c37..942946d 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbars-on-positioned-content-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/rootlayerscrolls/scrollbars/scrollbars-on-positioned-content-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png deleted file mode 100644 index 89fd005..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png deleted file mode 100644 index 89fd005..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png b/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png deleted file mode 100644 index 89fd005..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/rootlayerscrolls/scrollbars/resize-scales-with-dpi-150-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp index e10629b..ad70811 100644 --- a/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.cpp
@@ -90,15 +90,6 @@ NOTREACHED(); } -WebSize WebRemoteFrameImpl::GetScrollOffset() const { - NOTREACHED(); - return WebSize(); -} - -void WebRemoteFrameImpl::SetScrollOffset(const WebSize&) { - NOTREACHED(); -} - WebSize WebRemoteFrameImpl::ContentsSize() const { NOTREACHED(); return WebSize();
diff --git a/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h index d0d4a76..a26058a 100644 --- a/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h +++ b/third_party/WebKit/Source/core/exported/WebRemoteFrameImpl.h
@@ -34,8 +34,6 @@ void Close() override; WebString AssignedName() const override; void SetName(const WebString&) override; - WebSize GetScrollOffset() const override; - void SetScrollOffset(const WebSize&) override; WebSize ContentsSize() const override; bool HasVisibleContent() const override; WebRect VisibleContentRect() const override;
diff --git a/third_party/WebKit/Source/core/frame/FullscreenController.cpp b/third_party/WebKit/Source/core/frame/FullscreenController.cpp index bac937c..ce21bdb1 100644 --- a/third_party/WebKit/Source/core/frame/FullscreenController.cpp +++ b/third_party/WebKit/Source/core/frame/FullscreenController.cpp
@@ -74,7 +74,7 @@ UpdatePageScaleConstraints(false); web_view_base_->SetPageScaleFactor(1.0f); if (web_view_base_->MainFrame()->IsWebLocalFrame()) - web_view_base_->MainFrame()->SetScrollOffset(WebSize()); + web_view_base_->MainFrame()->ToWebLocalFrame()->SetScrollOffset(WebSize()); web_view_base_->SetVisualViewportOffset(FloatPoint()); state_ = State::kFullscreen; @@ -153,7 +153,7 @@ initial_page_scale_factor_ = web_view_base_->PageScaleFactor(); initial_scroll_offset_ = web_view_base_->MainFrame()->IsWebLocalFrame() - ? web_view_base_->MainFrame()->GetScrollOffset() + ? web_view_base_->MainFrame()->ToWebLocalFrame()->GetScrollOffset() : WebSize(); initial_visual_viewport_offset_ = web_view_base_->VisualViewportOffset(); initial_background_color_override_enabled_ = @@ -261,7 +261,7 @@ web_view_base_->SetPageScaleFactor(initial_page_scale_factor_); if (web_view_base_->MainFrame()->IsWebLocalFrame()) { - web_view_base_->MainFrame()->SetScrollOffset( + web_view_base_->MainFrame()->ToWebLocalFrame()->SetScrollOffset( WebSize(initial_scroll_offset_)); } web_view_base_->SetVisualViewportOffset(initial_visual_viewport_offset_);
diff --git a/third_party/WebKit/Source/core/inspector/DevToolsEmulator.cpp b/third_party/WebKit/Source/core/inspector/DevToolsEmulator.cpp index f1cf4697..9179193 100644 --- a/third_party/WebKit/Source/core/inspector/DevToolsEmulator.cpp +++ b/third_party/WebKit/Source/core/inspector/DevToolsEmulator.cpp
@@ -433,7 +433,11 @@ transform->Scale(viewport_override_->scale); // Translate while taking into account current scroll offset. - WebSize scroll_offset = web_view_->MainFrame()->GetScrollOffset(); + // TODO(lukasza): https://crbug.com/734201: Add OOPIF support. + WebSize scroll_offset = + web_view_->MainFrame()->IsWebLocalFrame() + ? web_view_->MainFrame()->ToWebLocalFrame()->GetScrollOffset() + : WebSize(); WebFloatPoint visual_offset = web_view_->VisualViewportOffset(); float scroll_x = scroll_offset.width + visual_offset.x; float scroll_y = scroll_offset.height + visual_offset.y; @@ -522,6 +526,7 @@ // FIXME: This workaround is required for touch emulation on Mac, where // compositor-side pinch handling is not enabled. See http://crbug.com/138003. + // TODO(lukasza): https://crbug.com/734201: Add OOPIF support. LocalFrameView* frame_view = page->DeprecatedLocalMainFrame()->View(); WebGestureEvent scaled_event = TransformWebGestureEvent( frame_view, static_cast<const WebGestureEvent&>(input_event)); @@ -540,8 +545,11 @@ IntPoint anchor_css(*last_pinch_anchor_dip_.get()); anchor_css.Scale(1.f / new_page_scale_factor, 1.f / new_page_scale_factor); web_view_->SetPageScaleFactor(new_page_scale_factor); - web_view_->MainFrame()->SetScrollOffset( - ToIntSize(*last_pinch_anchor_css_.get() - ToIntSize(anchor_css))); + // TODO(lukasza): https://crbug.com/734201: Add OOPIF support. + if (web_view_->MainFrame()->IsWebLocalFrame()) { + web_view_->MainFrame()->ToWebLocalFrame()->SetScrollOffset( + ToIntSize(*last_pinch_anchor_css_.get() - ToIntSize(anchor_css))); + } } if (scaled_event.GetType() == WebInputEvent::kGesturePinchEnd) { last_pinch_anchor_css_.reset();
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp index 1dc39e1..ad558b3 100644 --- a/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp +++ b/third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp
@@ -10,6 +10,7 @@ #include "core/frame/Settings.h" #include "core/layout/LayoutView.h" #include "core/page/Page.h" +#include "core/page/scrolling/RootScrollerUtil.h" #include "core/paint/PaintLayer.h" namespace blink { @@ -153,6 +154,12 @@ if (layer->NeedsCompositedScrolling()) direct_reasons |= kCompositingReasonOverflowScrollingTouch; + // When RLS is disabled, the root layer may be the root scroller but + // the FrameView/Compositor handles its scrolling so there's no need to + // composite it. + if (RootScrollerUtil::IsGlobal(*layer) && !layer->IsScrolledByFrameView()) + direct_reasons |= kCompositingReasonRootScroller; + // Composite |layer| if it is inside of an ancestor scrolling layer, but that // scrolling layer is not on the stacking context ancestor chain of |layer|. // See the definition of the scrollParent property in Layer for more detail.
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp index ce3260f1..2124f45c 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp +++ b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
@@ -347,6 +347,7 @@ if (!ErrorOccurred()) SetStatus(ResourceStatus::kDecodeError); + bool is_multipart = !!multipart_parser_; // Finishes loading if needed, and notifies observers. if (!all_data_received && Loader()) { // Observers are notified via ImageResource::finish(). @@ -355,7 +356,8 @@ } else { auto result = GetContent()->UpdateImage( nullptr, GetStatus(), - ImageResourceContent::kClearImageAndNotifyObservers, all_data_received); + ImageResourceContent::kClearImageAndNotifyObservers, all_data_received, + is_multipart); DCHECK_EQ(result, ImageResourceContent::UpdateImageResult::kNoDecodeError); } @@ -615,9 +617,10 @@ PassRefPtr<SharedBuffer> shared_buffer, ImageResourceContent::UpdateImageOption update_image_option, bool all_data_received) { - auto result = - GetContent()->UpdateImage(std::move(shared_buffer), GetStatus(), - update_image_option, all_data_received); + bool is_multipart = !!multipart_parser_; + auto result = GetContent()->UpdateImage(std::move(shared_buffer), GetStatus(), + update_image_option, + all_data_received, is_multipart); if (result == ImageResourceContent::UpdateImageResult::kShouldDecodeError) { // In case of decode error, we call imageNotifyFinished() iff we don't // initiate reloading:
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp index d4f25b59..48efe30 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp +++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp
@@ -313,10 +313,10 @@ } } -PassRefPtr<Image> ImageResourceContent::CreateImage() { +PassRefPtr<Image> ImageResourceContent::CreateImage(bool is_multipart) { if (info_->GetResponse().MimeType() == "image/svg+xml") - return SVGImage::Create(this); - return BitmapImage::Create(this); + return SVGImage::Create(this, is_multipart); + return BitmapImage::Create(this, is_multipart); } void ImageResourceContent::ClearImage() { @@ -419,7 +419,8 @@ PassRefPtr<SharedBuffer> data, ResourceStatus status, UpdateImageOption update_image_option, - bool all_data_received) { + bool all_data_received, + bool is_multipart) { TRACE_EVENT0("blink", "ImageResourceContent::updateImage"); #if DCHECK_IS_ON() @@ -452,7 +453,7 @@ // or specific image frames). if (data) { if (!image_) - image_ = CreateImage(); + image_ = CreateImage(is_multipart); DCHECK(image_); size_available_ = image_->SetData(std::move(data), all_data_received); DCHECK(all_data_received ||
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h index 8b8aded..a9a1195 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h +++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
@@ -163,7 +163,8 @@ WARN_UNUSED_RESULT UpdateImageResult UpdateImage(PassRefPtr<SharedBuffer>, ResourceStatus, UpdateImageOption, - bool all_data_received); + bool all_data_received, + bool is_multipart); void NotifyStartLoad(); void DestroyDecodedData(); @@ -191,7 +192,7 @@ void ChangedInRect(const blink::Image*, const IntRect&) override; void AsyncLoadCompleted(const blink::Image*) override; - PassRefPtr<Image> CreateImage(); + PassRefPtr<Image> CreateImage(bool is_multipart); void ClearImage(); enum NotifyFinishOption { kShouldNotifyFinish, kDoNotNotifyFinish };
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp index 3c3b469..fce9e1a 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp +++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
@@ -244,6 +244,7 @@ EXPECT_EQ(kImageWidth, content->GetImage()->width()); EXPECT_EQ(kImageHeight, content->GetImage()->height()); EXPECT_TRUE(content->GetImage()->IsBitmapImage()); + EXPECT_FALSE(content->GetImage()->PaintImageForCurrentFrame().is_multipart()); } AtomicString BuildContentRange(size_t range_length, size_t total_length) { @@ -417,12 +418,50 @@ EXPECT_EQ(kJpegImageWidth, image_resource->GetContent()->GetImage()->width()); EXPECT_EQ(kJpegImageHeight, image_resource->GetContent()->GetImage()->height()); + EXPECT_TRUE(image_resource->GetContent()->GetImage()->IsSVGImage()); + EXPECT_TRUE(image_resource->GetContent() + ->GetImage() + ->PaintImageForCurrentFrame() + .is_multipart()); + EXPECT_EQ(1, observer->ImageChangedCount()); EXPECT_TRUE(observer->ImageNotifyFinishedCalled()); EXPECT_EQ(1, observer2->ImageChangedCount()); EXPECT_TRUE(observer2->ImageNotifyFinishedCalled()); } +TEST(ImageResourceTest, BitmapMultipartImage) { + ResourceFetcher* fetcher = CreateFetcher(); + KURL test_url(kParsedURLString, kTestURL); + ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath()); + ImageResource* image_resource = + ImageResource::Create(ResourceRequest(test_url)); + image_resource->SetIdentifier(CreateUniqueIdentifier()); + fetcher->StartLoad(image_resource); + + ResourceResponse multipart_response(KURL(), "multipart/x-mixed-replace", 0, + g_null_atom); + multipart_response.SetMultipartBoundary("boundary", strlen("boundary")); + image_resource->Loader()->DidReceiveResponse( + WrappedResourceResponse(multipart_response), nullptr); + EXPECT_FALSE(image_resource->GetContent()->HasImage()); + + const char kBoundary[] = "--boundary\n"; + const char kContentType[] = "Content-Type: image/jpeg\n\n"; + image_resource->AppendData(kBoundary, strlen(kBoundary)); + image_resource->AppendData(kContentType, strlen(kContentType)); + image_resource->AppendData(reinterpret_cast<const char*>(kJpegImage), + sizeof(kJpegImage)); + image_resource->AppendData(kBoundary, strlen(kBoundary)); + image_resource->Loader()->DidFinishLoading(0.0, 0, 0, 0); + EXPECT_TRUE(image_resource->GetContent()->HasImage()); + EXPECT_TRUE(image_resource->GetContent()->GetImage()->IsBitmapImage()); + EXPECT_TRUE(image_resource->GetContent() + ->GetImage() + ->PaintImageForCurrentFrame() + .is_multipart()); +} + TEST(ImageResourceTest, CancelOnRemoveObserver) { KURL test_url(kParsedURLString, kTestURL); ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.cpp b/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.cpp index 1199f27..731981d 100644 --- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.cpp
@@ -11,7 +11,10 @@ #include "core/layout/LayoutBox.h" #include "core/layout/LayoutBoxModelObject.h" #include "core/layout/LayoutView.h" +#include "core/page/Page.h" #include "core/page/scrolling/RootScrollerController.h" +#include "core/page/scrolling/TopDocumentRootScrollerController.h" +#include "core/paint/PaintLayer.h" #include "core/paint/PaintLayerScrollableArea.h" namespace blink { @@ -71,6 +74,30 @@ &box.GetDocument().GetRootScrollerController().EffectiveRootScroller(); } +bool IsGlobal(const LayoutBox& box) { + if (!box.GetNode() || !box.GetNode()->GetDocument().GetPage()) + return false; + + return box.GetNode() == box.GetDocument() + .GetPage() + ->GlobalRootScrollerController() + .GlobalRootScroller(); +} + +bool IsGlobal(const PaintLayer& layer) { + if (!layer.GetLayoutBox()) + return false; + + PaintLayer* root_scroller_layer = + PaintLayerForRootScroller(layer.GetLayoutBox() + ->GetDocument() + .GetPage() + ->GlobalRootScrollerController() + .GlobalRootScroller()); + + return &layer == root_scroller_layer; +} + } // namespace RootScrollerUtil } // namespace blink
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.h b/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.h index 673e844f..9678ef0 100644 --- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.h +++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerUtil.h
@@ -24,10 +24,14 @@ // rather than <html>'s since scrolling is handled by LayoutView. PaintLayer* PaintLayerForRootScroller(const Node*); -// Returns true if the given LayoutBox is the effective root scroller in its -// Document. See |effective root scroller| in README.md. +// Return true if the given object is the effective root scroller in its +// Document. See |effective root scroller| in README.md. Note: a root scroller +// always establishes a PaintLayer. bool IsEffective(const LayoutBox&); +bool IsGlobal(const LayoutBox&); +bool IsGlobal(const PaintLayer&); + } // namespace RootScrollerUtil } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp index 3c2fa50..4f7f591 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -3318,6 +3318,10 @@ needs_repaint_ = false; } +bool PaintLayer::IsScrolledByFrameView() const { + return IsRootLayer() && !RuntimeEnabledFeatures::RootLayerScrollingEnabled(); +} + DisableCompositingQueryAsserts::DisableCompositingQueryAsserts() : disabler_(&g_compositing_query_mode, kCompositingQueriesAreAllowed) {}
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.h b/third_party/WebKit/Source/core/paint/PaintLayer.h index e083767c..f2572534 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayer.h +++ b/third_party/WebKit/Source/core/paint/PaintLayer.h
@@ -1023,6 +1023,12 @@ self_painting_status_changed_ = false; } + // If RootLayerScrolling is off, the root layer delegates scrolling to the + // PaintLayerCompositor's special scrolling layers for the frame. In that + // case this method will return true. For all other layers or if we're in + // RLS mode it returns false. + bool IsScrolledByFrameView() const; + private: void SetNeedsCompositingInputsUpdateInternal();
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp index 2020141..90fe6f1 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
@@ -51,6 +51,13 @@ << ", expected=" << expected_value << ", actual=" << invisible << "]."; } + PaintController& MainGraphicsLayerPaintController() { + return GetLayoutView() + .Layer() + ->GraphicsLayerBacking(&GetLayoutView()) + ->GetPaintController(); + } + private: void SetUp() override { PaintControllerPaintTestBase::SetUp(); @@ -96,25 +103,19 @@ LayoutObject& content2 = *GetDocument().getElementById("content2")->GetLayoutObject(); - if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { + if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && + RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { + // With SPv1 and RLS, the LayoutView gets painted into the + // MainGraphicsLayer while the rest into the ScrollingContentsLayer EXPECT_DISPLAY_LIST( - RootPaintController().GetDisplayItemList(), 5, - TestDisplayItem(GetLayoutView(), kDocumentBackgroundType), - TestDisplayItem(container1, kBackgroundType), - TestDisplayItem(content1, kBackgroundType), - TestDisplayItem(container2, kBackgroundType), - TestDisplayItem(content2, kBackgroundType)); + MainGraphicsLayerPaintController().GetDisplayItemList(), 1, + TestDisplayItem(GetLayoutView(), kDocumentBackgroundType)); - // check that new paint chunks were forced for |container1| and - // |container2|. - Vector<PaintChunk> paint_chunks = - RootPaintController().GetPaintArtifact().PaintChunks(); - EXPECT_EQ(3u, paint_chunks.size()); - EXPECT_EQ(GetLayoutView().Layer(), &paint_chunks[0].id.client); - EXPECT_EQ(ToLayoutBoxModelObject(container1).Layer(), - &paint_chunks[1].id.client); - EXPECT_EQ(ToLayoutBoxModelObject(container2).Layer(), - &paint_chunks[2].id.client); + EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 4, + TestDisplayItem(container1, kBackgroundType), + TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(container2, kBackgroundType), + TestDisplayItem(content2, kBackgroundType)); } else { EXPECT_DISPLAY_LIST( RootPaintController().GetDisplayItemList(), 5, @@ -125,6 +126,19 @@ TestDisplayItem(content2, kBackgroundType)); } + if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { + // check that new paint chunks were forced for |container1| and + // |container2|. + Vector<PaintChunk> paint_chunks = + RootPaintController().GetPaintArtifact().PaintChunks(); + EXPECT_EQ(3u, paint_chunks.size()); + EXPECT_EQ(GetLayoutView().Layer(), &paint_chunks[0].id.client); + EXPECT_EQ(ToLayoutBoxModelObject(container1).Layer(), + &paint_chunks[1].id.client); + EXPECT_EQ(ToLayoutBoxModelObject(container2).Layer(), + &paint_chunks[2].id.client); + } + ToHTMLElement(content1.GetNode()) ->setAttribute(HTMLNames::styleAttr, "position: absolute; width: 100px; height: 100px; " @@ -132,18 +146,27 @@ GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint(); EXPECT_TRUE(PaintWithoutCommit()); - EXPECT_EQ(4, NumCachedNewItems()); + // With RLS and SPv1, the LayoutView is painted into a separate GraphicsLayer + // so it doesn't contribute to NumCachedNewItems since it isn't invalidated. + if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && + RuntimeEnabledFeatures::RootLayerScrollingEnabled()) + EXPECT_EQ(3, NumCachedNewItems()); + else + EXPECT_EQ(4, NumCachedNewItems()); Commit(); - if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { + if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && + RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { EXPECT_DISPLAY_LIST( - RootPaintController().GetDisplayItemList(), 5, - TestDisplayItem(GetLayoutView(), kDocumentBackgroundType), - TestDisplayItem(container1, kBackgroundType), - TestDisplayItem(content1, kBackgroundType), - TestDisplayItem(container2, kBackgroundType), - TestDisplayItem(content2, kBackgroundType)); + MainGraphicsLayerPaintController().GetDisplayItemList(), 1, + TestDisplayItem(GetLayoutView(), kDocumentBackgroundType)); + + EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 4, + TestDisplayItem(container1, kBackgroundType), + TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(container2, kBackgroundType), + TestDisplayItem(content2, kBackgroundType)); } else { EXPECT_DISPLAY_LIST( RootPaintController().GetDisplayItemList(), 5, @@ -204,14 +227,31 @@ // Container2 is partly (including its stacking chidren) in the interest rect; // Content2b is out of the interest rect and output nothing; // Container3 is partly in the interest rect. - EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 7, - TestDisplayItem(GetLayoutView(), kDocumentBackgroundType), - TestDisplayItem(container1, kBackgroundType), - TestDisplayItem(content1, kBackgroundType), - TestDisplayItem(container2, kBackgroundType), - TestDisplayItem(content2a, kBackgroundType), - TestDisplayItem(container3, kBackgroundType), - TestDisplayItem(content3, kBackgroundType)); + if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && + RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { + // With SPv1 and RLS, the LayoutView gets painted into the + // MainGraphicsLayer while the rest into the ScrollingContentsLayer + EXPECT_DISPLAY_LIST( + MainGraphicsLayerPaintController().GetDisplayItemList(), 1, + TestDisplayItem(GetLayoutView(), kDocumentBackgroundType)); + EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 6, + TestDisplayItem(container1, kBackgroundType), + TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(container2, kBackgroundType), + TestDisplayItem(content2a, kBackgroundType), + TestDisplayItem(container3, kBackgroundType), + TestDisplayItem(content3, kBackgroundType)); + } else { + EXPECT_DISPLAY_LIST( + RootPaintController().GetDisplayItemList(), 7, + TestDisplayItem(GetLayoutView(), kDocumentBackgroundType), + TestDisplayItem(container1, kBackgroundType), + TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(container2, kBackgroundType), + TestDisplayItem(content2a, kBackgroundType), + TestDisplayItem(container3, kBackgroundType), + TestDisplayItem(content3, kBackgroundType)); + } GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint(); IntRect new_interest_rect(0, 100, 300, 1000); @@ -223,17 +263,35 @@ // Content2b is out of the interest rect and outputs nothing; // Container3 becomes out of the interest rect and outputs empty subsequence // pair. - EXPECT_EQ(5, NumCachedNewItems()); + if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && + RuntimeEnabledFeatures::RootLayerScrollingEnabled()) + EXPECT_EQ(4, NumCachedNewItems()); + else + EXPECT_EQ(5, NumCachedNewItems()); Commit(); - EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 6, - TestDisplayItem(GetLayoutView(), kDocumentBackgroundType), - TestDisplayItem(container1, kBackgroundType), - TestDisplayItem(content1, kBackgroundType), - TestDisplayItem(container2, kBackgroundType), - TestDisplayItem(content2a, kBackgroundType), - TestDisplayItem(content2b, kBackgroundType)); + if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && + RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { + EXPECT_DISPLAY_LIST( + MainGraphicsLayerPaintController().GetDisplayItemList(), 1, + TestDisplayItem(GetLayoutView(), kDocumentBackgroundType)); + EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 5, + TestDisplayItem(container1, kBackgroundType), + TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(container2, kBackgroundType), + TestDisplayItem(content2a, kBackgroundType), + TestDisplayItem(content2b, kBackgroundType)); + } else { + EXPECT_DISPLAY_LIST( + RootPaintController().GetDisplayItemList(), 6, + TestDisplayItem(GetLayoutView(), kDocumentBackgroundType), + TestDisplayItem(container1, kBackgroundType), + TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(container2, kBackgroundType), + TestDisplayItem(content2a, kBackgroundType), + TestDisplayItem(content2b, kBackgroundType)); + } } TEST_P(PaintLayerPainterTest, @@ -263,14 +321,18 @@ LayoutObject& content2 = *GetDocument().getElementById("content2")->GetLayoutObject(); - if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { + if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && + RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { + // With SPv1 and RLS, the LayoutView gets painted into the + // MainGraphicsLayer while the rest into the ScrollingContentsLayer EXPECT_DISPLAY_LIST( - RootPaintController().GetDisplayItemList(), 5, - TestDisplayItem(GetLayoutView(), kDocumentBackgroundType), - TestDisplayItem(container1, kBackgroundType), - TestDisplayItem(content1, kBackgroundType), - TestDisplayItem(container2, kBackgroundType), - TestDisplayItem(content2, kBackgroundType)); + MainGraphicsLayerPaintController().GetDisplayItemList(), 1, + TestDisplayItem(GetLayoutView(), kDocumentBackgroundType)); + EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 4, + TestDisplayItem(container1, kBackgroundType), + TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(container2, kBackgroundType), + TestDisplayItem(content2, kBackgroundType)); } else { EXPECT_DISPLAY_LIST( RootPaintController().GetDisplayItemList(), 5, @@ -288,18 +350,24 @@ GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint(); EXPECT_TRUE(PaintWithoutCommit(&interest_rect)); - EXPECT_EQ(4, NumCachedNewItems()); + if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && + RuntimeEnabledFeatures::RootLayerScrollingEnabled()) + EXPECT_EQ(3, NumCachedNewItems()); + else + EXPECT_EQ(4, NumCachedNewItems()); Commit(); - if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { + if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && + RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { EXPECT_DISPLAY_LIST( - RootPaintController().GetDisplayItemList(), 5, - TestDisplayItem(GetLayoutView(), kDocumentBackgroundType), - TestDisplayItem(container1, kBackgroundType), - TestDisplayItem(content1, kBackgroundType), - TestDisplayItem(container2, kBackgroundType), - TestDisplayItem(content2, kBackgroundType)); + MainGraphicsLayerPaintController().GetDisplayItemList(), 1, + TestDisplayItem(GetLayoutView(), kDocumentBackgroundType)); + EXPECT_DISPLAY_LIST(RootPaintController().GetDisplayItemList(), 4, + TestDisplayItem(container1, kBackgroundType), + TestDisplayItem(content1, kBackgroundType), + TestDisplayItem(container2, kBackgroundType), + TestDisplayItem(content2, kBackgroundType)); } else { EXPECT_DISPLAY_LIST( RootPaintController().GetDisplayItemList(), 5, @@ -534,7 +602,13 @@ ToHTMLElement(background_div.GetNode()) ->setAttribute(HTMLNames::styleAttr, style_without_background); GetDocument().View()->UpdateAllLifecyclePhases(); - EXPECT_FALSE(self_painting_layer.NeedsPaintPhaseDescendantBlockBackgrounds()); + if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() || + !RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { + // In RootLayerScrolls+SPv1, the empty paint phase optimization doesn't + // apply to the composited scrolling layer so we don't need this check. + EXPECT_FALSE( + self_painting_layer.NeedsPaintPhaseDescendantBlockBackgrounds()); + } } TEST_P(PaintLayerPainterTest, PaintPhasesUpdateOnLayerRemoval) {
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp index 64a7d7b..46f2f8f 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -1866,6 +1866,15 @@ const LCDTextMode mode, const PaintLayer* layer) { non_composited_main_thread_scrolling_reasons_ = 0; + + // The root scroller needs composited scrolling layers even if it doesn't + // actually have scrolling since CC has these assumptions baked in for the + // viewport. If we're in non-RootLayerScrolling mode, the root layer will be + // the global root scroller (by default) but it doesn't actually handle + // scrolls itself so we don't need composited scrolling for it. + if (RootScrollerUtil::IsGlobal(*layer) && !Layer()->IsScrolledByFrameView()) + return true; + if (!layer->ScrollsOverflow()) return false;
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp index d18fe960d..16d2d975 100644 --- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -91,8 +91,8 @@ SVGImage* image_; }; -SVGImage::SVGImage(ImageObserver* observer) - : Image(observer), +SVGImage::SVGImage(ImageObserver* observer, bool is_multipart) + : Image(observer, is_multipart), paint_controller_(PaintController::Create()), has_pending_timeline_rewind_(false) {}
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h index 05996b5a..f37d1ef 100644 --- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
@@ -57,8 +57,9 @@ // needed by SVGImage. class CORE_EXPORT SVGImage final : public Image { public: - static PassRefPtr<SVGImage> Create(ImageObserver* observer) { - return AdoptRef(new SVGImage(observer)); + static PassRefPtr<SVGImage> Create(ImageObserver* observer, + bool is_multipart = false) { + return AdoptRef(new SVGImage(observer, is_multipart)); } static bool IsInSVGImage(const Node*); @@ -105,7 +106,7 @@ // the the Image interface. friend class SVGImageForContainer; - SVGImage(ImageObserver*); + SVGImage(ImageObserver*, bool is_multipart); ~SVGImage() override; String FilenameExtension() const override;
diff --git a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 index 70e28fb0..7f60178 100644 --- a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 +++ b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
@@ -905,7 +905,7 @@ // as per the spec, matching other Web engines. { name: "ScrollTopLeftInterop", - status: "experimental", + status: "stable", }, { name: "SendBeaconThrowForBlobWithNonSimpleType",
diff --git a/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.cpp b/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.cpp index 19eee733..cf34f7b 100644 --- a/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.cpp +++ b/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.cpp
@@ -44,7 +44,8 @@ static V8PerIsolateData* g_main_thread_per_isolate_data = 0; static void BeforeCallEnteredCallback(v8::Isolate* isolate) { - CHECK(!ScriptForbiddenScope::IsScriptForbidden()); + // TODO(jochen): Re-enable this once https://crbug.com/728583 + // CHECK(!ScriptForbiddenScope::IsScriptForbidden()); } static void MicrotasksCompletedCallback(v8::Isolate* isolate) {
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp index ced5240..1382da4b 100644 --- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp +++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
@@ -59,8 +59,8 @@ return result.Release(); } -BitmapImage::BitmapImage(ImageObserver* observer) - : Image(observer), +BitmapImage::BitmapImage(ImageObserver* observer, bool is_multipart) + : Image(observer, is_multipart), current_frame_(0), cached_frame_index_(0), animation_policy_(kImageAnimationPolicyAllowed),
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.h b/third_party/WebKit/Source/platform/graphics/BitmapImage.h index 6328194..2c7af2a 100644 --- a/third_party/WebKit/Source/platform/graphics/BitmapImage.h +++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.h
@@ -51,8 +51,9 @@ friend class GraphicsContext; public: - static PassRefPtr<BitmapImage> Create(ImageObserver* observer = 0) { - return AdoptRef(new BitmapImage(observer)); + static PassRefPtr<BitmapImage> Create(ImageObserver* observer = 0, + bool is_multipart = false) { + return AdoptRef(new BitmapImage(observer, is_multipart)); } ~BitmapImage() override; @@ -109,7 +110,7 @@ }; BitmapImage(const SkBitmap&, ImageObserver* = 0); - BitmapImage(ImageObserver* = 0); + BitmapImage(ImageObserver* = 0, bool is_multi_part = false); void Draw(PaintCanvas*, const PaintFlags&,
diff --git a/third_party/WebKit/Source/platform/graphics/CompositingReasons.cpp b/third_party/WebKit/Source/platform/graphics/CompositingReasons.cpp index f13ef03..44cf502 100644 --- a/third_party/WebKit/Source/platform/graphics/CompositingReasons.cpp +++ b/third_party/WebKit/Source/platform/graphics/CompositingReasons.cpp
@@ -20,6 +20,8 @@ {kCompositingReasonIFrame, "iFrame", "Is an accelerated iFrame"}, {kCompositingReasonBackfaceVisibilityHidden, "backfaceVisibilityHidden", "Has backface-visibility: hidden"}, + {kCompositingReasonRootScroller, "rootScroller", + "Is the document.rootScroller"}, {kCompositingReasonActiveAnimation, "activeAnimation", "Has an active accelerated animation or transition"}, {kCompositingReasonTransitionProperty, "transitionProperty",
diff --git a/third_party/WebKit/Source/platform/graphics/CompositingReasons.h b/third_party/WebKit/Source/platform/graphics/CompositingReasons.h index 209b27e..02d9bfc2 100644 --- a/third_party/WebKit/Source/platform/graphics/CompositingReasons.h +++ b/third_party/WebKit/Source/platform/graphics/CompositingReasons.h
@@ -31,76 +31,77 @@ const uint64_t kCompositingReasonVideoOverlay = UINT64_C(1) << 12; const uint64_t kCompositingReasonWillChangeCompositingHint = UINT64_C(1) << 13; const uint64_t kCompositingReasonBackdropFilter = UINT64_C(1) << 14; +const uint64_t kCompositingReasonRootScroller = UINT64_C(1) << 15; // Overlap reasons that require knowing what's behind you in paint-order before // knowing the answer. -const uint64_t kCompositingReasonAssumedOverlap = UINT64_C(1) << 15; -const uint64_t kCompositingReasonOverlap = UINT64_C(1) << 16; -const uint64_t kCompositingReasonNegativeZIndexChildren = UINT64_C(1) << 17; -const uint64_t kCompositingReasonSquashingDisallowed = UINT64_C(1) << 18; +const uint64_t kCompositingReasonAssumedOverlap = UINT64_C(1) << 16; +const uint64_t kCompositingReasonOverlap = UINT64_C(1) << 17; +const uint64_t kCompositingReasonNegativeZIndexChildren = UINT64_C(1) << 18; +const uint64_t kCompositingReasonSquashingDisallowed = UINT64_C(1) << 19; // Subtree reasons that require knowing what the status of your subtree is // before knowing the answer. const uint64_t kCompositingReasonTransformWithCompositedDescendants = - UINT64_C(1) << 19; + UINT64_C(1) << 20; const uint64_t kCompositingReasonOpacityWithCompositedDescendants = UINT64_C(1) - << 20; + << 21; const uint64_t kCompositingReasonMaskWithCompositedDescendants = UINT64_C(1) - << 21; + << 22; const uint64_t kCompositingReasonReflectionWithCompositedDescendants = - UINT64_C(1) << 22; + UINT64_C(1) << 23; const uint64_t kCompositingReasonFilterWithCompositedDescendants = UINT64_C(1) - << 23; + << 24; const uint64_t kCompositingReasonBlendingWithCompositedDescendants = UINT64_C(1) - << 24; + << 25; const uint64_t kCompositingReasonClipsCompositingDescendants = UINT64_C(1) - << 25; + << 26; const uint64_t kCompositingReasonPerspectiveWith3DDescendants = UINT64_C(1) - << 26; + << 27; const uint64_t kCompositingReasonPreserve3DWith3DDescendants = UINT64_C(1) - << 27; + << 28; const uint64_t kCompositingReasonReflectionOfCompositedParent = UINT64_C(1) - << 28; -const uint64_t kCompositingReasonIsolateCompositedDescendants = UINT64_C(1) << 29; +const uint64_t kCompositingReasonIsolateCompositedDescendants = UINT64_C(1) + << 30; const uint64_t kCompositingReasonPositionFixedOrStickyWithCompositedDescendants = - UINT64_C(1) << 30; + UINT64_C(1) << 31; // The root layer is a special case. It may be forced to be a layer, but it also // needs to be a layer if anything else in the subtree is composited. -const uint64_t kCompositingReasonRoot = UINT64_C(1) << 31; +const uint64_t kCompositingReasonRoot = UINT64_C(1) << 32; // CompositedLayerMapping internal hierarchy reasons -const uint64_t kCompositingReasonLayerForAncestorClip = UINT64_C(1) << 32; -const uint64_t kCompositingReasonLayerForDescendantClip = UINT64_C(1) << 33; -const uint64_t kCompositingReasonLayerForPerspective = UINT64_C(1) << 34; +const uint64_t kCompositingReasonLayerForAncestorClip = UINT64_C(1) << 33; +const uint64_t kCompositingReasonLayerForDescendantClip = UINT64_C(1) << 34; +const uint64_t kCompositingReasonLayerForPerspective = UINT64_C(1) << 35; const uint64_t kCompositingReasonLayerForHorizontalScrollbar = UINT64_C(1) - << 35; -const uint64_t kCompositingReasonLayerForVerticalScrollbar = UINT64_C(1) << 36; + << 36; +const uint64_t kCompositingReasonLayerForVerticalScrollbar = UINT64_C(1) << 37; const uint64_t kCompositingReasonLayerForOverflowControlsHost = UINT64_C(1) - << 37; -const uint64_t kCompositingReasonLayerForScrollCorner = UINT64_C(1) << 38; -const uint64_t kCompositingReasonLayerForScrollingContents = UINT64_C(1) << 39; -const uint64_t kCompositingReasonLayerForScrollingContainer = UINT64_C(1) << 40; -const uint64_t kCompositingReasonLayerForSquashingContents = UINT64_C(1) << 41; -const uint64_t kCompositingReasonLayerForSquashingContainer = UINT64_C(1) << 42; -const uint64_t kCompositingReasonLayerForForeground = UINT64_C(1) << 43; -const uint64_t kCompositingReasonLayerForBackground = UINT64_C(1) << 44; -const uint64_t kCompositingReasonLayerForMask = UINT64_C(1) << 45; -const uint64_t kCompositingReasonLayerForClippingMask = UINT64_C(1) << 46; + << 38; +const uint64_t kCompositingReasonLayerForScrollCorner = UINT64_C(1) << 39; +const uint64_t kCompositingReasonLayerForScrollingContents = UINT64_C(1) << 40; +const uint64_t kCompositingReasonLayerForScrollingContainer = UINT64_C(1) << 41; +const uint64_t kCompositingReasonLayerForSquashingContents = UINT64_C(1) << 42; +const uint64_t kCompositingReasonLayerForSquashingContainer = UINT64_C(1) << 43; +const uint64_t kCompositingReasonLayerForForeground = UINT64_C(1) << 44; +const uint64_t kCompositingReasonLayerForBackground = UINT64_C(1) << 45; +const uint64_t kCompositingReasonLayerForMask = UINT64_C(1) << 46; +const uint64_t kCompositingReasonLayerForClippingMask = UINT64_C(1) << 47; const uint64_t kCompositingReasonLayerForAncestorClippingMask = UINT64_C(1) - << 47; + << 48; const uint64_t kCompositingReasonLayerForScrollingBlockSelection = UINT64_C(1) - << 48; + << 49; // Composited layer painted on top of all other layers as decoration -const uint64_t kCompositingReasonLayerForDecoration = UINT64_C(1) << 49; +const uint64_t kCompositingReasonLayerForDecoration = UINT64_C(1) << 50; // Composited elements with inline transforms trigger assumed overlap so that // we can update their transforms quickly. -const uint64_t kCompositingReasonInlineTransform = UINT64_C(1) << 50; +const uint64_t kCompositingReasonInlineTransform = UINT64_C(1) << 51; -const uint64_t kCompositingReasonCompositorProxy = UINT64_C(1) << 51; +const uint64_t kCompositingReasonCompositorProxy = UINT64_C(1) << 52; // Various combinations of compositing reasons are defined here also, for more // intutive and faster bitwise logic. @@ -114,7 +115,8 @@ kCompositingReasonOverflowScrollingParent | kCompositingReasonOutOfFlowClipping | kCompositingReasonVideoOverlay | kCompositingReasonWillChangeCompositingHint | - kCompositingReasonCompositorProxy | kCompositingReasonBackdropFilter; + kCompositingReasonCompositorProxy | kCompositingReasonBackdropFilter | + kCompositingReasonRootScroller; const uint64_t kCompositingReasonComboAllDirectStyleDeterminedReasons = kCompositingReason3DTransform | kCompositingReasonBackfaceVisibilityHidden |
diff --git a/third_party/WebKit/Source/platform/graphics/Image.cpp b/third_party/WebKit/Source/platform/graphics/Image.cpp index 88683c7..84b1a39 100644 --- a/third_party/WebKit/Source/platform/graphics/Image.cpp +++ b/third_party/WebKit/Source/platform/graphics/Image.cpp
@@ -51,10 +51,11 @@ namespace blink { -Image::Image(ImageObserver* observer) +Image::Image(ImageObserver* observer, bool is_multipart) : image_observer_disabled_(false), image_observer_(observer), - stable_image_id_(PaintImage::GetNextId()) {} + stable_image_id_(PaintImage::GetNextId()), + is_multipart_(is_multipart) {} Image::~Image() {} @@ -350,7 +351,7 @@ ? PaintImage::CompletionState::DONE : PaintImage::CompletionState::PARTIALLY_DONE; return PaintImage(stable_image_id_, ImageForCurrentFrame(), animation_type, - completion_state, FrameCount()); + completion_state, FrameCount(), is_multipart_); } bool Image::ApplyShader(PaintFlags& flags, const SkMatrix& local_matrix) {
diff --git a/third_party/WebKit/Source/platform/graphics/Image.h b/third_party/WebKit/Source/platform/graphics/Image.h index e187234..d09fa73 100644 --- a/third_party/WebKit/Source/platform/graphics/Image.h +++ b/third_party/WebKit/Source/platform/graphics/Image.h
@@ -200,7 +200,7 @@ const FloatSize& image_size); protected: - Image(ImageObserver* = 0); + Image(ImageObserver* = 0, bool is_multipart = false); void DrawTiledBackground(GraphicsContext&, const FloatRect& dst_rect, @@ -236,6 +236,7 @@ // alive, |image_observer_| is cleared by WeakPersistent mechanism. WeakPersistent<ImageObserver> image_observer_; PaintImage::Id stable_image_id_; + const bool is_multipart_; }; #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp index e63f9aa..40adbba9 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.cpp +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -1294,8 +1294,13 @@ if (MainFrame()) max_size = MainFrame()->ContentsSize(); IntSize scroll_offset; - if (MainFrame()) - scroll_offset = MainFrame()->GetScrollOffset(); + if (MainFrame()) { + // TODO(lukasza): https://crbug.com/734209: The DCHECK below holds now, but + // only because all of the callers don't support OOPIFs and exit early if + // the main frame is not local. + DCHECK(MainFrame()->IsWebLocalFrame()); + scroll_offset = MainFrame()->ToWebLocalFrame()->GetScrollOffset(); + } int left_margin = target_margin; int right_margin = target_margin; @@ -1515,6 +1520,7 @@ } void WebViewImpl::AnimateDoubleTapZoom(const IntPoint& point_in_root_frame) { + // TODO(lukasza): https://crbug.com/734209: Add OOPIF support. if (!MainFrameImpl()) return; @@ -1561,6 +1567,7 @@ } void WebViewImpl::ZoomToFindInPageRect(const WebRect& rect_in_root_frame) { + // TODO(lukasza): https://crbug.com/734209: Add OOPIF support. if (!MainFrameImpl()) return; @@ -1587,6 +1594,7 @@ } bool WebViewImpl::ZoomToMultipleTargetsRect(const WebRect& rect_in_root_frame) { + // TODO(lukasza): https://crbug.com/734209: Add OOPIF support. if (!MainFrameImpl()) return false;
diff --git a/third_party/WebKit/Source/web/tests/BrowserControlsTest.cpp b/third_party/WebKit/Source/web/tests/BrowserControlsTest.cpp index 009e193..e54a7ddb 100644 --- a/third_party/WebKit/Source/web/tests/BrowserControlsTest.cpp +++ b/third_party/WebKit/Source/web/tests/BrowserControlsTest.cpp
@@ -582,21 +582,21 @@ web_view->SetPageScaleFactor(2.0); // Fully scroll frameview but visualviewport remains scrollable - web_view->MainFrame()->SetScrollOffset(WebSize(0, 10000)); + web_view->MainFrameImpl()->SetScrollOffset(WebSize(0, 10000)); GetVisualViewport().SetLocation(FloatPoint(0, 0)); VerticalScroll(-10.f); EXPECT_FLOAT_EQ(40, web_view->GetBrowserControls().ContentOffset()); web_view->GetBrowserControls().SetShownRatio(1); // Fully scroll visual veiwport but frameview remains scrollable - web_view->MainFrame()->SetScrollOffset(WebSize(0, 0)); + web_view->MainFrameImpl()->SetScrollOffset(WebSize(0, 0)); GetVisualViewport().SetLocation(FloatPoint(0, 10000)); VerticalScroll(-20.f); EXPECT_FLOAT_EQ(30, web_view->GetBrowserControls().ContentOffset()); web_view->GetBrowserControls().SetShownRatio(1); // Fully scroll both frameview and visual viewport - web_view->MainFrame()->SetScrollOffset(WebSize(0, 10000)); + web_view->MainFrameImpl()->SetScrollOffset(WebSize(0, 10000)); GetVisualViewport().SetLocation(FloatPoint(0, 10000)); VerticalScroll(-30.f); // Browser controls should not move because neither frameview nor visual
diff --git a/third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp b/third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp index 1d35558..aa35f4f7 100644 --- a/third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp +++ b/third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp
@@ -52,7 +52,7 @@ loader.GetDocumentLoader()->SetLoadType(kFrameLoadTypeBackForward); web_view->SetPageScaleFactor(3.0f); - web_view->MainFrame()->SetScrollOffset(WebSize(0, 500)); + web_view->MainFrameImpl()->SetScrollOffset(WebSize(0, 500)); loader.GetDocumentLoader()->GetInitialScrollState().was_scrolled_by_user = false; loader.GetDocumentLoader()->GetHistoryItem()->SetPageScaleFactor(2); @@ -84,7 +84,7 @@ loader.GetDocumentLoader()->SetLoadType(kFrameLoadTypeBackForward); web_view->SetPageScaleFactor(3.0f); - web_view->MainFrame()->SetScrollOffset(WebSize(0, 500)); + web_view->MainFrameImpl()->SetScrollOffset(WebSize(0, 500)); loader.GetDocumentLoader()->GetInitialScrollState().was_scrolled_by_user = false; loader.GetDocumentLoader()->GetHistoryItem()->SetPageScaleFactor(0);
diff --git a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp index 068bf041..93dc80b 100644 --- a/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp +++ b/third_party/WebKit/Source/web/tests/RootScrollerTest.cpp
@@ -604,6 +604,53 @@ } } +// Ensures that the root scroller always gets composited with scrolling layers. +// This is necessary since we replace the Frame scrolling layers in CC as the +// OuterViewport, we need something to replace them with. +TEST_F(RootScrollerTest, AlwaysCreateCompositedScrollingLayers) { + Initialize(); + + WebURL base_url = URLTestHelpers::ToKURL("http://www.test.com/"); + FrameTestHelpers::LoadHTMLString(GetWebView()->MainFrameImpl(), + "<!DOCTYPE html>" + "<style>" + " body {" + " margin: 0px;" + " }" + " #container {" + " width: 100%;" + " height: 100%;" + " position: absolute;" + " overflow: auto;" + " }" + "</style>" + "<div id='container'></div>", + base_url); + + GetWebView()->ResizeWithBrowserControls(IntSize(400, 400), 50, true); + MainFrameView()->UpdateAllLifecyclePhases(); + + Element* container = MainFrame()->GetDocument()->getElementById("container"); + + PaintLayerScrollableArea* container_scroller = + ToLayoutBox(container->GetLayoutObject())->GetScrollableArea(); + PaintLayer* layer = container_scroller->Layer(); + + ASSERT_FALSE(layer->HasCompositedLayerMapping()); + + MainFrame()->GetDocument()->setRootScroller(container, ASSERT_NO_EXCEPTION); + MainFrameView()->UpdateAllLifecyclePhases(); + + ASSERT_TRUE(layer->HasCompositedLayerMapping()); + EXPECT_TRUE(layer->GetCompositedLayerMapping()->ScrollingContentsLayer()); + EXPECT_TRUE(layer->GetCompositedLayerMapping()->ScrollingLayer()); + + MainFrame()->GetDocument()->setRootScroller(nullptr, ASSERT_NO_EXCEPTION); + MainFrameView()->UpdateAllLifecyclePhases(); + + EXPECT_FALSE(layer->HasCompositedLayerMapping()); +} + TEST_F(RootScrollerTest, TestSetRootScrollerCausesViewportLayerChange) { // TODO(bokan): Need a test that changing root scrollers actually sets the // outer viewport layer on the compositor, even in the absence of other
diff --git a/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp b/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp index 5ac808b..9477b96 100644 --- a/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp +++ b/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
@@ -972,7 +972,6 @@ NavigateTo(base_url_ + "has-non-layer-viewport-constrained-objects.html"); ForceFullCompositingUpdate(); - LOG(ERROR) << GetFrame()->View()->GetMainThreadScrollingReasons(); Element* element = GetFrame()->GetDocument()->getElementById("scrollable"); ASSERT_TRUE(element); @@ -984,11 +983,7 @@ ->LayerForScrolling(); WebLayer* web_scroll_layer; - if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { - // When RLS is enabled, the LayoutView won't have a scrolling contents - // because it does not overflow. - ASSERT_FALSE(scroll_layer); - } else { + if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { ASSERT_TRUE(scroll_layer); web_scroll_layer = scroll_layer->PlatformLayer(); ASSERT_TRUE(web_scroll_layer->Scrollable()); @@ -1029,11 +1024,7 @@ scroll_layer = layout_object->GetFrameView() ->LayoutViewportScrollableArea() ->LayerForScrolling(); - if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { - // When RLS is enabled, the LayoutView won't have a scrolling contents - // because it does not overflow. - ASSERT_FALSE(scroll_layer); - } else { + if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { ASSERT_TRUE(scroll_layer); web_scroll_layer = scroll_layer->PlatformLayer(); ASSERT_TRUE(web_scroll_layer->Scrollable());
diff --git a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp index 7bc48f4..76963e3 100644 --- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp +++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
@@ -229,7 +229,7 @@ WebViewImpl()->Resize(size); // Scroll layout viewport and verify visibleContentRect. - WebViewImpl()->MainFrame()->SetScrollOffset(WebSize(0, 50)); + WebViewImpl()->MainFrameImpl()->SetScrollOffset(WebSize(0, 50)); VisualViewport& visual_viewport = GetFrame()->GetPage()->GetVisualViewport(); EXPECT_EQ(IntRect(IntPoint(0, 0), size - scrollbar_size), @@ -330,7 +330,7 @@ WebViewImpl()->Resize(IntSize(100, 200)); // Scroll main frame to the bottom of the document - WebViewImpl()->MainFrame()->SetScrollOffset(WebSize(0, 400)); + WebViewImpl()->MainFrameImpl()->SetScrollOffset(WebSize(0, 400)); EXPECT_SIZE_EQ( ScrollOffset(0, 400), GetFrame()->View()->LayoutViewportScrollableArea()->GetScrollOffset()); @@ -2393,7 +2393,7 @@ const RasterInvalidationTracking* invalidation_tracking = document->GetLayoutView() ->Layer() - ->GraphicsLayerBacking() + ->GraphicsLayerBacking(document->GetLayoutView()) ->GetRasterInvalidationTracking(); ASSERT_TRUE(invalidation_tracking); const auto* raster_invalidations = &invalidation_tracking->invalidations;
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp index aba3857..fb67c0a 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -3036,8 +3036,7 @@ (should_scale_relative_to_viewport_width ? 1 / aspect_ratio : 1); EXPECT_NEAR(expected_page_scale_factor, web_view_helper.WebView()->PageScaleFactor(), 0.05f); - EXPECT_EQ(WebSize(), - web_view_helper.WebView()->MainFrame()->GetScrollOffset()); + EXPECT_EQ(WebSize(), web_view_helper.LocalMainFrame()->GetScrollOffset()); } // Resizing just the height should not affect pageScaleFactor or @@ -3046,22 +3045,22 @@ web_view_helper.Resize( WebSize(viewport_size.width, viewport_size.height)); web_view_helper.WebView()->SetPageScaleFactor(initial_page_scale_factor); - web_view_helper.WebView()->MainFrame()->SetScrollOffset(scroll_offset); + web_view_helper.LocalMainFrame()->SetScrollOffset(scroll_offset); web_view_helper.WebView()->UpdateAllLifecyclePhases(); const WebSize expected_scroll_offset = - web_view_helper.WebView()->MainFrame()->GetScrollOffset(); + web_view_helper.LocalMainFrame()->GetScrollOffset(); web_view_helper.Resize( WebSize(viewport_size.width, viewport_size.height * 0.8f)); EXPECT_EQ(initial_page_scale_factor, web_view_helper.WebView()->PageScaleFactor()); EXPECT_EQ(expected_scroll_offset, - web_view_helper.WebView()->MainFrame()->GetScrollOffset()); + web_view_helper.LocalMainFrame()->GetScrollOffset()); web_view_helper.Resize( WebSize(viewport_size.width, viewport_size.height * 0.8f)); EXPECT_EQ(initial_page_scale_factor, web_view_helper.WebView()->PageScaleFactor()); EXPECT_EQ(expected_scroll_offset, - web_view_helper.WebView()->MainFrame()->GetScrollOffset()); + web_view_helper.LocalMainFrame()->GetScrollOffset()); } } }; @@ -3229,7 +3228,7 @@ WebPoint scroll, float scale) { web_view->SetPageScaleFactor(scale); - web_view->MainFrame()->SetScrollOffset(WebSize(scroll.x, scroll.y)); + web_view->MainFrameImpl()->SetScrollOffset(WebSize(scroll.x, scroll.y)); web_view->UpdateAllLifecyclePhases(); } @@ -4230,7 +4229,7 @@ FrameTestHelpers::WebViewHelper web_view_helper; web_view_helper.InitializeAndLoad(base_url_ + first_url, &client); web_view_helper.Resize(WebSize(kPageWidth, kPageHeight)); - web_view_helper.WebView()->MainFrame()->SetScrollOffset( + web_view_helper.LocalMainFrame()->SetScrollOffset( WebSize(kPageWidth / 4, kPageHeight / 4)); web_view_helper.WebView()->SetPageScaleFactor(kPageScaleFactor); @@ -4239,9 +4238,8 @@ ToKURL(base_url_ + first_url), WebFrameLoadType::kReload); FrameTestHelpers::PumpPendingRequestsForFrameToLoad( web_view_helper.WebView()->MainFrame()); - EXPECT_EQ(0, web_view_helper.WebView()->MainFrame()->GetScrollOffset().width); - EXPECT_EQ(0, - web_view_helper.WebView()->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(0, web_view_helper.LocalMainFrame()->GetScrollOffset().width); + EXPECT_EQ(0, web_view_helper.LocalMainFrame()->GetScrollOffset().height); EXPECT_EQ(1.0f, web_view_helper.WebView()->PageScaleFactor()); // Reload the page using the cache. State should not be propagated. @@ -4249,9 +4247,8 @@ ToKURL(base_url_ + second_url), WebFrameLoadType::kReload); FrameTestHelpers::PumpPendingRequestsForFrameToLoad( web_view_helper.WebView()->MainFrame()); - EXPECT_EQ(0, web_view_helper.WebView()->MainFrame()->GetScrollOffset().width); - EXPECT_EQ(0, - web_view_helper.WebView()->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(0, web_view_helper.LocalMainFrame()->GetScrollOffset().width); + EXPECT_EQ(0, web_view_helper.LocalMainFrame()->GetScrollOffset().height); EXPECT_EQ(1.0f, web_view_helper.WebView()->PageScaleFactor()); // Reload the page while bypassing the cache. State should not be propagated. @@ -4259,9 +4256,8 @@ ToKURL(base_url_ + third_url), WebFrameLoadType::kReloadBypassingCache); FrameTestHelpers::PumpPendingRequestsForFrameToLoad( web_view_helper.WebView()->MainFrame()); - EXPECT_EQ(0, web_view_helper.WebView()->MainFrame()->GetScrollOffset().width); - EXPECT_EQ(0, - web_view_helper.WebView()->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(0, web_view_helper.LocalMainFrame()->GetScrollOffset().width); + EXPECT_EQ(0, web_view_helper.LocalMainFrame()->GetScrollOffset().height); EXPECT_EQ(1.0f, web_view_helper.WebView()->PageScaleFactor()); } @@ -6323,7 +6319,7 @@ web_view_helper.Resize(WebSize(100, 200)); // Scroll main frame to the bottom of the document - web_view_impl->MainFrame()->SetScrollOffset(WebSize(0, 400)); + web_view_impl->MainFrameImpl()->SetScrollOffset(WebSize(0, 400)); EXPECT_SIZE_EQ(ScrollOffset(0, 400), frame->View()->GetScrollOffset()); web_view_impl->SetPageScaleFactor(2.0); @@ -7896,7 +7892,7 @@ web_view->SetPageScaleFactor(2.0f); web_view->UpdateAllLifecyclePhases(); - web_view->MainFrame()->SetScrollOffset(WebSize(0, 2000)); + web_view->MainFrameImpl()->SetScrollOffset(WebSize(0, 2000)); EXPECT_SIZE_EQ(ScrollOffset(0, 1900), frame_view->GetScrollOffset()); // Simulate the browser controls showing by 20px, thus shrinking the viewport @@ -7908,7 +7904,7 @@ // Show more, make sure the scroll actually gets clamped. web_view->ApplyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.0f, 20.0f / browser_controls_height); - web_view->MainFrame()->SetScrollOffset(WebSize(0, 2000)); + web_view->MainFrameImpl()->SetScrollOffset(WebSize(0, 2000)); EXPECT_SIZE_EQ(ScrollOffset(0, 1940), frame_view->GetScrollOffset()); // Hide until there's 10px showing.
diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp index 0d94a87..4a8579c92 100644 --- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -1329,8 +1329,8 @@ web_view_helper_.InitializeAndLoad(base_url_ + "form_with_input.html"); web_view->Resize(WebSize(800, 600)); web_view->SetInitialFocus(false); - EXPECT_EQ(0, web_view->MainFrame()->GetScrollOffset().width); - EXPECT_EQ(0, web_view->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(0, web_view->MainFrameImpl()->GetScrollOffset().width); + EXPECT_EQ(0, web_view->MainFrameImpl()->GetScrollOffset().height); // Set up a composition from existing text that needs to be committed. Vector<CompositionUnderline> empty_underlines; @@ -1342,8 +1342,8 @@ Element* element = static_cast<Element*>( web_view->MainFrame()->GetDocument().GetElementById("btn")); element->scrollIntoView(); - float offset_height = web_view->MainFrame()->GetScrollOffset().height; - EXPECT_EQ(0, web_view->MainFrame()->GetScrollOffset().width); + float offset_height = web_view->MainFrameImpl()->GetScrollOffset().height; + EXPECT_EQ(0, web_view->MainFrameImpl()->GetScrollOffset().width); EXPECT_LT(0, offset_height); WebTextInputInfo info = frame->GetInputMethodController()->TextInputInfo(); @@ -1353,8 +1353,8 @@ frame->FrameWidget() ->GetActiveWebInputMethodController() ->FinishComposingText(WebInputMethodController::kDoNotKeepSelection); - EXPECT_EQ(0, web_view->MainFrame()->GetScrollOffset().width); - EXPECT_EQ(offset_height, web_view->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(0, web_view->MainFrameImpl()->GetScrollOffset().width); + EXPECT_EQ(offset_height, web_view->MainFrameImpl()->GetScrollOffset().height); } TEST_P(WebViewTest, InsertNewLinePlacementAfterFinishComposingText) { @@ -1662,15 +1662,15 @@ web_view_helper_.InitializeAndLoad(base_url_ + "200-by-300.html"); web_view_impl->Resize(WebSize(100, 150)); web_view_impl->UpdateAllLifecyclePhases(); - EXPECT_EQ(0, web_view_impl->MainFrame()->GetScrollOffset().width); - EXPECT_EQ(0, web_view_impl->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().width); + EXPECT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().height); // Make the page scale and scroll with the given paremeters. web_view_impl->SetPageScaleFactor(2.0f); - web_view_impl->MainFrame()->SetScrollOffset(WebSize(94, 111)); + web_view_impl->MainFrameImpl()->SetScrollOffset(WebSize(94, 111)); EXPECT_EQ(2.0f, web_view_impl->PageScaleFactor()); - EXPECT_EQ(94, web_view_impl->MainFrame()->GetScrollOffset().width); - EXPECT_EQ(111, web_view_impl->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(94, web_view_impl->MainFrameImpl()->GetScrollOffset().width); + EXPECT_EQ(111, web_view_impl->MainFrameImpl()->GetScrollOffset().height); LocalFrame* main_frame_local = ToLocalFrame(web_view_impl->GetPage()->MainFrame()); main_frame_local->Loader().SaveScrollState(); @@ -1692,8 +1692,8 @@ // Confirm that resetting the page state resets the saved scroll position. web_view_impl->ResetScrollAndScaleState(); EXPECT_EQ(1.0f, web_view_impl->PageScaleFactor()); - EXPECT_EQ(0, web_view_impl->MainFrame()->GetScrollOffset().width); - EXPECT_EQ(0, web_view_impl->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().width); + EXPECT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().height); EXPECT_EQ(1.0f, main_frame_local->Loader() .GetDocumentLoader() ->GetHistoryItem() @@ -1718,7 +1718,7 @@ web_view_impl->UpdateAllLifecyclePhases(); // Emulate a user scroll - web_view_impl->MainFrame()->SetScrollOffset(WebSize(0, 900)); + web_view_impl->MainFrameImpl()->SetScrollOffset(WebSize(0, 900)); LocalFrame* main_frame_local = ToLocalFrame(web_view_impl->GetPage()->MainFrame()); Persistent<HistoryItem> item1 = @@ -1762,8 +1762,8 @@ FrameLoadRequest(nullptr, item3->GenerateResourceRequest( WebCachePolicy::kUseProtocolCachePolicy)), kFrameLoadTypeBackForward, item3.Get(), kHistorySameDocumentLoad); - EXPECT_EQ(0, web_view_impl->MainFrame()->GetScrollOffset().width); - EXPECT_GT(web_view_impl->MainFrame()->GetScrollOffset().height, 2000); + EXPECT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().width); + EXPECT_GT(web_view_impl->MainFrameImpl()->GetScrollOffset().height, 2000); } // Tests that we restore scroll and scale *after* the fullscreen styles are @@ -1776,8 +1776,8 @@ web_view_impl->UpdateAllLifecyclePhases(); // Scroll the page down. - web_view_impl->MainFrame()->SetScrollOffset(WebSize(0, 2000)); - ASSERT_EQ(2000, web_view_impl->MainFrame()->GetScrollOffset().height); + web_view_impl->MainFrameImpl()->SetScrollOffset(WebSize(0, 2000)); + ASSERT_EQ(2000, web_view_impl->MainFrameImpl()->GetScrollOffset().height); // Enter fullscreen. Document* document = @@ -1789,7 +1789,7 @@ web_view_impl->UpdateAllLifecyclePhases(); // Sanity-check. There should be no scrolling possible. - ASSERT_EQ(0, web_view_impl->MainFrame()->GetScrollOffset().height); + ASSERT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().height); ASSERT_EQ(0, web_view_impl->MainFrameImpl() ->GetFrameView() ->MaximumScrollOffset() @@ -1803,7 +1803,7 @@ EXPECT_TRUE(web_view_impl->MainFrameImpl()->GetFrameView()->NeedsLayout()); web_view_impl->UpdateAllLifecyclePhases(); - EXPECT_EQ(2000, web_view_impl->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(2000, web_view_impl->MainFrameImpl()->GetScrollOffset().height); } // Tests that exiting and immediately reentering fullscreen doesn't cause the @@ -1816,8 +1816,8 @@ web_view_impl->UpdateAllLifecyclePhases(); // Scroll the page down. - web_view_impl->MainFrame()->SetScrollOffset(WebSize(0, 2000)); - ASSERT_EQ(2000, web_view_impl->MainFrame()->GetScrollOffset().height); + web_view_impl->MainFrameImpl()->SetScrollOffset(WebSize(0, 2000)); + ASSERT_EQ(2000, web_view_impl->MainFrameImpl()->GetScrollOffset().height); // Enter fullscreen. Document* document = @@ -1829,7 +1829,7 @@ web_view_impl->UpdateAllLifecyclePhases(); // Sanity-check. There should be no scrolling possible. - ASSERT_EQ(0, web_view_impl->MainFrame()->GetScrollOffset().height); + ASSERT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().height); ASSERT_EQ(0, web_view_impl->MainFrameImpl() ->GetFrameView() ->MaximumScrollOffset() @@ -1844,7 +1844,7 @@ web_view_impl->UpdateAllLifecyclePhases(); // Sanity-check. There should be no scrolling possible. - ASSERT_EQ(0, web_view_impl->MainFrame()->GetScrollOffset().height); + ASSERT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().height); ASSERT_EQ(0, web_view_impl->MainFrameImpl() ->GetFrameView() ->MaximumScrollOffset() @@ -1854,7 +1854,7 @@ web_view_impl->DidExitFullscreen(); web_view_impl->UpdateAllLifecyclePhases(); - EXPECT_EQ(2000, web_view_impl->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(2000, web_view_impl->MainFrameImpl()->GetScrollOffset().height); } TEST_P(WebViewTest, EnterFullscreenResetScrollAndScaleState) { @@ -1863,16 +1863,16 @@ web_view_helper_.InitializeAndLoad(base_url_ + "200-by-300.html"); web_view_impl->Resize(WebSize(100, 150)); web_view_impl->UpdateAllLifecyclePhases(); - EXPECT_EQ(0, web_view_impl->MainFrame()->GetScrollOffset().width); - EXPECT_EQ(0, web_view_impl->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().width); + EXPECT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().height); // Make the page scale and scroll with the given paremeters. web_view_impl->SetPageScaleFactor(2.0f); - web_view_impl->MainFrame()->SetScrollOffset(WebSize(94, 111)); + web_view_impl->MainFrameImpl()->SetScrollOffset(WebSize(94, 111)); web_view_impl->SetVisualViewportOffset(WebFloatPoint(12, 20)); EXPECT_EQ(2.0f, web_view_impl->PageScaleFactor()); - EXPECT_EQ(94, web_view_impl->MainFrame()->GetScrollOffset().width); - EXPECT_EQ(111, web_view_impl->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(94, web_view_impl->MainFrameImpl()->GetScrollOffset().width); + EXPECT_EQ(111, web_view_impl->MainFrameImpl()->GetScrollOffset().height); EXPECT_EQ(12, web_view_impl->VisualViewportOffset().x); EXPECT_EQ(20, web_view_impl->VisualViewportOffset().y); @@ -1896,8 +1896,8 @@ web_view_impl->UpdateAllLifecyclePhases(); EXPECT_EQ(2.0f, web_view_impl->PageScaleFactor()); - EXPECT_EQ(94, web_view_impl->MainFrame()->GetScrollOffset().width); - EXPECT_EQ(111, web_view_impl->MainFrame()->GetScrollOffset().height); + EXPECT_EQ(94, web_view_impl->MainFrameImpl()->GetScrollOffset().width); + EXPECT_EQ(111, web_view_impl->MainFrameImpl()->GetScrollOffset().height); EXPECT_EQ(12, web_view_impl->VisualViewportOffset().x); EXPECT_EQ(20, web_view_impl->VisualViewportOffset().y); }
diff --git a/third_party/WebKit/public/web/WebFrame.h b/third_party/WebKit/public/web/WebFrame.h index 54a433c7..f385d6dac 100644 --- a/third_party/WebKit/public/web/WebFrame.h +++ b/third_party/WebKit/public/web/WebFrame.h
@@ -140,10 +140,6 @@ // NOTE: These routines do not force page layout so their results may // not be accurate if the page layout is out-of-date. - // The scroll offset from the top-left corner of the frame in pixels. - virtual WebSize GetScrollOffset() const = 0; - virtual void SetScrollOffset(const WebSize&) = 0; - // The size of the contents area. virtual WebSize ContentsSize() const = 0;
diff --git a/third_party/WebKit/public/web/WebLocalFrame.h b/third_party/WebKit/public/web/WebLocalFrame.h index cc4d818..0e48d686 100644 --- a/third_party/WebKit/public/web/WebLocalFrame.h +++ b/third_party/WebKit/public/web/WebLocalFrame.h
@@ -701,6 +701,10 @@ // Geometry ----------------------------------------------------------------- + // The scroll offset from the top-left corner of the frame in pixels. + virtual WebSize GetScrollOffset() const = 0; + virtual void SetScrollOffset(const WebSize&) = 0; + // If set to false, do not draw scrollbars on this frame's view. virtual void SetCanHaveScrollbars(bool) = 0;
diff --git a/third_party/wayland-protocols/README.chromium b/third_party/wayland-protocols/README.chromium index 254c0de..b4dcdbfe4 100644 --- a/third_party/wayland-protocols/README.chromium +++ b/third_party/wayland-protocols/README.chromium
@@ -1,6 +1,6 @@ Name: wayland-protocols URL: http://wayland.freedesktop.org/ -Version: 1.7 +Version: 1.8 License: MIT License File: src/COPYING Security Critical: yes @@ -13,7 +13,7 @@ wayland-protocols. To import a new snapshot of wayland-protocols: -- Checkout the latest release tag: git checkout 1.7 +- Checkout the latest release tag: git checkout 1.8 - Change the DEPS entry to the newly checked out commit. - Update generated files: wayland-scanner code < src/unstable/xdg-shell/xdg-shell-unstable-v5.xml > protocol/xdg-shell-v5-protocol.c
diff --git a/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-client-protocol.h b/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-client-protocol.h index 92a72f0..ed191fc 100644 --- a/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef ALPHA_COMPOSITING_UNSTABLE_V1_CLIENT_PROTOCOL_H #define ALPHA_COMPOSITING_UNSTABLE_V1_CLIENT_PROTOCOL_H @@ -124,17 +124,18 @@ }; #endif /* ZCR_ALPHA_COMPOSITING_V1_ERROR_ENUM */ -#define ZCR_ALPHA_COMPOSITING_V1_DESTROY 0 -#define ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING 1 +#define ZCR_ALPHA_COMPOSITING_V1_DESTROY 0 +#define ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING 1 + /** * @ingroup iface_zcr_alpha_compositing_v1 */ -#define ZCR_ALPHA_COMPOSITING_V1_DESTROY_SINCE_VERSION 1 +#define ZCR_ALPHA_COMPOSITING_V1_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zcr_alpha_compositing_v1 */ -#define ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING_SINCE_VERSION 1 +#define ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING_SINCE_VERSION 1 /** @ingroup iface_zcr_alpha_compositing_v1 */ static inline void @@ -215,22 +216,23 @@ }; #endif /* ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM */ -#define ZCR_BLENDING_V1_DESTROY 0 -#define ZCR_BLENDING_V1_SET_BLENDING 1 -#define ZCR_BLENDING_V1_SET_ALPHA 2 +#define ZCR_BLENDING_V1_DESTROY 0 +#define ZCR_BLENDING_V1_SET_BLENDING 1 +#define ZCR_BLENDING_V1_SET_ALPHA 2 + /** * @ingroup iface_zcr_blending_v1 */ -#define ZCR_BLENDING_V1_DESTROY_SINCE_VERSION 1 +#define ZCR_BLENDING_V1_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zcr_blending_v1 */ -#define ZCR_BLENDING_V1_SET_BLENDING_SINCE_VERSION 1 +#define ZCR_BLENDING_V1_SET_BLENDING_SINCE_VERSION 1 /** * @ingroup iface_zcr_blending_v1 */ -#define ZCR_BLENDING_V1_SET_ALPHA_SINCE_VERSION 1 +#define ZCR_BLENDING_V1_SET_ALPHA_SINCE_VERSION 1 /** @ingroup iface_zcr_blending_v1 */ static inline void
diff --git a/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-server-protocol.h b/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-server-protocol.h index db8fc950..0a3d24b 100644 --- a/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef ALPHA_COMPOSITING_UNSTABLE_V1_SERVER_PROTOCOL_H #define ALPHA_COMPOSITING_UNSTABLE_V1_SERVER_PROTOCOL_H @@ -158,6 +158,15 @@ }; +/** + * @ingroup iface_zcr_alpha_compositing_v1 + */ +#define ZCR_ALPHA_COMPOSITING_V1_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zcr_alpha_compositing_v1 + */ +#define ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING_SINCE_VERSION 1 + #ifndef ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM #define ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM /** @@ -224,6 +233,19 @@ }; +/** + * @ingroup iface_zcr_blending_v1 + */ +#define ZCR_BLENDING_V1_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zcr_blending_v1 + */ +#define ZCR_BLENDING_V1_SET_BLENDING_SINCE_VERSION 1 +/** + * @ingroup iface_zcr_blending_v1 + */ +#define ZCR_BLENDING_V1_SET_ALPHA_SINCE_VERSION 1 + #ifdef __cplusplus } #endif
diff --git a/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-client-protocol.h b/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-client-protocol.h index d5eac5e..66301bd 100644 --- a/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef GAMING_INPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H #define GAMING_INPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H @@ -102,6 +102,7 @@ #define ZCR_GAMING_INPUT_V1_GET_GAMEPAD 0 + /** * @ingroup iface_zcr_gaming_input_v1 */
diff --git a/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-server-protocol.h b/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-server-protocol.h index fb68f969..7d065e0 100644 --- a/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef GAMING_INPUT_UNSTABLE_V1_SERVER_PROTOCOL_H #define GAMING_INPUT_UNSTABLE_V1_SERVER_PROTOCOL_H @@ -108,18 +108,19 @@ * @struct zcr_gaming_input_v1_interface */ struct zcr_gaming_input_v1_interface { - /** - * get gamepad device assigned to seat - * - * Create gamepad object. See zcr_gamepad_v1 interface for - * details. - */ - void (*get_gamepad)(struct wl_client* client, - struct wl_resource* resource, - uint32_t id, - struct wl_resource* seat); + /** + * get gamepad device assigned to seat + * + * Create gamepad object. See zcr_gamepad_v1 interface for + * details. + */ + void (*get_gamepad)(struct wl_client *client, + struct wl_resource *resource, + uint32_t id, + struct wl_resource *seat); }; + /** * @ingroup iface_zcr_gaming_input_v1 */
diff --git a/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-client-protocol.h b/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-client-protocol.h index 8a7f0946..1c74e34 100644 --- a/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-client-protocol.h
@@ -1,23 +1,22 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef GAMING_INPUT_UNSTABLE_V2_CLIENT_PROTOCOL_H #define GAMING_INPUT_UNSTABLE_V2_CLIENT_PROTOCOL_H -#include <stddef.h> #include <stdint.h> +#include <stddef.h> #include "wayland-client.h" -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif /** * @page page_gaming_input_unstable_v2 The gaming_input_unstable_v2 protocol * @section page_ifaces_gaming_input_unstable_v2 Interfaces - * - @subpage page_iface_zcr_gaming_input_v2 - extends wl_seat with gaming input - * devices - @subpage page_iface_zcr_gaming_seat_v2 - controller object for all - * gaming devices of a seat - @subpage page_iface_zcr_gamepad_v2 - gamepad input - * device + * - @subpage page_iface_zcr_gaming_input_v2 - extends wl_seat with gaming input devices + * - @subpage page_iface_zcr_gaming_seat_v2 - controller object for all gaming devices of a seat + * - @subpage page_iface_zcr_gamepad_v2 - gamepad input device * @section page_copyright_gaming_input_unstable_v2 Copyright * <pre> * @@ -122,6 +121,7 @@ #define ZCR_GAMING_INPUT_V2_GET_GAMING_SEAT 0 #define ZCR_GAMING_INPUT_V2_DESTROY 1 + /** * @ingroup iface_zcr_gaming_input_v2 */ @@ -132,21 +132,23 @@ #define ZCR_GAMING_INPUT_V2_DESTROY_SINCE_VERSION 1 /** @ingroup iface_zcr_gaming_input_v2 */ -static inline void zcr_gaming_input_v2_set_user_data( - struct zcr_gaming_input_v2* zcr_gaming_input_v2, - void* user_data) { - wl_proxy_set_user_data((struct wl_proxy*)zcr_gaming_input_v2, user_data); +static inline void +zcr_gaming_input_v2_set_user_data(struct zcr_gaming_input_v2 *zcr_gaming_input_v2, void *user_data) +{ + wl_proxy_set_user_data((struct wl_proxy *) zcr_gaming_input_v2, user_data); } /** @ingroup iface_zcr_gaming_input_v2 */ -static inline void* zcr_gaming_input_v2_get_user_data( - struct zcr_gaming_input_v2* zcr_gaming_input_v2) { - return wl_proxy_get_user_data((struct wl_proxy*)zcr_gaming_input_v2); +static inline void * +zcr_gaming_input_v2_get_user_data(struct zcr_gaming_input_v2 *zcr_gaming_input_v2) +{ + return wl_proxy_get_user_data((struct wl_proxy *) zcr_gaming_input_v2); } -static inline uint32_t zcr_gaming_input_v2_get_version( - struct zcr_gaming_input_v2* zcr_gaming_input_v2) { - return wl_proxy_get_version((struct wl_proxy*)zcr_gaming_input_v2); +static inline uint32_t +zcr_gaming_input_v2_get_version(struct zcr_gaming_input_v2 *zcr_gaming_input_v2) +{ + return wl_proxy_get_version((struct wl_proxy *) zcr_gaming_input_v2); } /** @@ -155,17 +157,15 @@ * Get a gaming seat object for a given seat. Gaming seat provides access * to gaming devices */ -static inline struct zcr_gaming_seat_v2* zcr_gaming_input_v2_get_gaming_seat( - struct zcr_gaming_input_v2* zcr_gaming_input_v2, - struct wl_seat* seat) { - struct wl_proxy* gaming_seat; +static inline struct zcr_gaming_seat_v2 * +zcr_gaming_input_v2_get_gaming_seat(struct zcr_gaming_input_v2 *zcr_gaming_input_v2, struct wl_seat *seat) +{ + struct wl_proxy *gaming_seat; - gaming_seat = - wl_proxy_marshal_constructor((struct wl_proxy*)zcr_gaming_input_v2, - ZCR_GAMING_INPUT_V2_GET_GAMING_SEAT, - &zcr_gaming_seat_v2_interface, NULL, seat); + gaming_seat = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_gaming_input_v2, + ZCR_GAMING_INPUT_V2_GET_GAMING_SEAT, &zcr_gaming_seat_v2_interface, NULL, seat); - return (struct zcr_gaming_seat_v2*)gaming_seat; + return (struct zcr_gaming_seat_v2 *) gaming_seat; } /** @@ -174,12 +174,13 @@ * Destroy gaming_input object. Objects created from this object are * unaffected and should be destroyed separately. */ -static inline void zcr_gaming_input_v2_destroy( - struct zcr_gaming_input_v2* zcr_gaming_input_v2) { - wl_proxy_marshal((struct wl_proxy*)zcr_gaming_input_v2, - ZCR_GAMING_INPUT_V2_DESTROY); +static inline void +zcr_gaming_input_v2_destroy(struct zcr_gaming_input_v2 *zcr_gaming_input_v2) +{ + wl_proxy_marshal((struct wl_proxy *) zcr_gaming_input_v2, + ZCR_GAMING_INPUT_V2_DESTROY); - wl_proxy_destroy((struct wl_proxy*)zcr_gaming_input_v2); + wl_proxy_destroy((struct wl_proxy *) zcr_gaming_input_v2); } /** @@ -187,26 +188,26 @@ * @struct zcr_gaming_seat_v2_listener */ struct zcr_gaming_seat_v2_listener { - /** - * gamepad added event - * - * Notification that there is gamepad connected at this seat. - * @param gamepad new connected gamepad - */ - void (*gamepad_added)(void* data, - struct zcr_gaming_seat_v2* zcr_gaming_seat_v2, - struct zcr_gamepad_v2* gamepad); + /** + * gamepad added event + * + * Notification that there is gamepad connected at this seat. + * @param gamepad new connected gamepad + */ + void (*gamepad_added)(void *data, + struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2, + struct zcr_gamepad_v2 *gamepad); }; /** * @ingroup iface_zcr_gaming_seat_v2 */ -static inline int zcr_gaming_seat_v2_add_listener( - struct zcr_gaming_seat_v2* zcr_gaming_seat_v2, - const struct zcr_gaming_seat_v2_listener* listener, - void* data) { - return wl_proxy_add_listener((struct wl_proxy*)zcr_gaming_seat_v2, - (void (**)(void))listener, data); +static inline int +zcr_gaming_seat_v2_add_listener(struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2, + const struct zcr_gaming_seat_v2_listener *listener, void *data) +{ + return wl_proxy_add_listener((struct wl_proxy *) zcr_gaming_seat_v2, + (void (**)(void)) listener, data); } #define ZCR_GAMING_SEAT_V2_DESTROY 0 @@ -222,21 +223,23 @@ #define ZCR_GAMING_SEAT_V2_DESTROY_SINCE_VERSION 1 /** @ingroup iface_zcr_gaming_seat_v2 */ -static inline void zcr_gaming_seat_v2_set_user_data( - struct zcr_gaming_seat_v2* zcr_gaming_seat_v2, - void* user_data) { - wl_proxy_set_user_data((struct wl_proxy*)zcr_gaming_seat_v2, user_data); +static inline void +zcr_gaming_seat_v2_set_user_data(struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2, void *user_data) +{ + wl_proxy_set_user_data((struct wl_proxy *) zcr_gaming_seat_v2, user_data); } /** @ingroup iface_zcr_gaming_seat_v2 */ -static inline void* zcr_gaming_seat_v2_get_user_data( - struct zcr_gaming_seat_v2* zcr_gaming_seat_v2) { - return wl_proxy_get_user_data((struct wl_proxy*)zcr_gaming_seat_v2); +static inline void * +zcr_gaming_seat_v2_get_user_data(struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2) +{ + return wl_proxy_get_user_data((struct wl_proxy *) zcr_gaming_seat_v2); } -static inline uint32_t zcr_gaming_seat_v2_get_version( - struct zcr_gaming_seat_v2* zcr_gaming_seat_v2) { - return wl_proxy_get_version((struct wl_proxy*)zcr_gaming_seat_v2); +static inline uint32_t +zcr_gaming_seat_v2_get_version(struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2) +{ + return wl_proxy_get_version((struct wl_proxy *) zcr_gaming_seat_v2); } /** @@ -245,12 +248,13 @@ * Destroy gaming_seat object. Objects created from this object are * unaffected and should be destroyed separately. */ -static inline void zcr_gaming_seat_v2_destroy( - struct zcr_gaming_seat_v2* zcr_gaming_seat_v2) { - wl_proxy_marshal((struct wl_proxy*)zcr_gaming_seat_v2, - ZCR_GAMING_SEAT_V2_DESTROY); +static inline void +zcr_gaming_seat_v2_destroy(struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2) +{ + wl_proxy_marshal((struct wl_proxy *) zcr_gaming_seat_v2, + ZCR_GAMING_SEAT_V2_DESTROY); - wl_proxy_destroy((struct wl_proxy*)zcr_gaming_seat_v2); + wl_proxy_destroy((struct wl_proxy *) zcr_gaming_seat_v2); } #ifndef ZCR_GAMEPAD_V2_BUTTON_STATE_ENUM @@ -263,14 +267,14 @@ * event. */ enum zcr_gamepad_v2_button_state { - /** - * the button is not pressed - */ - ZCR_GAMEPAD_V2_BUTTON_STATE_RELEASED = 0, - /** - * the button is pressed - */ - ZCR_GAMEPAD_V2_BUTTON_STATE_PRESSED = 1, + /** + * the button is not pressed + */ + ZCR_GAMEPAD_V2_BUTTON_STATE_RELEASED = 0, + /** + * the button is pressed + */ + ZCR_GAMEPAD_V2_BUTTON_STATE_PRESSED = 1, }; #endif /* ZCR_GAMEPAD_V2_BUTTON_STATE_ENUM */ @@ -279,79 +283,80 @@ * @struct zcr_gamepad_v2_listener */ struct zcr_gamepad_v2_listener { - /** - * gamepad removed - * - * Removed event is send when the gamepad is disconnected. The - * client should expect no more event and call destroy. - * - * This event cannot be used as destructor as requests (e.g. - * vibration) might be added to this interface. - */ - void (*removed)(void* data, struct zcr_gamepad_v2* zcr_gamepad_v2); - /** - * axis change event - * - * Notification of axis change. - * - * The axis id specifies which axis has changed as defined by the - * W3C 'Standard Gamepad'. - * - * The value is calibrated and normalized to the -1 to 1 range. - * @param time timestamp with millisecond granularity - * @param axis axis that produced this event - * @param value new value of axis - */ - void (*axis)(void* data, - struct zcr_gamepad_v2* zcr_gamepad_v2, - uint32_t time, - uint32_t axis, - wl_fixed_t value); - /** - * Gamepad button changed - * - * Notification of button change. - * - * The button id specifies which button has changed as defined by - * the W3C 'Standard Gamepad'. - * - * A button can have a digital and an analog value. The analog - * value is normalized to a 0 to 1 range. If a button does not - * provide an analog value, it will be derived from the digital - * state. - * @param time timestamp with millisecond granularity - * @param button id of button - * @param state digital state of the button - * @param analog analog value of the button - */ - void (*button)(void* data, - struct zcr_gamepad_v2* zcr_gamepad_v2, - uint32_t time, - uint32_t button, - uint32_t state, - wl_fixed_t analog); - /** - * Notifies end of a series of gamepad changes. - * - * Indicates the end of a set of events that logically belong - * together. A client is expected to accumulate the data in all - * events within the frame before proceeding. - * @param time timestamp with millisecond granularity - */ - void (*frame)(void* data, - struct zcr_gamepad_v2* zcr_gamepad_v2, - uint32_t time); + /** + * gamepad removed + * + * Removed event is send when the gamepad is disconnected. The + * client should expect no more event and call destroy. + * + * This event cannot be used as destructor as requests (e.g. + * vibration) might be added to this interface. + */ + void (*removed)(void *data, + struct zcr_gamepad_v2 *zcr_gamepad_v2); + /** + * axis change event + * + * Notification of axis change. + * + * The axis id specifies which axis has changed as defined by the + * W3C 'Standard Gamepad'. + * + * The value is calibrated and normalized to the -1 to 1 range. + * @param time timestamp with millisecond granularity + * @param axis axis that produced this event + * @param value new value of axis + */ + void (*axis)(void *data, + struct zcr_gamepad_v2 *zcr_gamepad_v2, + uint32_t time, + uint32_t axis, + wl_fixed_t value); + /** + * Gamepad button changed + * + * Notification of button change. + * + * The button id specifies which button has changed as defined by + * the W3C 'Standard Gamepad'. + * + * A button can have a digital and an analog value. The analog + * value is normalized to a 0 to 1 range. If a button does not + * provide an analog value, it will be derived from the digital + * state. + * @param time timestamp with millisecond granularity + * @param button id of button + * @param state digital state of the button + * @param analog analog value of the button + */ + void (*button)(void *data, + struct zcr_gamepad_v2 *zcr_gamepad_v2, + uint32_t time, + uint32_t button, + uint32_t state, + wl_fixed_t analog); + /** + * Notifies end of a series of gamepad changes. + * + * Indicates the end of a set of events that logically belong + * together. A client is expected to accumulate the data in all + * events within the frame before proceeding. + * @param time timestamp with millisecond granularity + */ + void (*frame)(void *data, + struct zcr_gamepad_v2 *zcr_gamepad_v2, + uint32_t time); }; /** * @ingroup iface_zcr_gamepad_v2 */ -static inline int zcr_gamepad_v2_add_listener( - struct zcr_gamepad_v2* zcr_gamepad_v2, - const struct zcr_gamepad_v2_listener* listener, - void* data) { - return wl_proxy_add_listener((struct wl_proxy*)zcr_gamepad_v2, - (void (**)(void))listener, data); +static inline int +zcr_gamepad_v2_add_listener(struct zcr_gamepad_v2 *zcr_gamepad_v2, + const struct zcr_gamepad_v2_listener *listener, void *data) +{ + return wl_proxy_add_listener((struct wl_proxy *) zcr_gamepad_v2, + (void (**)(void)) listener, data); } #define ZCR_GAMEPAD_V2_DESTROY 0 @@ -379,34 +384,38 @@ #define ZCR_GAMEPAD_V2_DESTROY_SINCE_VERSION 1 /** @ingroup iface_zcr_gamepad_v2 */ -static inline void zcr_gamepad_v2_set_user_data( - struct zcr_gamepad_v2* zcr_gamepad_v2, - void* user_data) { - wl_proxy_set_user_data((struct wl_proxy*)zcr_gamepad_v2, user_data); +static inline void +zcr_gamepad_v2_set_user_data(struct zcr_gamepad_v2 *zcr_gamepad_v2, void *user_data) +{ + wl_proxy_set_user_data((struct wl_proxy *) zcr_gamepad_v2, user_data); } /** @ingroup iface_zcr_gamepad_v2 */ -static inline void* zcr_gamepad_v2_get_user_data( - struct zcr_gamepad_v2* zcr_gamepad_v2) { - return wl_proxy_get_user_data((struct wl_proxy*)zcr_gamepad_v2); +static inline void * +zcr_gamepad_v2_get_user_data(struct zcr_gamepad_v2 *zcr_gamepad_v2) +{ + return wl_proxy_get_user_data((struct wl_proxy *) zcr_gamepad_v2); } -static inline uint32_t zcr_gamepad_v2_get_version( - struct zcr_gamepad_v2* zcr_gamepad_v2) { - return wl_proxy_get_version((struct wl_proxy*)zcr_gamepad_v2); +static inline uint32_t +zcr_gamepad_v2_get_version(struct zcr_gamepad_v2 *zcr_gamepad_v2) +{ + return wl_proxy_get_version((struct wl_proxy *) zcr_gamepad_v2); } /** * @ingroup iface_zcr_gamepad_v2 */ -static inline void zcr_gamepad_v2_destroy( - struct zcr_gamepad_v2* zcr_gamepad_v2) { - wl_proxy_marshal((struct wl_proxy*)zcr_gamepad_v2, ZCR_GAMEPAD_V2_DESTROY); +static inline void +zcr_gamepad_v2_destroy(struct zcr_gamepad_v2 *zcr_gamepad_v2) +{ + wl_proxy_marshal((struct wl_proxy *) zcr_gamepad_v2, + ZCR_GAMEPAD_V2_DESTROY); - wl_proxy_destroy((struct wl_proxy*)zcr_gamepad_v2); + wl_proxy_destroy((struct wl_proxy *) zcr_gamepad_v2); } -#ifdef __cplusplus +#ifdef __cplusplus } #endif
diff --git a/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-server-protocol.h b/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-server-protocol.h index 4a770d7e..eeba3aeb9 100644 --- a/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-server-protocol.h
@@ -1,13 +1,13 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef GAMING_INPUT_UNSTABLE_V2_SERVER_PROTOCOL_H #define GAMING_INPUT_UNSTABLE_V2_SERVER_PROTOCOL_H -#include <stddef.h> #include <stdint.h> +#include <stddef.h> #include "wayland-server.h" -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -17,10 +17,9 @@ /** * @page page_gaming_input_unstable_v2 The gaming_input_unstable_v2 protocol * @section page_ifaces_gaming_input_unstable_v2 Interfaces - * - @subpage page_iface_zcr_gaming_input_v2 - extends wl_seat with gaming input - * devices - @subpage page_iface_zcr_gaming_seat_v2 - controller object for all - * gaming devices of a seat - @subpage page_iface_zcr_gamepad_v2 - gamepad input - * device + * - @subpage page_iface_zcr_gaming_input_v2 - extends wl_seat with gaming input devices + * - @subpage page_iface_zcr_gaming_seat_v2 - controller object for all gaming devices of a seat + * - @subpage page_iface_zcr_gamepad_v2 - gamepad input device * @section page_copyright_gaming_input_unstable_v2 Copyright * <pre> * @@ -127,25 +126,27 @@ * @struct zcr_gaming_input_v2_interface */ struct zcr_gaming_input_v2_interface { - /** - * get a gaming seat - * - * Get a gaming seat object for a given seat. Gaming seat - * provides access to gaming devices - */ - void (*get_gaming_seat)(struct wl_client* client, - struct wl_resource* resource, - uint32_t gaming_seat, - struct wl_resource* seat); - /** - * release the memory for the gaming input object - * - * Destroy gaming_input object. Objects created from this object - * are unaffected and should be destroyed separately. - */ - void (*destroy)(struct wl_client* client, struct wl_resource* resource); + /** + * get a gaming seat + * + * Get a gaming seat object for a given seat. Gaming seat + * provides access to gaming devices + */ + void (*get_gaming_seat)(struct wl_client *client, + struct wl_resource *resource, + uint32_t gaming_seat, + struct wl_resource *seat); + /** + * release the memory for the gaming input object + * + * Destroy gaming_input object. Objects created from this object + * are unaffected and should be destroyed separately. + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); }; + /** * @ingroup iface_zcr_gaming_input_v2 */ @@ -160,13 +161,14 @@ * @struct zcr_gaming_seat_v2_interface */ struct zcr_gaming_seat_v2_interface { - /** - * release the memory for the gaming seat object - * - * Destroy gaming_seat object. Objects created from this object - * are unaffected and should be destroyed separately. - */ - void (*destroy)(struct wl_client* client, struct wl_resource* resource); + /** + * release the memory for the gaming seat object + * + * Destroy gaming_seat object. Objects created from this object + * are unaffected and should be destroyed separately. + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); }; #define ZCR_GAMING_SEAT_V2_GAMEPAD_ADDED 0 @@ -187,10 +189,10 @@ * @param resource_ The client's resource * @param gamepad new connected gamepad */ -static inline void zcr_gaming_seat_v2_send_gamepad_added( - struct wl_resource* resource_, - struct wl_resource* gamepad) { - wl_resource_post_event(resource_, ZCR_GAMING_SEAT_V2_GAMEPAD_ADDED, gamepad); +static inline void +zcr_gaming_seat_v2_send_gamepad_added(struct wl_resource *resource_, struct wl_resource *gamepad) +{ + wl_resource_post_event(resource_, ZCR_GAMING_SEAT_V2_GAMEPAD_ADDED, gamepad); } #ifndef ZCR_GAMEPAD_V2_BUTTON_STATE_ENUM @@ -203,14 +205,14 @@ * event. */ enum zcr_gamepad_v2_button_state { - /** - * the button is not pressed - */ - ZCR_GAMEPAD_V2_BUTTON_STATE_RELEASED = 0, - /** - * the button is pressed - */ - ZCR_GAMEPAD_V2_BUTTON_STATE_PRESSED = 1, + /** + * the button is not pressed + */ + ZCR_GAMEPAD_V2_BUTTON_STATE_RELEASED = 0, + /** + * the button is pressed + */ + ZCR_GAMEPAD_V2_BUTTON_STATE_PRESSED = 1, }; #endif /* ZCR_GAMEPAD_V2_BUTTON_STATE_ENUM */ @@ -219,12 +221,13 @@ * @struct zcr_gamepad_v2_interface */ struct zcr_gamepad_v2_interface { - /** - * destroy gamepad object - * - * - */ - void (*destroy)(struct wl_client* client, struct wl_resource* resource); + /** + * destroy gamepad object + * + * + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); }; #define ZCR_GAMEPAD_V2_REMOVED 0 @@ -259,8 +262,10 @@ * Sends an removed event to the client owning the resource. * @param resource_ The client's resource */ -static inline void zcr_gamepad_v2_send_removed(struct wl_resource* resource_) { - wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_REMOVED); +static inline void +zcr_gamepad_v2_send_removed(struct wl_resource *resource_) +{ + wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_REMOVED); } /** @@ -271,11 +276,10 @@ * @param axis axis that produced this event * @param value new value of axis */ -static inline void zcr_gamepad_v2_send_axis(struct wl_resource* resource_, - uint32_t time, - uint32_t axis, - wl_fixed_t value) { - wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_AXIS, time, axis, value); +static inline void +zcr_gamepad_v2_send_axis(struct wl_resource *resource_, uint32_t time, uint32_t axis, wl_fixed_t value) +{ + wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_AXIS, time, axis, value); } /** @@ -287,13 +291,10 @@ * @param state digital state of the button * @param analog analog value of the button */ -static inline void zcr_gamepad_v2_send_button(struct wl_resource* resource_, - uint32_t time, - uint32_t button, - uint32_t state, - wl_fixed_t analog) { - wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_BUTTON, time, button, state, - analog); +static inline void +zcr_gamepad_v2_send_button(struct wl_resource *resource_, uint32_t time, uint32_t button, uint32_t state, wl_fixed_t analog) +{ + wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_BUTTON, time, button, state, analog); } /** @@ -302,12 +303,13 @@ * @param resource_ The client's resource * @param time timestamp with millisecond granularity */ -static inline void zcr_gamepad_v2_send_frame(struct wl_resource* resource_, - uint32_t time) { - wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_FRAME, time); +static inline void +zcr_gamepad_v2_send_frame(struct wl_resource *resource_, uint32_t time) +{ + wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_FRAME, time); } -#ifdef __cplusplus +#ifdef __cplusplus } #endif
diff --git a/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-client-protocol.h b/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-client-protocol.h index 5939b44..5087c84 100644 --- a/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef KEYBOARD_CONFIGURATION_UNSTABLE_V1_CLIENT_PROTOCOL_H #define KEYBOARD_CONFIGURATION_UNSTABLE_V1_CLIENT_PROTOCOL_H @@ -106,12 +106,13 @@ }; #endif /* ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM */ -#define ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION 0 +#define ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION 0 + /** * @ingroup iface_zcr_keyboard_configuration_v1 */ -#define ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION_SINCE_VERSION 1 +#define ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION_SINCE_VERSION 1 /** @ingroup iface_zcr_keyboard_configuration_v1 */ static inline void @@ -198,7 +199,7 @@ }; /** - * @ingroup zcr_keyboard_device_configuration_v1_iface + * @ingroup iface_zcr_keyboard_device_configuration_v1 */ static inline int zcr_keyboard_device_configuration_v1_add_listener(struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1, @@ -208,12 +209,17 @@ (void (**)(void)) listener, data); } -#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY 0 +#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY 0 /** * @ingroup iface_zcr_keyboard_device_configuration_v1 */ -#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY_SINCE_VERSION 1 +#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_TYPE_CHANGE_SINCE_VERSION 1 + +/** + * @ingroup iface_zcr_keyboard_device_configuration_v1 + */ +#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY_SINCE_VERSION 1 /** @ingroup iface_zcr_keyboard_device_configuration_v1 */ static inline void
diff --git a/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-server-protocol.h b/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-server-protocol.h index 5dbb81e5..bf17f5e 100644 --- a/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef KEYBOARD_CONFIGURATION_UNSTABLE_V1_SERVER_PROTOCOL_H #define KEYBOARD_CONFIGURATION_UNSTABLE_V1_SERVER_PROTOCOL_H @@ -130,6 +130,11 @@ }; +/** + * @ingroup iface_zcr_keyboard_configuration_v1 + */ +#define ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION_SINCE_VERSION 1 + #ifndef ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_ENUM #define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_ENUM /** @@ -162,12 +167,17 @@ struct wl_resource *resource); }; -#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_TYPE_CHANGE 0 +#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_TYPE_CHANGE 0 /** * @ingroup iface_zcr_keyboard_device_configuration_v1 */ -#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_TYPE_CHANGE_SINCE_VERSION 1 +#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_TYPE_CHANGE_SINCE_VERSION 1 + +/** + * @ingroup iface_zcr_keyboard_device_configuration_v1 + */ +#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zcr_keyboard_device_configuration_v1
diff --git a/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-client-protocol.h b/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-client-protocol.h index 1436d8d..95e6f0a 100644 --- a/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef LINUX_DMABUF_UNSTABLE_V1_CLIENT_PROTOCOL_H #define LINUX_DMABUF_UNSTABLE_V1_CLIENT_PROTOCOL_H @@ -21,26 +21,24 @@ * * Copyright © 2014, 2015 Collabora, Ltd. * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation, and that the name of - * the copyright holders not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. * </pre> */ struct wl_buffer; @@ -55,9 +53,10 @@ * https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt * and the Linux DRM sub-system's AddFb2 ioctl. * - * This interface offers a way to create generic dmabuf-based + * This interface offers ways to create generic dmabuf-based * wl_buffers. Immediately after a client binds to this interface, - * the set of supported formats is sent with 'format' events. + * the set of supported formats and format modifiers is sent with + * 'format' and 'modifier' events. * * The following are required from clients: * @@ -81,10 +80,23 @@ * To create a wl_buffer from one or more dmabufs, a client creates a * zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params * request. All planes required by the intended format are added with - * the 'add' request. Finally, a 'create' request is issued. The server - * will reply with either a 'created' event which provides the final - * wl_buffer or a 'failed' event saying that it cannot use the dmabufs - * provided. + * the 'add' request. Finally, a 'create' or 'create_immed' request is + * issued, which has the following outcome depending on the import success. + * + * The 'create' request, + * - on success, triggers a 'created' event which provides the final + * wl_buffer to the client. + * - on failure, triggers a 'failed' event to convey that the server + * cannot use the dmabufs received from the client. + * + * For the 'create_immed' request, + * - on success, the server immediately imports the added dmabufs to + * create a wl_buffer. No event is sent from the server in this case. + * - on failure, the server can choose to either: + * - terminate the client by raising a fatal error. + * - mark the wl_buffer as failed, and send a 'failed' event to the + * client. If the client uses a failed wl_buffer as an argument to any + * request, the behaviour is compositor implementation-defined. * * Warning! The protocol described in this file is experimental and * backward incompatible changes may be made. Backward compatible changes @@ -104,9 +116,10 @@ * https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt * and the Linux DRM sub-system's AddFb2 ioctl. * - * This interface offers a way to create generic dmabuf-based + * This interface offers ways to create generic dmabuf-based * wl_buffers. Immediately after a client binds to this interface, - * the set of supported formats is sent with 'format' events. + * the set of supported formats and format modifiers is sent with + * 'format' and 'modifier' events. * * The following are required from clients: * @@ -130,10 +143,23 @@ * To create a wl_buffer from one or more dmabufs, a client creates a * zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params * request. All planes required by the intended format are added with - * the 'add' request. Finally, a 'create' request is issued. The server - * will reply with either a 'created' event which provides the final - * wl_buffer or a 'failed' event saying that it cannot use the dmabufs - * provided. + * the 'add' request. Finally, a 'create' or 'create_immed' request is + * issued, which has the following outcome depending on the import success. + * + * The 'create' request, + * - on success, triggers a 'created' event which provides the final + * wl_buffer to the client. + * - on failure, triggers a 'failed' event to convey that the server + * cannot use the dmabufs received from the client. + * + * For the 'create_immed' request, + * - on success, the server immediately imports the added dmabufs to + * create a wl_buffer. No event is sent from the server in this case. + * - on failure, the server can choose to either: + * - terminate the client by raising a fatal error. + * - mark the wl_buffer as failed, and send a 'failed' event to the + * client. If the client uses a failed wl_buffer as an argument to any + * request, the behaviour is compositor implementation-defined. * * Warning! The protocol described in this file is experimental and * backward incompatible changes may be made. Backward compatible changes @@ -199,18 +225,44 @@ * client binds to this interface. A roundtrip after binding * guarantees that the client has received all supported formats. * - * For the definition of the format codes, see create request. + * For the definition of the format codes, see the + * zwp_linux_buffer_params_v1::create request. * - * XXX: Can a compositor ever enumerate them? + * Warning: the 'format' event is likely to be deprecated and + * replaced with the 'modifier' event introduced in + * zwp_linux_dmabuf_v1 version 3, described below. Please refrain + * from using the information received from this event. * @param format DRM_FORMAT code */ void (*format)(void *data, struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1, uint32_t format); + /** + * supported buffer format modifier + * + * This event advertises the formats that the server supports, + * along with the modifiers supported for each format. All the + * supported modifiers for all the supported formats are advertised + * once when the client binds to this interface. A roundtrip after + * binding guarantees that the client has received all supported + * format-modifier pairs. + * + * For the definition of the format and modifier codes, see the + * zwp_linux_buffer_params_v1::create request. + * @param format DRM_FORMAT code + * @param modifier_hi high 32 bits of layout modifier + * @param modifier_lo low 32 bits of layout modifier + * @since 3 + */ + void (*modifier)(void *data, + struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1, + uint32_t format, + uint32_t modifier_hi, + uint32_t modifier_lo); }; /** - * @ingroup zwp_linux_dmabuf_v1_iface + * @ingroup iface_zwp_linux_dmabuf_v1 */ static inline int zwp_linux_dmabuf_v1_add_listener(struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1, @@ -220,17 +272,26 @@ (void (**)(void)) listener, data); } -#define ZWP_LINUX_DMABUF_V1_DESTROY 0 -#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS 1 +#define ZWP_LINUX_DMABUF_V1_DESTROY 0 +#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS 1 /** * @ingroup iface_zwp_linux_dmabuf_v1 */ -#define ZWP_LINUX_DMABUF_V1_DESTROY_SINCE_VERSION 1 +#define ZWP_LINUX_DMABUF_V1_FORMAT_SINCE_VERSION 1 /** * @ingroup iface_zwp_linux_dmabuf_v1 */ -#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS_SINCE_VERSION 1 +#define ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION 3 + +/** + * @ingroup iface_zwp_linux_dmabuf_v1 + */ +#define ZWP_LINUX_DMABUF_V1_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zwp_linux_dmabuf_v1 + */ +#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS_SINCE_VERSION 1 /** @ingroup iface_zwp_linux_dmabuf_v1 */ static inline void @@ -317,6 +378,10 @@ * offset + stride * height goes out of dmabuf bounds */ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS = 6, + /** + * invalid wl_buffer resulted from importing dmabufs via the create_immed request on given buffer_params + */ + ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_WL_BUFFER = 7, }; #endif /* ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM */ @@ -372,7 +437,7 @@ }; /** - * @ingroup zwp_linux_buffer_params_v1_iface + * @ingroup iface_zwp_linux_buffer_params_v1 */ static inline int zwp_linux_buffer_params_v1_add_listener(struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1, @@ -382,22 +447,36 @@ (void (**)(void)) listener, data); } -#define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY 0 -#define ZWP_LINUX_BUFFER_PARAMS_V1_ADD 1 -#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE 2 +#define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY 0 +#define ZWP_LINUX_BUFFER_PARAMS_V1_ADD 1 +#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE 2 +#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED 3 /** * @ingroup iface_zwp_linux_buffer_params_v1 */ -#define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY_SINCE_VERSION 1 +#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED_SINCE_VERSION 1 /** * @ingroup iface_zwp_linux_buffer_params_v1 */ -#define ZWP_LINUX_BUFFER_PARAMS_V1_ADD_SINCE_VERSION 1 +#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED_SINCE_VERSION 1 + /** * @ingroup iface_zwp_linux_buffer_params_v1 */ -#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_SINCE_VERSION 1 +#define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zwp_linux_buffer_params_v1 + */ +#define ZWP_LINUX_BUFFER_PARAMS_V1_ADD_SINCE_VERSION 1 +/** + * @ingroup iface_zwp_linux_buffer_params_v1 + */ +#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_SINCE_VERSION 1 +/** + * @ingroup iface_zwp_linux_buffer_params_v1 + */ +#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED_SINCE_VERSION 2 /** @ingroup iface_zwp_linux_buffer_params_v1 */ static inline void @@ -528,6 +607,44 @@ ZWP_LINUX_BUFFER_PARAMS_V1_CREATE, width, height, format, flags); } +/** + * @ingroup iface_zwp_linux_buffer_params_v1 + * + * This asks for immediate creation of a wl_buffer by importing the + * added dmabufs. + * + * In case of import success, no event is sent from the server, and the + * wl_buffer is ready to be used by the client. + * + * Upon import failure, either of the following may happen, as seen fit + * by the implementation: + * - the client is terminated with one of the following fatal protocol + * errors: + * - INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS, + * in case of argument errors such as mismatch between the number + * of planes and the format, bad format, non-positive width or + * height, or bad offset or stride. + * - INVALID_WL_BUFFER, in case the cause for failure is unknown or + * plaform specific. + * - the server creates an invalid wl_buffer, marks it as failed and + * sends a 'failed' event to the client. The result of using this + * invalid wl_buffer as an argument in any request by the client is + * defined by the compositor implementation. + * + * This takes the same arguments as a 'create' request, and obeys the + * same restrictions. + */ +static inline struct wl_buffer * +zwp_linux_buffer_params_v1_create_immed(struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1, int32_t width, int32_t height, uint32_t format, uint32_t flags) +{ + struct wl_proxy *buffer_id; + + buffer_id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_linux_buffer_params_v1, + ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED, &wl_buffer_interface, NULL, width, height, format, flags); + + return (struct wl_buffer *) buffer_id; +} + #ifdef __cplusplus } #endif
diff --git a/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-server-protocol.h b/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-server-protocol.h index af077b7..775b18cd 100644 --- a/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef LINUX_DMABUF_UNSTABLE_V1_SERVER_PROTOCOL_H #define LINUX_DMABUF_UNSTABLE_V1_SERVER_PROTOCOL_H @@ -24,26 +24,24 @@ * * Copyright © 2014, 2015 Collabora, Ltd. * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation, and that the name of - * the copyright holders not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. * </pre> */ struct wl_buffer; @@ -58,9 +56,10 @@ * https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt * and the Linux DRM sub-system's AddFb2 ioctl. * - * This interface offers a way to create generic dmabuf-based + * This interface offers ways to create generic dmabuf-based * wl_buffers. Immediately after a client binds to this interface, - * the set of supported formats is sent with 'format' events. + * the set of supported formats and format modifiers is sent with + * 'format' and 'modifier' events. * * The following are required from clients: * @@ -84,10 +83,23 @@ * To create a wl_buffer from one or more dmabufs, a client creates a * zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params * request. All planes required by the intended format are added with - * the 'add' request. Finally, a 'create' request is issued. The server - * will reply with either a 'created' event which provides the final - * wl_buffer or a 'failed' event saying that it cannot use the dmabufs - * provided. + * the 'add' request. Finally, a 'create' or 'create_immed' request is + * issued, which has the following outcome depending on the import success. + * + * The 'create' request, + * - on success, triggers a 'created' event which provides the final + * wl_buffer to the client. + * - on failure, triggers a 'failed' event to convey that the server + * cannot use the dmabufs received from the client. + * + * For the 'create_immed' request, + * - on success, the server immediately imports the added dmabufs to + * create a wl_buffer. No event is sent from the server in this case. + * - on failure, the server can choose to either: + * - terminate the client by raising a fatal error. + * - mark the wl_buffer as failed, and send a 'failed' event to the + * client. If the client uses a failed wl_buffer as an argument to any + * request, the behaviour is compositor implementation-defined. * * Warning! The protocol described in this file is experimental and * backward incompatible changes may be made. Backward compatible changes @@ -107,9 +119,10 @@ * https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt * and the Linux DRM sub-system's AddFb2 ioctl. * - * This interface offers a way to create generic dmabuf-based + * This interface offers ways to create generic dmabuf-based * wl_buffers. Immediately after a client binds to this interface, - * the set of supported formats is sent with 'format' events. + * the set of supported formats and format modifiers is sent with + * 'format' and 'modifier' events. * * The following are required from clients: * @@ -133,10 +146,23 @@ * To create a wl_buffer from one or more dmabufs, a client creates a * zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params * request. All planes required by the intended format are added with - * the 'add' request. Finally, a 'create' request is issued. The server - * will reply with either a 'created' event which provides the final - * wl_buffer or a 'failed' event saying that it cannot use the dmabufs - * provided. + * the 'add' request. Finally, a 'create' or 'create_immed' request is + * issued, which has the following outcome depending on the import success. + * + * The 'create' request, + * - on success, triggers a 'created' event which provides the final + * wl_buffer to the client. + * - on failure, triggers a 'failed' event to convey that the server + * cannot use the dmabufs received from the client. + * + * For the 'create_immed' request, + * - on success, the server immediately imports the added dmabufs to + * create a wl_buffer. No event is sent from the server in this case. + * - on failure, the server can choose to either: + * - terminate the client by raising a fatal error. + * - mark the wl_buffer as failed, and send a 'failed' event to the + * client. If the client uses a failed wl_buffer as an argument to any + * request, the behaviour is compositor implementation-defined. * * Warning! The protocol described in this file is experimental and * backward incompatible changes may be made. Backward compatible changes @@ -216,12 +242,26 @@ uint32_t params_id); }; -#define ZWP_LINUX_DMABUF_V1_FORMAT 0 +#define ZWP_LINUX_DMABUF_V1_FORMAT 0 +#define ZWP_LINUX_DMABUF_V1_MODIFIER 1 /** * @ingroup iface_zwp_linux_dmabuf_v1 */ -#define ZWP_LINUX_DMABUF_V1_FORMAT_SINCE_VERSION 1 +#define ZWP_LINUX_DMABUF_V1_FORMAT_SINCE_VERSION 1 +/** + * @ingroup iface_zwp_linux_dmabuf_v1 + */ +#define ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION 3 + +/** + * @ingroup iface_zwp_linux_dmabuf_v1 + */ +#define ZWP_LINUX_DMABUF_V1_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zwp_linux_dmabuf_v1 + */ +#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS_SINCE_VERSION 1 /** * @ingroup iface_zwp_linux_dmabuf_v1 @@ -235,6 +275,20 @@ wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_V1_FORMAT, format); } +/** + * @ingroup iface_zwp_linux_dmabuf_v1 + * Sends an modifier event to the client owning the resource. + * @param resource_ The client's resource + * @param format DRM_FORMAT code + * @param modifier_hi high 32 bits of layout modifier + * @param modifier_lo low 32 bits of layout modifier + */ +static inline void +zwp_linux_dmabuf_v1_send_modifier(struct wl_resource *resource_, uint32_t format, uint32_t modifier_hi, uint32_t modifier_lo) +{ + wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_V1_MODIFIER, format, modifier_hi, modifier_lo); +} + #ifndef ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM #define ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM enum zwp_linux_buffer_params_v1_error { @@ -266,6 +320,10 @@ * offset + stride * height goes out of dmabuf bounds */ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS = 6, + /** + * invalid wl_buffer resulted from importing dmabufs via the create_immed request on given buffer_params + */ + ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_WL_BUFFER = 7, }; #endif /* ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM */ @@ -406,19 +464,74 @@ int32_t height, uint32_t format, uint32_t flags); + /** + * immediately create a wl_buffer from the given dmabufs + * + * This asks for immediate creation of a wl_buffer by importing + * the added dmabufs. + * + * In case of import success, no event is sent from the server, and + * the wl_buffer is ready to be used by the client. + * + * Upon import failure, either of the following may happen, as seen + * fit by the implementation: - the client is terminated with one + * of the following fatal protocol errors: - INCOMPLETE, + * INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS, in case of + * argument errors such as mismatch between the number of planes + * and the format, bad format, non-positive width or height, or bad + * offset or stride. - INVALID_WL_BUFFER, in case the cause for + * failure is unknown or plaform specific. - the server creates an + * invalid wl_buffer, marks it as failed and sends a 'failed' event + * to the client. The result of using this invalid wl_buffer as an + * argument in any request by the client is defined by the + * compositor implementation. + * + * This takes the same arguments as a 'create' request, and obeys + * the same restrictions. + * @param buffer_id id for the newly created wl_buffer + * @param width base plane width in pixels + * @param height base plane height in pixels + * @param format DRM_FORMAT code + * @param flags see enum flags + * @since 2 + */ + void (*create_immed)(struct wl_client *client, + struct wl_resource *resource, + uint32_t buffer_id, + int32_t width, + int32_t height, + uint32_t format, + uint32_t flags); }; -#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED 0 -#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED 1 +#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED 0 +#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED 1 /** * @ingroup iface_zwp_linux_buffer_params_v1 */ -#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED_SINCE_VERSION 1 +#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED_SINCE_VERSION 1 /** * @ingroup iface_zwp_linux_buffer_params_v1 */ -#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED_SINCE_VERSION 1 +#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED_SINCE_VERSION 1 + +/** + * @ingroup iface_zwp_linux_buffer_params_v1 + */ +#define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zwp_linux_buffer_params_v1 + */ +#define ZWP_LINUX_BUFFER_PARAMS_V1_ADD_SINCE_VERSION 1 +/** + * @ingroup iface_zwp_linux_buffer_params_v1 + */ +#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_SINCE_VERSION 1 +/** + * @ingroup iface_zwp_linux_buffer_params_v1 + */ +#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED_SINCE_VERSION 2 /** * @ingroup iface_zwp_linux_buffer_params_v1
diff --git a/third_party/wayland-protocols/include/protocol/presentation-time-client-protocol.h b/third_party/wayland-protocols/include/protocol/presentation-time-client-protocol.h index d7df9ae..23c2ae8c 100644 --- a/third_party/wayland-protocols/include/protocol/presentation-time-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/presentation-time-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef PRESENTATION_TIME_CLIENT_PROTOCOL_H #define PRESENTATION_TIME_CLIENT_PROTOCOL_H @@ -202,7 +202,7 @@ }; /** - * @ingroup wp_presentation_iface + * @ingroup iface_wp_presentation */ static inline int wp_presentation_add_listener(struct wp_presentation *wp_presentation, @@ -212,17 +212,22 @@ (void (**)(void)) listener, data); } -#define WP_PRESENTATION_DESTROY 0 -#define WP_PRESENTATION_FEEDBACK 1 +#define WP_PRESENTATION_DESTROY 0 +#define WP_PRESENTATION_FEEDBACK 1 /** * @ingroup iface_wp_presentation */ -#define WP_PRESENTATION_DESTROY_SINCE_VERSION 1 +#define WP_PRESENTATION_CLOCK_ID_SINCE_VERSION 1 + /** * @ingroup iface_wp_presentation */ -#define WP_PRESENTATION_FEEDBACK_SINCE_VERSION 1 +#define WP_PRESENTATION_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_wp_presentation + */ +#define WP_PRESENTATION_FEEDBACK_SINCE_VERSION 1 /** @ingroup iface_wp_presentation */ static inline void @@ -434,7 +439,7 @@ }; /** - * @ingroup wp_presentation_feedback_iface + * @ingroup iface_wp_presentation_feedback */ static inline int wp_presentation_feedback_add_listener(struct wp_presentation_feedback *wp_presentation_feedback, @@ -444,6 +449,19 @@ (void (**)(void)) listener, data); } +/** + * @ingroup iface_wp_presentation_feedback + */ +#define WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT_SINCE_VERSION 1 +/** + * @ingroup iface_wp_presentation_feedback + */ +#define WP_PRESENTATION_FEEDBACK_PRESENTED_SINCE_VERSION 1 +/** + * @ingroup iface_wp_presentation_feedback + */ +#define WP_PRESENTATION_FEEDBACK_DISCARDED_SINCE_VERSION 1 + /** @ingroup iface_wp_presentation_feedback */ static inline void
diff --git a/third_party/wayland-protocols/include/protocol/presentation-time-server-protocol.h b/third_party/wayland-protocols/include/protocol/presentation-time-server-protocol.h index 370194b..d2e24ddf 100644 --- a/third_party/wayland-protocols/include/protocol/presentation-time-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/presentation-time-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef PRESENTATION_TIME_SERVER_PROTOCOL_H #define PRESENTATION_TIME_SERVER_PROTOCOL_H @@ -196,12 +196,21 @@ uint32_t callback); }; -#define WP_PRESENTATION_CLOCK_ID 0 +#define WP_PRESENTATION_CLOCK_ID 0 /** * @ingroup iface_wp_presentation */ -#define WP_PRESENTATION_CLOCK_ID_SINCE_VERSION 1 +#define WP_PRESENTATION_CLOCK_ID_SINCE_VERSION 1 + +/** + * @ingroup iface_wp_presentation + */ +#define WP_PRESENTATION_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_wp_presentation + */ +#define WP_PRESENTATION_FEEDBACK_SINCE_VERSION 1 /** * @ingroup iface_wp_presentation @@ -274,22 +283,23 @@ }; #endif /* WP_PRESENTATION_FEEDBACK_KIND_ENUM */ -#define WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT 0 -#define WP_PRESENTATION_FEEDBACK_PRESENTED 1 -#define WP_PRESENTATION_FEEDBACK_DISCARDED 2 +#define WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT 0 +#define WP_PRESENTATION_FEEDBACK_PRESENTED 1 +#define WP_PRESENTATION_FEEDBACK_DISCARDED 2 /** * @ingroup iface_wp_presentation_feedback */ -#define WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT_SINCE_VERSION 1 +#define WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT_SINCE_VERSION 1 /** * @ingroup iface_wp_presentation_feedback */ -#define WP_PRESENTATION_FEEDBACK_PRESENTED_SINCE_VERSION 1 +#define WP_PRESENTATION_FEEDBACK_PRESENTED_SINCE_VERSION 1 /** * @ingroup iface_wp_presentation_feedback */ -#define WP_PRESENTATION_FEEDBACK_DISCARDED_SINCE_VERSION 1 +#define WP_PRESENTATION_FEEDBACK_DISCARDED_SINCE_VERSION 1 + /** * @ingroup iface_wp_presentation_feedback
diff --git a/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h b/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h index a5cb67e..59d7428 100644 --- a/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef REMOTE_SHELL_UNSTABLE_V1_CLIENT_PROTOCOL_H #define REMOTE_SHELL_UNSTABLE_V1_CLIENT_PROTOCOL_H @@ -405,7 +405,7 @@ * @ingroup iface_zcr_remote_shell_v1 * * Creates a notification_surface for the given surface, gives it the - * notification_surface role and associated it with a notification key. + * notification_surface role and associated it with a notification id. */ static inline struct zcr_notification_surface_v1 * zcr_remote_shell_v1_get_notification_surface(struct zcr_remote_shell_v1 *zcr_remote_shell_v1, struct wl_surface *surface, const char *notification_key)
diff --git a/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h b/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h index 3c1b7bca..544f49d4 100644 --- a/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef REMOTE_SHELL_UNSTABLE_V1_SERVER_PROTOCOL_H #define REMOTE_SHELL_UNSTABLE_V1_SERVER_PROTOCOL_H @@ -270,7 +270,7 @@ * * Creates a notification_surface for the given surface, gives it * the notification_surface role and associated it with a - * notification key. + * notification id. */ void (*get_notification_surface)(struct wl_client *client, struct wl_resource *resource,
diff --git a/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-client-protocol.h b/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-client-protocol.h index 8ef529a..82c0a76 100644 --- a/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef SECURE_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H #define SECURE_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H @@ -133,17 +133,18 @@ }; #endif /* ZCR_SECURE_OUTPUT_V1_ERROR_ENUM */ -#define ZCR_SECURE_OUTPUT_V1_DESTROY 0 -#define ZCR_SECURE_OUTPUT_V1_GET_SECURITY 1 +#define ZCR_SECURE_OUTPUT_V1_DESTROY 0 +#define ZCR_SECURE_OUTPUT_V1_GET_SECURITY 1 + /** * @ingroup iface_zcr_secure_output_v1 */ -#define ZCR_SECURE_OUTPUT_V1_DESTROY_SINCE_VERSION 1 +#define ZCR_SECURE_OUTPUT_V1_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zcr_secure_output_v1 */ -#define ZCR_SECURE_OUTPUT_V1_GET_SECURITY_SINCE_VERSION 1 +#define ZCR_SECURE_OUTPUT_V1_GET_SECURITY_SINCE_VERSION 1 /** @ingroup iface_zcr_secure_output_v1 */ static inline void @@ -200,17 +201,18 @@ return (struct zcr_security_v1 *) id; } -#define ZCR_SECURITY_V1_DESTROY 0 -#define ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT 1 +#define ZCR_SECURITY_V1_DESTROY 0 +#define ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT 1 + /** * @ingroup iface_zcr_security_v1 */ -#define ZCR_SECURITY_V1_DESTROY_SINCE_VERSION 1 +#define ZCR_SECURITY_V1_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zcr_security_v1 */ -#define ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT_SINCE_VERSION 1 +#define ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT_SINCE_VERSION 1 /** @ingroup iface_zcr_security_v1 */ static inline void
diff --git a/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-server-protocol.h b/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-server-protocol.h index 5bcbf949..27c7d90 100644 --- a/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef SECURE_OUTPUT_UNSTABLE_V1_SERVER_PROTOCOL_H #define SECURE_OUTPUT_UNSTABLE_V1_SERVER_PROTOCOL_H @@ -168,6 +168,15 @@ /** + * @ingroup iface_zcr_secure_output_v1 + */ +#define ZCR_SECURE_OUTPUT_V1_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zcr_secure_output_v1 + */ +#define ZCR_SECURE_OUTPUT_V1_GET_SECURITY_SINCE_VERSION 1 + +/** * @ingroup iface_zcr_security_v1 * @struct zcr_security_v1_interface */ @@ -194,6 +203,15 @@ }; +/** + * @ingroup iface_zcr_security_v1 + */ +#define ZCR_SECURITY_V1_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zcr_security_v1 + */ +#define ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT_SINCE_VERSION 1 + #ifdef __cplusplus } #endif
diff --git a/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-client-protocol.h b/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-client-protocol.h index 8d7cdd46..1e1eb25d 100644 --- a/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-client-protocol.h
@@ -1,13 +1,13 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef STYLUS_TOOLS_UNSTABLE_V1_CLIENT_PROTOCOL_H #define STYLUS_TOOLS_UNSTABLE_V1_CLIENT_PROTOCOL_H -#include <stddef.h> #include <stdint.h> +#include <stddef.h> #include "wayland-client.h" -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -31,8 +31,7 @@ * * @section page_ifaces_stylus_tools_unstable_v1 Interfaces * - @subpage page_iface_zcr_stylus_tools_v1 - stylus_tools - * - @subpage page_iface_zcr_stylus_tool_v1 - stylus_tool interface to a - * wl_surface + * - @subpage page_iface_zcr_stylus_tool_v1 - stylus_tool interface to a wl_surface * @section page_copyright_stylus_tools_unstable_v1 Copyright * <pre> * @@ -68,8 +67,8 @@ * * The global interface is used to instantiate an interface extension for a * wl_surface object. This extended interface will then allow the client to - * control the stylus-related behavior of the window associated with the - * wl_surface. + * control the stylus-related behavior for input device event processing + * related to wl_surface. * @section page_iface_zcr_stylus_tools_v1_api API * See @ref iface_zcr_stylus_tools_v1. */ @@ -78,8 +77,8 @@ * * The global interface is used to instantiate an interface extension for a * wl_surface object. This extended interface will then allow the client to - * control the stylus-related behavior of the window associated with the - * wl_surface. + * control the stylus-related behavior for input device event processing + * related to wl_surface. */ extern const struct wl_interface zcr_stylus_tools_v1_interface; /** @@ -116,16 +115,17 @@ #ifndef ZCR_STYLUS_TOOLS_V1_ERROR_ENUM #define ZCR_STYLUS_TOOLS_V1_ERROR_ENUM enum zcr_stylus_tools_v1_error { - /** - * the surface already has a stylus_tool object associated - */ - ZCR_STYLUS_TOOLS_V1_ERROR_STYLUS_TOOL_EXISTS = 0, + /** + * the surface already has a stylus_tool object associated + */ + ZCR_STYLUS_TOOLS_V1_ERROR_STYLUS_TOOL_EXISTS = 0, }; #endif /* ZCR_STYLUS_TOOLS_V1_ERROR_ENUM */ #define ZCR_STYLUS_TOOLS_V1_DESTROY 0 #define ZCR_STYLUS_TOOLS_V1_GET_STYLUS_TOOL 1 + /** * @ingroup iface_zcr_stylus_tools_v1 */ @@ -136,21 +136,23 @@ #define ZCR_STYLUS_TOOLS_V1_GET_STYLUS_TOOL_SINCE_VERSION 1 /** @ingroup iface_zcr_stylus_tools_v1 */ -static inline void zcr_stylus_tools_v1_set_user_data( - struct zcr_stylus_tools_v1* zcr_stylus_tools_v1, - void* user_data) { - wl_proxy_set_user_data((struct wl_proxy*)zcr_stylus_tools_v1, user_data); +static inline void +zcr_stylus_tools_v1_set_user_data(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1, void *user_data) +{ + wl_proxy_set_user_data((struct wl_proxy *) zcr_stylus_tools_v1, user_data); } /** @ingroup iface_zcr_stylus_tools_v1 */ -static inline void* zcr_stylus_tools_v1_get_user_data( - struct zcr_stylus_tools_v1* zcr_stylus_tools_v1) { - return wl_proxy_get_user_data((struct wl_proxy*)zcr_stylus_tools_v1); +static inline void * +zcr_stylus_tools_v1_get_user_data(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1) +{ + return wl_proxy_get_user_data((struct wl_proxy *) zcr_stylus_tools_v1); } -static inline uint32_t zcr_stylus_tools_v1_get_version( - struct zcr_stylus_tools_v1* zcr_stylus_tools_v1) { - return wl_proxy_get_version((struct wl_proxy*)zcr_stylus_tools_v1); +static inline uint32_t +zcr_stylus_tools_v1_get_version(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1) +{ + return wl_proxy_get_version((struct wl_proxy *) zcr_stylus_tools_v1); } /** @@ -160,12 +162,13 @@ * protocol object anymore. This does not affect any other objects, * stylus_tool objects included. */ -static inline void zcr_stylus_tools_v1_destroy( - struct zcr_stylus_tools_v1* zcr_stylus_tools_v1) { - wl_proxy_marshal((struct wl_proxy*)zcr_stylus_tools_v1, - ZCR_STYLUS_TOOLS_V1_DESTROY); +static inline void +zcr_stylus_tools_v1_destroy(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1) +{ + wl_proxy_marshal((struct wl_proxy *) zcr_stylus_tools_v1, + ZCR_STYLUS_TOOLS_V1_DESTROY); - wl_proxy_destroy((struct wl_proxy*)zcr_stylus_tools_v1); + wl_proxy_destroy((struct wl_proxy *) zcr_stylus_tools_v1); } /** @@ -176,22 +179,21 @@ * wl_surface already has an stylus_tool object associated, * the stylus_tool_exists protocol protocol error is raised. */ -static inline struct zcr_stylus_tool_v1* zcr_stylus_tools_v1_get_stylus_tool( - struct zcr_stylus_tools_v1* zcr_stylus_tools_v1, - struct wl_surface* surface) { - struct wl_proxy* id; +static inline struct zcr_stylus_tool_v1 * +zcr_stylus_tools_v1_get_stylus_tool(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1, struct wl_surface *surface) +{ + struct wl_proxy *id; - id = wl_proxy_marshal_constructor((struct wl_proxy*)zcr_stylus_tools_v1, - ZCR_STYLUS_TOOLS_V1_GET_STYLUS_TOOL, - &zcr_stylus_tool_v1_interface, NULL, - surface); + id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_stylus_tools_v1, + ZCR_STYLUS_TOOLS_V1_GET_STYLUS_TOOL, &zcr_stylus_tool_v1_interface, NULL, surface); - return (struct zcr_stylus_tool_v1*)id; + return (struct zcr_stylus_tool_v1 *) id; } #define ZCR_STYLUS_TOOL_V1_DESTROY 0 #define ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY 1 + /** * @ingroup iface_zcr_stylus_tool_v1 */ @@ -202,21 +204,23 @@ #define ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY_SINCE_VERSION 1 /** @ingroup iface_zcr_stylus_tool_v1 */ -static inline void zcr_stylus_tool_v1_set_user_data( - struct zcr_stylus_tool_v1* zcr_stylus_tool_v1, - void* user_data) { - wl_proxy_set_user_data((struct wl_proxy*)zcr_stylus_tool_v1, user_data); +static inline void +zcr_stylus_tool_v1_set_user_data(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1, void *user_data) +{ + wl_proxy_set_user_data((struct wl_proxy *) zcr_stylus_tool_v1, user_data); } /** @ingroup iface_zcr_stylus_tool_v1 */ -static inline void* zcr_stylus_tool_v1_get_user_data( - struct zcr_stylus_tool_v1* zcr_stylus_tool_v1) { - return wl_proxy_get_user_data((struct wl_proxy*)zcr_stylus_tool_v1); +static inline void * +zcr_stylus_tool_v1_get_user_data(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1) +{ + return wl_proxy_get_user_data((struct wl_proxy *) zcr_stylus_tool_v1); } -static inline uint32_t zcr_stylus_tool_v1_get_version( - struct zcr_stylus_tool_v1* zcr_stylus_tool_v1) { - return wl_proxy_get_version((struct wl_proxy*)zcr_stylus_tool_v1); +static inline uint32_t +zcr_stylus_tool_v1_get_version(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1) +{ + return wl_proxy_get_version((struct wl_proxy *) zcr_stylus_tool_v1); } /** @@ -225,27 +229,29 @@ * The associated wl_surface's stylus_tool state is removed. * The change is applied on the next wl_surface.commit. */ -static inline void zcr_stylus_tool_v1_destroy( - struct zcr_stylus_tool_v1* zcr_stylus_tool_v1) { - wl_proxy_marshal((struct wl_proxy*)zcr_stylus_tool_v1, - ZCR_STYLUS_TOOL_V1_DESTROY); +static inline void +zcr_stylus_tool_v1_destroy(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1) +{ + wl_proxy_marshal((struct wl_proxy *) zcr_stylus_tool_v1, + ZCR_STYLUS_TOOL_V1_DESTROY); - wl_proxy_destroy((struct wl_proxy*)zcr_stylus_tool_v1); + wl_proxy_destroy((struct wl_proxy *) zcr_stylus_tool_v1); } /** * @ingroup iface_zcr_stylus_tool_v1 * - * Enables the "stylus-only" mode for the window associated with the - * wl_surface. + * Enables the "stylus-only" mode for input device event processing + * related to wl_surface. */ -static inline void zcr_stylus_tool_v1_set_stylus_only( - struct zcr_stylus_tool_v1* zcr_stylus_tool_v1) { - wl_proxy_marshal((struct wl_proxy*)zcr_stylus_tool_v1, - ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY); +static inline void +zcr_stylus_tool_v1_set_stylus_only(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1) +{ + wl_proxy_marshal((struct wl_proxy *) zcr_stylus_tool_v1, + ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY); } -#ifdef __cplusplus +#ifdef __cplusplus } #endif
diff --git a/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-server-protocol.h b/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-server-protocol.h index e8f5d86..b1b117e 100644 --- a/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-server-protocol.h
@@ -1,13 +1,13 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef STYLUS_TOOLS_UNSTABLE_V1_SERVER_PROTOCOL_H #define STYLUS_TOOLS_UNSTABLE_V1_SERVER_PROTOCOL_H -#include <stddef.h> #include <stdint.h> +#include <stddef.h> #include "wayland-server.h" -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -34,8 +34,7 @@ * * @section page_ifaces_stylus_tools_unstable_v1 Interfaces * - @subpage page_iface_zcr_stylus_tools_v1 - stylus_tools - * - @subpage page_iface_zcr_stylus_tool_v1 - stylus_tool interface to a - * wl_surface + * - @subpage page_iface_zcr_stylus_tool_v1 - stylus_tool interface to a wl_surface * @section page_copyright_stylus_tools_unstable_v1 Copyright * <pre> * @@ -71,8 +70,8 @@ * * The global interface is used to instantiate an interface extension for a * wl_surface object. This extended interface will then allow the client to - * control the stylus-related behavior of the window associated with the - * wl_surface. + * control the stylus-related behavior for input device event processing + * related to wl_surface. * @section page_iface_zcr_stylus_tools_v1_api API * See @ref iface_zcr_stylus_tools_v1. */ @@ -81,8 +80,8 @@ * * The global interface is used to instantiate an interface extension for a * wl_surface object. This extended interface will then allow the client to - * control the stylus-related behavior of the window associated with the - * wl_surface. + * control the stylus-related behavior for input device event processing + * related to wl_surface. */ extern const struct wl_interface zcr_stylus_tools_v1_interface; /** @@ -119,10 +118,10 @@ #ifndef ZCR_STYLUS_TOOLS_V1_ERROR_ENUM #define ZCR_STYLUS_TOOLS_V1_ERROR_ENUM enum zcr_stylus_tools_v1_error { - /** - * the surface already has a stylus_tool object associated - */ - ZCR_STYLUS_TOOLS_V1_ERROR_STYLUS_TOOL_EXISTS = 0, + /** + * the surface already has a stylus_tool object associated + */ + ZCR_STYLUS_TOOLS_V1_ERROR_STYLUS_TOOL_EXISTS = 0, }; #endif /* ZCR_STYLUS_TOOLS_V1_ERROR_ENUM */ @@ -131,30 +130,32 @@ * @struct zcr_stylus_tools_v1_interface */ struct zcr_stylus_tools_v1_interface { - /** - * unbind from the stylus_tools interface - * - * Informs the server that the client will not be using this - * protocol object anymore. This does not affect any other objects, - * stylus_tool objects included. - */ - void (*destroy)(struct wl_client* client, struct wl_resource* resource); - /** - * extend surface interface for stylus_tool - * - * Instantiate an interface extension for the given wl_surface to - * provide access to the stylus tools features. If the given - * wl_surface already has an stylus_tool object associated, the - * stylus_tool_exists protocol protocol error is raised. - * @param id the new stylus_tool interface id - * @param surface the surface - */ - void (*get_stylus_tool)(struct wl_client* client, - struct wl_resource* resource, - uint32_t id, - struct wl_resource* surface); + /** + * unbind from the stylus_tools interface + * + * Informs the server that the client will not be using this + * protocol object anymore. This does not affect any other objects, + * stylus_tool objects included. + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); + /** + * extend surface interface for stylus_tool + * + * Instantiate an interface extension for the given wl_surface to + * provide access to the stylus tools features. If the given + * wl_surface already has an stylus_tool object associated, the + * stylus_tool_exists protocol protocol error is raised. + * @param id the new stylus_tool interface id + * @param surface the surface + */ + void (*get_stylus_tool)(struct wl_client *client, + struct wl_resource *resource, + uint32_t id, + struct wl_resource *surface); }; + /** * @ingroup iface_zcr_stylus_tools_v1 */ @@ -169,23 +170,25 @@ * @struct zcr_stylus_tool_v1_interface */ struct zcr_stylus_tool_v1_interface { - /** - * remove stylus_tool from the surface - * - * The associated wl_surface's stylus_tool state is removed. The - * change is applied on the next wl_surface.commit. - */ - void (*destroy)(struct wl_client* client, struct wl_resource* resource); - /** - * Set the stylus-only mode - * - * Enables the "stylus-only" mode for the window associated with - * the wl_surface. - */ - void (*set_stylus_only)(struct wl_client* client, - struct wl_resource* resource); + /** + * remove stylus_tool from the surface + * + * The associated wl_surface's stylus_tool state is removed. The + * change is applied on the next wl_surface.commit. + */ + void (*destroy)(struct wl_client *client, + struct wl_resource *resource); + /** + * Set the stylus-only mode + * + * Enables the "stylus-only" mode for input device event + * processing related to wl_surface. + */ + void (*set_stylus_only)(struct wl_client *client, + struct wl_resource *resource); }; + /** * @ingroup iface_zcr_stylus_tool_v1 */ @@ -195,7 +198,7 @@ */ #define ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY_SINCE_VERSION 1 -#ifdef __cplusplus +#ifdef __cplusplus } #endif
diff --git a/third_party/wayland-protocols/include/protocol/stylus-unstable-v1-client-protocol.h b/third_party/wayland-protocols/include/protocol/stylus-unstable-v1-client-protocol.h index c5e4f42..8a5d5cd 100644 --- a/third_party/wayland-protocols/include/protocol/stylus-unstable-v1-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/stylus-unstable-v1-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef STYLUS_UNSTABLE_V1_CLIENT_PROTOCOL_H #define STYLUS_UNSTABLE_V1_CLIENT_PROTOCOL_H @@ -116,12 +116,13 @@ }; #endif /* ZCR_STYLUS_V1_ERROR_ENUM */ -#define ZCR_STYLUS_V1_GET_POINTER_STYLUS 0 +#define ZCR_STYLUS_V1_GET_POINTER_STYLUS 0 + /** * @ingroup iface_zcr_stylus_v1 */ -#define ZCR_STYLUS_V1_GET_POINTER_STYLUS_SINCE_VERSION 1 +#define ZCR_STYLUS_V1_GET_POINTER_STYLUS_SINCE_VERSION 1 /** @ingroup iface_zcr_stylus_v1 */ static inline void @@ -256,7 +257,7 @@ }; /** - * @ingroup zcr_pointer_stylus_v1_iface + * @ingroup iface_zcr_pointer_stylus_v1 */ static inline int zcr_pointer_stylus_v1_add_listener(struct zcr_pointer_stylus_v1 *zcr_pointer_stylus_v1, @@ -266,12 +267,25 @@ (void (**)(void)) listener, data); } -#define ZCR_POINTER_STYLUS_V1_DESTROY 0 +#define ZCR_POINTER_STYLUS_V1_DESTROY 0 /** * @ingroup iface_zcr_pointer_stylus_v1 */ -#define ZCR_POINTER_STYLUS_V1_DESTROY_SINCE_VERSION 1 +#define ZCR_POINTER_STYLUS_V1_TOOL_CHANGE_SINCE_VERSION 1 +/** + * @ingroup iface_zcr_pointer_stylus_v1 + */ +#define ZCR_POINTER_STYLUS_V1_FORCE_SINCE_VERSION 1 +/** + * @ingroup iface_zcr_pointer_stylus_v1 + */ +#define ZCR_POINTER_STYLUS_V1_TILT_SINCE_VERSION 1 + +/** + * @ingroup iface_zcr_pointer_stylus_v1 + */ +#define ZCR_POINTER_STYLUS_V1_DESTROY_SINCE_VERSION 1 /** @ingroup iface_zcr_pointer_stylus_v1 */ static inline void
diff --git a/third_party/wayland-protocols/include/protocol/stylus-unstable-v1-server-protocol.h b/third_party/wayland-protocols/include/protocol/stylus-unstable-v1-server-protocol.h index bd14461b..c30ae0b 100644 --- a/third_party/wayland-protocols/include/protocol/stylus-unstable-v1-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/stylus-unstable-v1-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef STYLUS_UNSTABLE_V1_SERVER_PROTOCOL_H #define STYLUS_UNSTABLE_V1_SERVER_PROTOCOL_H @@ -139,6 +139,11 @@ }; +/** + * @ingroup iface_zcr_stylus_v1 + */ +#define ZCR_STYLUS_V1_GET_POINTER_STYLUS_SINCE_VERSION 1 + #ifndef ZCR_POINTER_STYLUS_V1_TOOL_TYPE_ENUM #define ZCR_POINTER_STYLUS_V1_TOOL_TYPE_ENUM /** @@ -179,22 +184,27 @@ struct wl_resource *resource); }; -#define ZCR_POINTER_STYLUS_V1_TOOL_CHANGE 0 -#define ZCR_POINTER_STYLUS_V1_FORCE 1 -#define ZCR_POINTER_STYLUS_V1_TILT 2 +#define ZCR_POINTER_STYLUS_V1_TOOL_CHANGE 0 +#define ZCR_POINTER_STYLUS_V1_FORCE 1 +#define ZCR_POINTER_STYLUS_V1_TILT 2 /** * @ingroup iface_zcr_pointer_stylus_v1 */ -#define ZCR_POINTER_STYLUS_V1_TOOL_CHANGE_SINCE_VERSION 1 +#define ZCR_POINTER_STYLUS_V1_TOOL_CHANGE_SINCE_VERSION 1 /** * @ingroup iface_zcr_pointer_stylus_v1 */ -#define ZCR_POINTER_STYLUS_V1_FORCE_SINCE_VERSION 1 +#define ZCR_POINTER_STYLUS_V1_FORCE_SINCE_VERSION 1 /** * @ingroup iface_zcr_pointer_stylus_v1 */ -#define ZCR_POINTER_STYLUS_V1_TILT_SINCE_VERSION 1 +#define ZCR_POINTER_STYLUS_V1_TILT_SINCE_VERSION 1 + +/** + * @ingroup iface_zcr_pointer_stylus_v1 + */ +#define ZCR_POINTER_STYLUS_V1_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zcr_pointer_stylus_v1
diff --git a/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-client-protocol.h b/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-client-protocol.h index 6190873..0de3255 100644 --- a/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef STYLUS_UNSTABLE_V2_CLIENT_PROTOCOL_H #define STYLUS_UNSTABLE_V2_CLIENT_PROTOCOL_H @@ -116,12 +116,13 @@ }; #endif /* ZCR_STYLUS_V2_ERROR_ENUM */ -#define ZCR_STYLUS_V2_GET_TOUCH_STYLUS 0 +#define ZCR_STYLUS_V2_GET_TOUCH_STYLUS 0 + /** * @ingroup iface_zcr_stylus_v2 */ -#define ZCR_STYLUS_V2_GET_TOUCH_STYLUS_SINCE_VERSION 1 +#define ZCR_STYLUS_V2_GET_TOUCH_STYLUS_SINCE_VERSION 1 /** @ingroup iface_zcr_stylus_v2 */ static inline void @@ -246,7 +247,7 @@ }; /** - * @ingroup zcr_touch_stylus_v2_iface + * @ingroup iface_zcr_touch_stylus_v2 */ static inline int zcr_touch_stylus_v2_add_listener(struct zcr_touch_stylus_v2 *zcr_touch_stylus_v2, @@ -256,12 +257,25 @@ (void (**)(void)) listener, data); } -#define ZCR_TOUCH_STYLUS_V2_DESTROY 0 +#define ZCR_TOUCH_STYLUS_V2_DESTROY 0 /** * @ingroup iface_zcr_touch_stylus_v2 */ -#define ZCR_TOUCH_STYLUS_V2_DESTROY_SINCE_VERSION 1 +#define ZCR_TOUCH_STYLUS_V2_TOOL_SINCE_VERSION 1 +/** + * @ingroup iface_zcr_touch_stylus_v2 + */ +#define ZCR_TOUCH_STYLUS_V2_FORCE_SINCE_VERSION 1 +/** + * @ingroup iface_zcr_touch_stylus_v2 + */ +#define ZCR_TOUCH_STYLUS_V2_TILT_SINCE_VERSION 1 + +/** + * @ingroup iface_zcr_touch_stylus_v2 + */ +#define ZCR_TOUCH_STYLUS_V2_DESTROY_SINCE_VERSION 1 /** @ingroup iface_zcr_touch_stylus_v2 */ static inline void
diff --git a/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-server-protocol.h b/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-server-protocol.h index 4cd5087..bd951b6 100644 --- a/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef STYLUS_UNSTABLE_V2_SERVER_PROTOCOL_H #define STYLUS_UNSTABLE_V2_SERVER_PROTOCOL_H @@ -139,6 +139,11 @@ }; +/** + * @ingroup iface_zcr_stylus_v2 + */ +#define ZCR_STYLUS_V2_GET_TOUCH_STYLUS_SINCE_VERSION 1 + #ifndef ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ENUM #define ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ENUM /** @@ -175,22 +180,27 @@ struct wl_resource *resource); }; -#define ZCR_TOUCH_STYLUS_V2_TOOL 0 -#define ZCR_TOUCH_STYLUS_V2_FORCE 1 -#define ZCR_TOUCH_STYLUS_V2_TILT 2 +#define ZCR_TOUCH_STYLUS_V2_TOOL 0 +#define ZCR_TOUCH_STYLUS_V2_FORCE 1 +#define ZCR_TOUCH_STYLUS_V2_TILT 2 /** * @ingroup iface_zcr_touch_stylus_v2 */ -#define ZCR_TOUCH_STYLUS_V2_TOOL_SINCE_VERSION 1 +#define ZCR_TOUCH_STYLUS_V2_TOOL_SINCE_VERSION 1 /** * @ingroup iface_zcr_touch_stylus_v2 */ -#define ZCR_TOUCH_STYLUS_V2_FORCE_SINCE_VERSION 1 +#define ZCR_TOUCH_STYLUS_V2_FORCE_SINCE_VERSION 1 /** * @ingroup iface_zcr_touch_stylus_v2 */ -#define ZCR_TOUCH_STYLUS_V2_TILT_SINCE_VERSION 1 +#define ZCR_TOUCH_STYLUS_V2_TILT_SINCE_VERSION 1 + +/** + * @ingroup iface_zcr_touch_stylus_v2 + */ +#define ZCR_TOUCH_STYLUS_V2_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zcr_touch_stylus_v2
diff --git a/third_party/wayland-protocols/include/protocol/viewporter-client-protocol.h b/third_party/wayland-protocols/include/protocol/viewporter-client-protocol.h index ab6abe23..76af360 100644 --- a/third_party/wayland-protocols/include/protocol/viewporter-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/viewporter-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef VIEWPORTER_CLIENT_PROTOCOL_H #define VIEWPORTER_CLIENT_PROTOCOL_H @@ -214,17 +214,18 @@ }; #endif /* WP_VIEWPORTER_ERROR_ENUM */ -#define WP_VIEWPORTER_DESTROY 0 -#define WP_VIEWPORTER_GET_VIEWPORT 1 +#define WP_VIEWPORTER_DESTROY 0 +#define WP_VIEWPORTER_GET_VIEWPORT 1 + /** * @ingroup iface_wp_viewporter */ -#define WP_VIEWPORTER_DESTROY_SINCE_VERSION 1 +#define WP_VIEWPORTER_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wp_viewporter */ -#define WP_VIEWPORTER_GET_VIEWPORT_SINCE_VERSION 1 +#define WP_VIEWPORTER_GET_VIEWPORT_SINCE_VERSION 1 /** @ingroup iface_wp_viewporter */ static inline void @@ -303,22 +304,23 @@ }; #endif /* WP_VIEWPORT_ERROR_ENUM */ -#define WP_VIEWPORT_DESTROY 0 -#define WP_VIEWPORT_SET_SOURCE 1 -#define WP_VIEWPORT_SET_DESTINATION 2 +#define WP_VIEWPORT_DESTROY 0 +#define WP_VIEWPORT_SET_SOURCE 1 +#define WP_VIEWPORT_SET_DESTINATION 2 + /** * @ingroup iface_wp_viewport */ -#define WP_VIEWPORT_DESTROY_SINCE_VERSION 1 +#define WP_VIEWPORT_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_wp_viewport */ -#define WP_VIEWPORT_SET_SOURCE_SINCE_VERSION 1 +#define WP_VIEWPORT_SET_SOURCE_SINCE_VERSION 1 /** * @ingroup iface_wp_viewport */ -#define WP_VIEWPORT_SET_DESTINATION_SINCE_VERSION 1 +#define WP_VIEWPORT_SET_DESTINATION_SINCE_VERSION 1 /** @ingroup iface_wp_viewport */ static inline void
diff --git a/third_party/wayland-protocols/include/protocol/viewporter-server-protocol.h b/third_party/wayland-protocols/include/protocol/viewporter-server-protocol.h index 7c34ed6..0bdb53a 100644 --- a/third_party/wayland-protocols/include/protocol/viewporter-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/viewporter-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef VIEWPORTER_SERVER_PROTOCOL_H #define VIEWPORTER_SERVER_PROTOCOL_H @@ -248,6 +248,15 @@ }; +/** + * @ingroup iface_wp_viewporter + */ +#define WP_VIEWPORTER_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_wp_viewporter + */ +#define WP_VIEWPORTER_GET_VIEWPORT_SINCE_VERSION 1 + #ifndef WP_VIEWPORT_ERROR_ENUM #define WP_VIEWPORT_ERROR_ENUM enum wp_viewport_error { @@ -332,6 +341,19 @@ }; +/** + * @ingroup iface_wp_viewport + */ +#define WP_VIEWPORT_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_wp_viewport + */ +#define WP_VIEWPORT_SET_SOURCE_SINCE_VERSION 1 +/** + * @ingroup iface_wp_viewport + */ +#define WP_VIEWPORT_SET_DESTINATION_SINCE_VERSION 1 + #ifdef __cplusplus } #endif
diff --git a/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-client-protocol.h b/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-client-protocol.h index d17fe3d..5a37d00 100644 --- a/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef VSYNC_FEEDBACK_UNSTABLE_V1_CLIENT_PROTOCOL_H #define VSYNC_FEEDBACK_UNSTABLE_V1_CLIENT_PROTOCOL_H @@ -87,17 +87,18 @@ */ extern const struct wl_interface zcr_vsync_timing_v1_interface; -#define ZCR_VSYNC_FEEDBACK_V1_DESTROY 0 -#define ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING 1 +#define ZCR_VSYNC_FEEDBACK_V1_DESTROY 0 +#define ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING 1 + /** * @ingroup iface_zcr_vsync_feedback_v1 */ -#define ZCR_VSYNC_FEEDBACK_V1_DESTROY_SINCE_VERSION 1 +#define ZCR_VSYNC_FEEDBACK_V1_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zcr_vsync_feedback_v1 */ -#define ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING_SINCE_VERSION 1 +#define ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING_SINCE_VERSION 1 /** @ingroup iface_zcr_vsync_feedback_v1 */ static inline void @@ -193,7 +194,7 @@ }; /** - * @ingroup zcr_vsync_timing_v1_iface + * @ingroup iface_zcr_vsync_timing_v1 */ static inline int zcr_vsync_timing_v1_add_listener(struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1, @@ -203,12 +204,17 @@ (void (**)(void)) listener, data); } -#define ZCR_VSYNC_TIMING_V1_DESTROY 0 +#define ZCR_VSYNC_TIMING_V1_DESTROY 0 /** * @ingroup iface_zcr_vsync_timing_v1 */ -#define ZCR_VSYNC_TIMING_V1_DESTROY_SINCE_VERSION 1 +#define ZCR_VSYNC_TIMING_V1_UPDATE_SINCE_VERSION 1 + +/** + * @ingroup iface_zcr_vsync_timing_v1 + */ +#define ZCR_VSYNC_TIMING_V1_DESTROY_SINCE_VERSION 1 /** @ingroup iface_zcr_vsync_timing_v1 */ static inline void
diff --git a/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-server-protocol.h b/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-server-protocol.h index 846fc1d7..67c1f8da 100644 --- a/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef VSYNC_FEEDBACK_UNSTABLE_V1_SERVER_PROTOCOL_H #define VSYNC_FEEDBACK_UNSTABLE_V1_SERVER_PROTOCOL_H @@ -123,6 +123,15 @@ /** + * @ingroup iface_zcr_vsync_feedback_v1 + */ +#define ZCR_VSYNC_FEEDBACK_V1_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zcr_vsync_feedback_v1 + */ +#define ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING_SINCE_VERSION 1 + +/** * @ingroup iface_zcr_vsync_timing_v1 * @struct zcr_vsync_timing_v1_interface */ @@ -136,12 +145,17 @@ struct wl_resource *resource); }; -#define ZCR_VSYNC_TIMING_V1_UPDATE 0 +#define ZCR_VSYNC_TIMING_V1_UPDATE 0 /** * @ingroup iface_zcr_vsync_timing_v1 */ -#define ZCR_VSYNC_TIMING_V1_UPDATE_SINCE_VERSION 1 +#define ZCR_VSYNC_TIMING_V1_UPDATE_SINCE_VERSION 1 + +/** + * @ingroup iface_zcr_vsync_timing_v1 + */ +#define ZCR_VSYNC_TIMING_V1_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zcr_vsync_timing_v1
diff --git a/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-client-protocol.h b/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-client-protocol.h index 188d72f..95d7085 100644 --- a/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef XDG_SHELL_UNSTABLE_V5_CLIENT_PROTOCOL_H #define XDG_SHELL_UNSTABLE_V5_CLIENT_PROTOCOL_H @@ -305,7 +305,7 @@ }; /** - * @ingroup xdg_shell_iface + * @ingroup iface_xdg_shell */ static inline int xdg_shell_add_listener(struct xdg_shell *xdg_shell, @@ -315,32 +315,37 @@ (void (**)(void)) listener, data); } -#define XDG_SHELL_DESTROY 0 -#define XDG_SHELL_USE_UNSTABLE_VERSION 1 -#define XDG_SHELL_GET_XDG_SURFACE 2 -#define XDG_SHELL_GET_XDG_POPUP 3 -#define XDG_SHELL_PONG 4 +#define XDG_SHELL_DESTROY 0 +#define XDG_SHELL_USE_UNSTABLE_VERSION 1 +#define XDG_SHELL_GET_XDG_SURFACE 2 +#define XDG_SHELL_GET_XDG_POPUP 3 +#define XDG_SHELL_PONG 4 /** * @ingroup iface_xdg_shell */ -#define XDG_SHELL_DESTROY_SINCE_VERSION 1 +#define XDG_SHELL_PING_SINCE_VERSION 1 + /** * @ingroup iface_xdg_shell */ -#define XDG_SHELL_USE_UNSTABLE_VERSION_SINCE_VERSION 1 +#define XDG_SHELL_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_xdg_shell */ -#define XDG_SHELL_GET_XDG_SURFACE_SINCE_VERSION 1 +#define XDG_SHELL_USE_UNSTABLE_VERSION_SINCE_VERSION 1 /** * @ingroup iface_xdg_shell */ -#define XDG_SHELL_GET_XDG_POPUP_SINCE_VERSION 1 +#define XDG_SHELL_GET_XDG_SURFACE_SINCE_VERSION 1 /** * @ingroup iface_xdg_shell */ -#define XDG_SHELL_PONG_SINCE_VERSION 1 +#define XDG_SHELL_GET_XDG_POPUP_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_shell + */ +#define XDG_SHELL_PONG_SINCE_VERSION 1 /** @ingroup iface_xdg_shell */ static inline void @@ -567,7 +572,7 @@ }; /** - * @ingroup xdg_surface_iface + * @ingroup iface_xdg_surface */ static inline int xdg_surface_add_listener(struct xdg_surface *xdg_surface, @@ -577,77 +582,86 @@ (void (**)(void)) listener, data); } -#define XDG_SURFACE_DESTROY 0 -#define XDG_SURFACE_SET_PARENT 1 -#define XDG_SURFACE_SET_TITLE 2 -#define XDG_SURFACE_SET_APP_ID 3 -#define XDG_SURFACE_SHOW_WINDOW_MENU 4 -#define XDG_SURFACE_MOVE 5 -#define XDG_SURFACE_RESIZE 6 -#define XDG_SURFACE_ACK_CONFIGURE 7 -#define XDG_SURFACE_SET_WINDOW_GEOMETRY 8 -#define XDG_SURFACE_SET_MAXIMIZED 9 -#define XDG_SURFACE_UNSET_MAXIMIZED 10 -#define XDG_SURFACE_SET_FULLSCREEN 11 -#define XDG_SURFACE_UNSET_FULLSCREEN 12 -#define XDG_SURFACE_SET_MINIMIZED 13 +#define XDG_SURFACE_DESTROY 0 +#define XDG_SURFACE_SET_PARENT 1 +#define XDG_SURFACE_SET_TITLE 2 +#define XDG_SURFACE_SET_APP_ID 3 +#define XDG_SURFACE_SHOW_WINDOW_MENU 4 +#define XDG_SURFACE_MOVE 5 +#define XDG_SURFACE_RESIZE 6 +#define XDG_SURFACE_ACK_CONFIGURE 7 +#define XDG_SURFACE_SET_WINDOW_GEOMETRY 8 +#define XDG_SURFACE_SET_MAXIMIZED 9 +#define XDG_SURFACE_UNSET_MAXIMIZED 10 +#define XDG_SURFACE_SET_FULLSCREEN 11 +#define XDG_SURFACE_UNSET_FULLSCREEN 12 +#define XDG_SURFACE_SET_MINIMIZED 13 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_DESTROY_SINCE_VERSION 1 +#define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_SET_PARENT_SINCE_VERSION 1 +#define XDG_SURFACE_CLOSE_SINCE_VERSION 1 + /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_SET_TITLE_SINCE_VERSION 1 +#define XDG_SURFACE_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_SET_APP_ID_SINCE_VERSION 1 +#define XDG_SURFACE_SET_PARENT_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_SHOW_WINDOW_MENU_SINCE_VERSION 1 +#define XDG_SURFACE_SET_TITLE_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_MOVE_SINCE_VERSION 1 +#define XDG_SURFACE_SET_APP_ID_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_RESIZE_SINCE_VERSION 1 +#define XDG_SURFACE_SHOW_WINDOW_MENU_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_ACK_CONFIGURE_SINCE_VERSION 1 +#define XDG_SURFACE_MOVE_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_SET_WINDOW_GEOMETRY_SINCE_VERSION 1 +#define XDG_SURFACE_RESIZE_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1 +#define XDG_SURFACE_ACK_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_UNSET_MAXIMIZED_SINCE_VERSION 1 +#define XDG_SURFACE_SET_WINDOW_GEOMETRY_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1 +#define XDG_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_UNSET_FULLSCREEN_SINCE_VERSION 1 +#define XDG_SURFACE_UNSET_MAXIMIZED_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_SET_MINIMIZED_SINCE_VERSION 1 +#define XDG_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_UNSET_FULLSCREEN_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_SET_MINIMIZED_SINCE_VERSION 1 /** @ingroup iface_xdg_surface */ static inline void @@ -1029,7 +1043,7 @@ }; /** - * @ingroup xdg_popup_iface + * @ingroup iface_xdg_popup */ static inline int xdg_popup_add_listener(struct xdg_popup *xdg_popup, @@ -1039,12 +1053,17 @@ (void (**)(void)) listener, data); } -#define XDG_POPUP_DESTROY 0 +#define XDG_POPUP_DESTROY 0 /** * @ingroup iface_xdg_popup */ -#define XDG_POPUP_DESTROY_SINCE_VERSION 1 +#define XDG_POPUP_POPUP_DONE_SINCE_VERSION 1 + +/** + * @ingroup iface_xdg_popup + */ +#define XDG_POPUP_DESTROY_SINCE_VERSION 1 /** @ingroup iface_xdg_popup */ static inline void
diff --git a/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-server-protocol.h b/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-server-protocol.h index 67de0100..4ef85e7 100644 --- a/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef XDG_SHELL_UNSTABLE_V5_SERVER_PROTOCOL_H #define XDG_SHELL_UNSTABLE_V5_SERVER_PROTOCOL_H @@ -363,12 +363,33 @@ uint32_t serial); }; -#define XDG_SHELL_PING 0 +#define XDG_SHELL_PING 0 /** * @ingroup iface_xdg_shell */ -#define XDG_SHELL_PING_SINCE_VERSION 1 +#define XDG_SHELL_PING_SINCE_VERSION 1 + +/** + * @ingroup iface_xdg_shell + */ +#define XDG_SHELL_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_shell + */ +#define XDG_SHELL_USE_UNSTABLE_VERSION_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_shell + */ +#define XDG_SHELL_GET_XDG_SURFACE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_shell + */ +#define XDG_SHELL_GET_XDG_POPUP_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_shell + */ +#define XDG_SHELL_PONG_SINCE_VERSION 1 /** * @ingroup iface_xdg_shell @@ -743,17 +764,74 @@ struct wl_resource *resource); }; -#define XDG_SURFACE_CONFIGURE 0 -#define XDG_SURFACE_CLOSE 1 +#define XDG_SURFACE_CONFIGURE 0 +#define XDG_SURFACE_CLOSE 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1 +#define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface */ -#define XDG_SURFACE_CLOSE_SINCE_VERSION 1 +#define XDG_SURFACE_CLOSE_SINCE_VERSION 1 + +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_SET_PARENT_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_SET_TITLE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_SET_APP_ID_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_SHOW_WINDOW_MENU_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_MOVE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_RESIZE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_ACK_CONFIGURE_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_SET_WINDOW_GEOMETRY_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_UNSET_MAXIMIZED_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_UNSET_FULLSCREEN_SINCE_VERSION 1 +/** + * @ingroup iface_xdg_surface + */ +#define XDG_SURFACE_SET_MINIMIZED_SINCE_VERSION 1 /** * @ingroup iface_xdg_surface @@ -795,12 +873,17 @@ struct wl_resource *resource); }; -#define XDG_POPUP_POPUP_DONE 0 +#define XDG_POPUP_POPUP_DONE 0 /** * @ingroup iface_xdg_popup */ -#define XDG_POPUP_POPUP_DONE_SINCE_VERSION 1 +#define XDG_POPUP_POPUP_DONE_SINCE_VERSION 1 + +/** + * @ingroup iface_xdg_popup + */ +#define XDG_POPUP_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_xdg_popup
diff --git a/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-client-protocol.h b/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-client-protocol.h index a3ea1a62..50475ca 100644 --- a/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-client-protocol.h +++ b/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-client-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef XDG_SHELL_UNSTABLE_V6_CLIENT_PROTOCOL_H #define XDG_SHELL_UNSTABLE_V6_CLIENT_PROTOCOL_H @@ -84,7 +84,9 @@ * child surface relative to a parent surface. Rules can be defined to ensure * the child surface remains within the visible area's borders, and to * specify how the child surface changes its position, such as sliding along - * an axis, or flipping around a rectangle. + * an axis, or flipping around a rectangle. These positioner-created rules are + * constrained by the requirement that a child surface must intersect with or + * be at least partially adjacent to its parent surface. * * See the various requests for details about possible rules. * @@ -107,7 +109,9 @@ * child surface relative to a parent surface. Rules can be defined to ensure * the child surface remains within the visible area's borders, and to * specify how the child surface changes its position, such as sliding along - * an axis, or flipping around a rectangle. + * an axis, or flipping around a rectangle. These positioner-created rules are + * constrained by the requirement that a child surface must intersect with or + * be at least partially adjacent to its parent surface. * * See the various requests for details about possible rules. * @@ -248,7 +252,8 @@ * The x and y arguments passed when creating the popup object specify * where the top left of the popup should be placed, relative to the * local surface coordinates of the parent surface. See - * xdg_surface.get_popup. + * xdg_surface.get_popup. An xdg_popup must intersect with or be at least + * partially adjacent to its parent surface. * * The client must call wl_surface.commit on the corresponding wl_surface * for the xdg_popup state to take effect. @@ -286,7 +291,8 @@ * The x and y arguments passed when creating the popup object specify * where the top left of the popup should be placed, relative to the * local surface coordinates of the parent surface. See - * xdg_surface.get_popup. + * xdg_surface.get_popup. An xdg_popup must intersect with or be at least + * partially adjacent to its parent surface. * * The client must call wl_surface.commit on the corresponding wl_surface * for the xdg_popup state to take effect. @@ -351,7 +357,7 @@ }; /** - * @ingroup zxdg_shell_v6_iface + * @ingroup iface_zxdg_shell_v6 */ static inline int zxdg_shell_v6_add_listener(struct zxdg_shell_v6 *zxdg_shell_v6, @@ -361,27 +367,32 @@ (void (**)(void)) listener, data); } -#define ZXDG_SHELL_V6_DESTROY 0 -#define ZXDG_SHELL_V6_CREATE_POSITIONER 1 -#define ZXDG_SHELL_V6_GET_XDG_SURFACE 2 -#define ZXDG_SHELL_V6_PONG 3 +#define ZXDG_SHELL_V6_DESTROY 0 +#define ZXDG_SHELL_V6_CREATE_POSITIONER 1 +#define ZXDG_SHELL_V6_GET_XDG_SURFACE 2 +#define ZXDG_SHELL_V6_PONG 3 /** * @ingroup iface_zxdg_shell_v6 */ -#define ZXDG_SHELL_V6_DESTROY_SINCE_VERSION 1 +#define ZXDG_SHELL_V6_PING_SINCE_VERSION 1 + /** * @ingroup iface_zxdg_shell_v6 */ -#define ZXDG_SHELL_V6_CREATE_POSITIONER_SINCE_VERSION 1 +#define ZXDG_SHELL_V6_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zxdg_shell_v6 */ -#define ZXDG_SHELL_V6_GET_XDG_SURFACE_SINCE_VERSION 1 +#define ZXDG_SHELL_V6_CREATE_POSITIONER_SINCE_VERSION 1 /** * @ingroup iface_zxdg_shell_v6 */ -#define ZXDG_SHELL_V6_PONG_SINCE_VERSION 1 +#define ZXDG_SHELL_V6_GET_XDG_SURFACE_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_shell_v6 + */ +#define ZXDG_SHELL_V6_PONG_SINCE_VERSION 1 /** @ingroup iface_zxdg_shell_v6 */ static inline void @@ -559,42 +570,43 @@ }; #endif /* ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM */ -#define ZXDG_POSITIONER_V6_DESTROY 0 -#define ZXDG_POSITIONER_V6_SET_SIZE 1 -#define ZXDG_POSITIONER_V6_SET_ANCHOR_RECT 2 -#define ZXDG_POSITIONER_V6_SET_ANCHOR 3 -#define ZXDG_POSITIONER_V6_SET_GRAVITY 4 -#define ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT 5 -#define ZXDG_POSITIONER_V6_SET_OFFSET 6 +#define ZXDG_POSITIONER_V6_DESTROY 0 +#define ZXDG_POSITIONER_V6_SET_SIZE 1 +#define ZXDG_POSITIONER_V6_SET_ANCHOR_RECT 2 +#define ZXDG_POSITIONER_V6_SET_ANCHOR 3 +#define ZXDG_POSITIONER_V6_SET_GRAVITY 4 +#define ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT 5 +#define ZXDG_POSITIONER_V6_SET_OFFSET 6 + /** * @ingroup iface_zxdg_positioner_v6 */ -#define ZXDG_POSITIONER_V6_DESTROY_SINCE_VERSION 1 +#define ZXDG_POSITIONER_V6_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zxdg_positioner_v6 */ -#define ZXDG_POSITIONER_V6_SET_SIZE_SINCE_VERSION 1 +#define ZXDG_POSITIONER_V6_SET_SIZE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_positioner_v6 */ -#define ZXDG_POSITIONER_V6_SET_ANCHOR_RECT_SINCE_VERSION 1 +#define ZXDG_POSITIONER_V6_SET_ANCHOR_RECT_SINCE_VERSION 1 /** * @ingroup iface_zxdg_positioner_v6 */ -#define ZXDG_POSITIONER_V6_SET_ANCHOR_SINCE_VERSION 1 +#define ZXDG_POSITIONER_V6_SET_ANCHOR_SINCE_VERSION 1 /** * @ingroup iface_zxdg_positioner_v6 */ -#define ZXDG_POSITIONER_V6_SET_GRAVITY_SINCE_VERSION 1 +#define ZXDG_POSITIONER_V6_SET_GRAVITY_SINCE_VERSION 1 /** * @ingroup iface_zxdg_positioner_v6 */ -#define ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION 1 +#define ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION 1 /** * @ingroup iface_zxdg_positioner_v6 */ -#define ZXDG_POSITIONER_V6_SET_OFFSET_SINCE_VERSION 1 +#define ZXDG_POSITIONER_V6_SET_OFFSET_SINCE_VERSION 1 /** @ingroup iface_zxdg_positioner_v6 */ static inline void @@ -798,7 +810,7 @@ }; /** - * @ingroup zxdg_surface_v6_iface + * @ingroup iface_zxdg_surface_v6 */ static inline int zxdg_surface_v6_add_listener(struct zxdg_surface_v6 *zxdg_surface_v6, @@ -808,32 +820,37 @@ (void (**)(void)) listener, data); } -#define ZXDG_SURFACE_V6_DESTROY 0 -#define ZXDG_SURFACE_V6_GET_TOPLEVEL 1 -#define ZXDG_SURFACE_V6_GET_POPUP 2 -#define ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY 3 -#define ZXDG_SURFACE_V6_ACK_CONFIGURE 4 +#define ZXDG_SURFACE_V6_DESTROY 0 +#define ZXDG_SURFACE_V6_GET_TOPLEVEL 1 +#define ZXDG_SURFACE_V6_GET_POPUP 2 +#define ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY 3 +#define ZXDG_SURFACE_V6_ACK_CONFIGURE 4 /** * @ingroup iface_zxdg_surface_v6 */ -#define ZXDG_SURFACE_V6_DESTROY_SINCE_VERSION 1 +#define ZXDG_SURFACE_V6_CONFIGURE_SINCE_VERSION 1 + /** * @ingroup iface_zxdg_surface_v6 */ -#define ZXDG_SURFACE_V6_GET_TOPLEVEL_SINCE_VERSION 1 +#define ZXDG_SURFACE_V6_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zxdg_surface_v6 */ -#define ZXDG_SURFACE_V6_GET_POPUP_SINCE_VERSION 1 +#define ZXDG_SURFACE_V6_GET_TOPLEVEL_SINCE_VERSION 1 /** * @ingroup iface_zxdg_surface_v6 */ -#define ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY_SINCE_VERSION 1 +#define ZXDG_SURFACE_V6_GET_POPUP_SINCE_VERSION 1 /** * @ingroup iface_zxdg_surface_v6 */ -#define ZXDG_SURFACE_V6_ACK_CONFIGURE_SINCE_VERSION 1 +#define ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_surface_v6 + */ +#define ZXDG_SURFACE_V6_ACK_CONFIGURE_SINCE_VERSION 1 /** @ingroup iface_zxdg_surface_v6 */ static inline void @@ -1045,7 +1062,7 @@ * * If the width or height arguments are zero, it means the client * should decide its own window dimension. This may happen when the - * compositor need to configure the state of the surface but + * compositor needs to configure the state of the surface but * doesn't have any information about any previous or expected * dimension. * @@ -1068,18 +1085,18 @@ * The close event is sent by the compositor when the user wants * the surface to be closed. This should be equivalent to the user * clicking the close button in client-side decorations, if your - * application has any... + * application has any. * - * This is only a request that the user intends to close your + * This is only a request that the user intends to close the * window. The client may choose to ignore this request, or show a - * dialog to ask the user to save their data... + * dialog to ask the user to save their data, etc. */ void (*close)(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel_v6); }; /** - * @ingroup zxdg_toplevel_v6_iface + * @ingroup iface_zxdg_toplevel_v6 */ static inline int zxdg_toplevel_v6_add_listener(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, @@ -1089,77 +1106,86 @@ (void (**)(void)) listener, data); } -#define ZXDG_TOPLEVEL_V6_DESTROY 0 -#define ZXDG_TOPLEVEL_V6_SET_PARENT 1 -#define ZXDG_TOPLEVEL_V6_SET_TITLE 2 -#define ZXDG_TOPLEVEL_V6_SET_APP_ID 3 -#define ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU 4 -#define ZXDG_TOPLEVEL_V6_MOVE 5 -#define ZXDG_TOPLEVEL_V6_RESIZE 6 -#define ZXDG_TOPLEVEL_V6_SET_MAX_SIZE 7 -#define ZXDG_TOPLEVEL_V6_SET_MIN_SIZE 8 -#define ZXDG_TOPLEVEL_V6_SET_MAXIMIZED 9 -#define ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED 10 -#define ZXDG_TOPLEVEL_V6_SET_FULLSCREEN 11 -#define ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN 12 -#define ZXDG_TOPLEVEL_V6_SET_MINIMIZED 13 +#define ZXDG_TOPLEVEL_V6_DESTROY 0 +#define ZXDG_TOPLEVEL_V6_SET_PARENT 1 +#define ZXDG_TOPLEVEL_V6_SET_TITLE 2 +#define ZXDG_TOPLEVEL_V6_SET_APP_ID 3 +#define ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU 4 +#define ZXDG_TOPLEVEL_V6_MOVE 5 +#define ZXDG_TOPLEVEL_V6_RESIZE 6 +#define ZXDG_TOPLEVEL_V6_SET_MAX_SIZE 7 +#define ZXDG_TOPLEVEL_V6_SET_MIN_SIZE 8 +#define ZXDG_TOPLEVEL_V6_SET_MAXIMIZED 9 +#define ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED 10 +#define ZXDG_TOPLEVEL_V6_SET_FULLSCREEN 11 +#define ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN 12 +#define ZXDG_TOPLEVEL_V6_SET_MINIMIZED 13 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_DESTROY_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_SET_PARENT_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_CLOSE_SINCE_VERSION 1 + /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_SET_TITLE_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_DESTROY_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_SET_APP_ID_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_SET_PARENT_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_SET_TITLE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_MOVE_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_SET_APP_ID_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_RESIZE_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_SET_MAX_SIZE_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_MOVE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_SET_MIN_SIZE_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_RESIZE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_SET_MAXIMIZED_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_SET_MAX_SIZE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_SET_MIN_SIZE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_SET_FULLSCREEN_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_SET_MAXIMIZED_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_SET_MINIMIZED_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_SET_FULLSCREEN_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_SET_MINIMIZED_SINCE_VERSION 1 /** @ingroup iface_zxdg_toplevel_v6 */ static inline void @@ -1246,7 +1272,7 @@ * service name. * * The compositor shell will try to group application surfaces together - * by their app ID. As a best practice, it is suggested to select app + * by their app ID. As a best practice, it is suggested to select app * ID's that match the basename of the application's .desktop file. * For example, "org.freedesktop.FooViewer" where the .desktop file is * "org.freedesktop.FooViewer.desktop". @@ -1596,7 +1622,7 @@ }; /** - * @ingroup zxdg_popup_v6_iface + * @ingroup iface_zxdg_popup_v6 */ static inline int zxdg_popup_v6_add_listener(struct zxdg_popup_v6 *zxdg_popup_v6, @@ -1606,17 +1632,26 @@ (void (**)(void)) listener, data); } -#define ZXDG_POPUP_V6_DESTROY 0 -#define ZXDG_POPUP_V6_GRAB 1 +#define ZXDG_POPUP_V6_DESTROY 0 +#define ZXDG_POPUP_V6_GRAB 1 /** * @ingroup iface_zxdg_popup_v6 */ -#define ZXDG_POPUP_V6_DESTROY_SINCE_VERSION 1 +#define ZXDG_POPUP_V6_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_popup_v6 */ -#define ZXDG_POPUP_V6_GRAB_SINCE_VERSION 1 +#define ZXDG_POPUP_V6_POPUP_DONE_SINCE_VERSION 1 + +/** + * @ingroup iface_zxdg_popup_v6 + */ +#define ZXDG_POPUP_V6_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_popup_v6 + */ +#define ZXDG_POPUP_V6_GRAB_SINCE_VERSION 1 /** @ingroup iface_zxdg_popup_v6 */ static inline void
diff --git a/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-server-protocol.h b/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-server-protocol.h index 3d45d7c..57dc92b 100644 --- a/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-server-protocol.h +++ b/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-server-protocol.h
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ #ifndef XDG_SHELL_UNSTABLE_V6_SERVER_PROTOCOL_H #define XDG_SHELL_UNSTABLE_V6_SERVER_PROTOCOL_H @@ -87,7 +87,9 @@ * child surface relative to a parent surface. Rules can be defined to ensure * the child surface remains within the visible area's borders, and to * specify how the child surface changes its position, such as sliding along - * an axis, or flipping around a rectangle. + * an axis, or flipping around a rectangle. These positioner-created rules are + * constrained by the requirement that a child surface must intersect with or + * be at least partially adjacent to its parent surface. * * See the various requests for details about possible rules. * @@ -110,7 +112,9 @@ * child surface relative to a parent surface. Rules can be defined to ensure * the child surface remains within the visible area's borders, and to * specify how the child surface changes its position, such as sliding along - * an axis, or flipping around a rectangle. + * an axis, or flipping around a rectangle. These positioner-created rules are + * constrained by the requirement that a child surface must intersect with or + * be at least partially adjacent to its parent surface. * * See the various requests for details about possible rules. * @@ -251,7 +255,8 @@ * The x and y arguments passed when creating the popup object specify * where the top left of the popup should be placed, relative to the * local surface coordinates of the parent surface. See - * xdg_surface.get_popup. + * xdg_surface.get_popup. An xdg_popup must intersect with or be at least + * partially adjacent to its parent surface. * * The client must call wl_surface.commit on the corresponding wl_surface * for the xdg_popup state to take effect. @@ -289,7 +294,8 @@ * The x and y arguments passed when creating the popup object specify * where the top left of the popup should be placed, relative to the * local surface coordinates of the parent surface. See - * xdg_surface.get_popup. + * xdg_surface.get_popup. An xdg_popup must intersect with or be at least + * partially adjacent to its parent surface. * * The client must call wl_surface.commit on the corresponding wl_surface * for the xdg_popup state to take effect. @@ -384,12 +390,29 @@ uint32_t serial); }; -#define ZXDG_SHELL_V6_PING 0 +#define ZXDG_SHELL_V6_PING 0 /** * @ingroup iface_zxdg_shell_v6 */ -#define ZXDG_SHELL_V6_PING_SINCE_VERSION 1 +#define ZXDG_SHELL_V6_PING_SINCE_VERSION 1 + +/** + * @ingroup iface_zxdg_shell_v6 + */ +#define ZXDG_SHELL_V6_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_shell_v6 + */ +#define ZXDG_SHELL_V6_CREATE_POSITIONER_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_shell_v6 + */ +#define ZXDG_SHELL_V6_GET_XDG_SURFACE_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_shell_v6 + */ +#define ZXDG_SHELL_V6_PONG_SINCE_VERSION 1 /** * @ingroup iface_zxdg_shell_v6 @@ -625,6 +648,35 @@ }; +/** + * @ingroup iface_zxdg_positioner_v6 + */ +#define ZXDG_POSITIONER_V6_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_positioner_v6 + */ +#define ZXDG_POSITIONER_V6_SET_SIZE_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_positioner_v6 + */ +#define ZXDG_POSITIONER_V6_SET_ANCHOR_RECT_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_positioner_v6 + */ +#define ZXDG_POSITIONER_V6_SET_ANCHOR_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_positioner_v6 + */ +#define ZXDG_POSITIONER_V6_SET_GRAVITY_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_positioner_v6 + */ +#define ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_positioner_v6 + */ +#define ZXDG_POSITIONER_V6_SET_OFFSET_SINCE_VERSION 1 + #ifndef ZXDG_SURFACE_V6_ERROR_ENUM #define ZXDG_SURFACE_V6_ERROR_ENUM enum zxdg_surface_v6_error { @@ -739,12 +791,33 @@ uint32_t serial); }; -#define ZXDG_SURFACE_V6_CONFIGURE 0 +#define ZXDG_SURFACE_V6_CONFIGURE 0 /** * @ingroup iface_zxdg_surface_v6 */ -#define ZXDG_SURFACE_V6_CONFIGURE_SINCE_VERSION 1 +#define ZXDG_SURFACE_V6_CONFIGURE_SINCE_VERSION 1 + +/** + * @ingroup iface_zxdg_surface_v6 + */ +#define ZXDG_SURFACE_V6_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_surface_v6 + */ +#define ZXDG_SURFACE_V6_GET_TOPLEVEL_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_surface_v6 + */ +#define ZXDG_SURFACE_V6_GET_POPUP_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_surface_v6 + */ +#define ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_surface_v6 + */ +#define ZXDG_SURFACE_V6_ACK_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_surface_v6 @@ -1140,17 +1213,74 @@ struct wl_resource *resource); }; -#define ZXDG_TOPLEVEL_V6_CONFIGURE 0 -#define ZXDG_TOPLEVEL_V6_CLOSE 1 +#define ZXDG_TOPLEVEL_V6_CONFIGURE 0 +#define ZXDG_TOPLEVEL_V6_CLOSE 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_CONFIGURE_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 */ -#define ZXDG_TOPLEVEL_V6_CLOSE_SINCE_VERSION 1 +#define ZXDG_TOPLEVEL_V6_CLOSE_SINCE_VERSION 1 + +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_SET_PARENT_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_SET_TITLE_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_SET_APP_ID_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_MOVE_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_RESIZE_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_SET_MAX_SIZE_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_SET_MIN_SIZE_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_SET_MAXIMIZED_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_SET_FULLSCREEN_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_toplevel_v6 + */ +#define ZXDG_TOPLEVEL_V6_SET_MINIMIZED_SINCE_VERSION 1 /** * @ingroup iface_zxdg_toplevel_v6 @@ -1257,17 +1387,26 @@ uint32_t serial); }; -#define ZXDG_POPUP_V6_CONFIGURE 0 -#define ZXDG_POPUP_V6_POPUP_DONE 1 +#define ZXDG_POPUP_V6_CONFIGURE 0 +#define ZXDG_POPUP_V6_POPUP_DONE 1 /** * @ingroup iface_zxdg_popup_v6 */ -#define ZXDG_POPUP_V6_CONFIGURE_SINCE_VERSION 1 +#define ZXDG_POPUP_V6_CONFIGURE_SINCE_VERSION 1 /** * @ingroup iface_zxdg_popup_v6 */ -#define ZXDG_POPUP_V6_POPUP_DONE_SINCE_VERSION 1 +#define ZXDG_POPUP_V6_POPUP_DONE_SINCE_VERSION 1 + +/** + * @ingroup iface_zxdg_popup_v6 + */ +#define ZXDG_POPUP_V6_DESTROY_SINCE_VERSION 1 +/** + * @ingroup iface_zxdg_popup_v6 + */ +#define ZXDG_POPUP_V6_GRAB_SINCE_VERSION 1 /** * @ingroup iface_zxdg_popup_v6
diff --git a/third_party/wayland-protocols/protocol/alpha-compositing-protocol.c b/third_party/wayland-protocols/protocol/alpha-compositing-protocol.c index 543bff8..271b2c7 100644 --- a/third_party/wayland-protocols/protocol/alpha-compositing-protocol.c +++ b/third_party/wayland-protocols/protocol/alpha-compositing-protocol.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright 2016 The Chromium Authors.
diff --git a/third_party/wayland-protocols/protocol/gaming-input-protocol-v1.c b/third_party/wayland-protocols/protocol/gaming-input-protocol-v1.c index 1e682f8..27e1294 100644 --- a/third_party/wayland-protocols/protocol/gaming-input-protocol-v1.c +++ b/third_party/wayland-protocols/protocol/gaming-input-protocol-v1.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright 2016 The Chromium Authors.
diff --git a/third_party/wayland-protocols/protocol/gaming-input-protocol-v2.c b/third_party/wayland-protocols/protocol/gaming-input-protocol-v2.c index f7cf202..6ddcf3f 100644 --- a/third_party/wayland-protocols/protocol/gaming-input-protocol-v2.c +++ b/third_party/wayland-protocols/protocol/gaming-input-protocol-v2.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright 2016 The Chromium Authors.
diff --git a/third_party/wayland-protocols/protocol/keyboard-configuration-protocol.c b/third_party/wayland-protocols/protocol/keyboard-configuration-protocol.c index 0bddf1c..0a8abf7b 100644 --- a/third_party/wayland-protocols/protocol/keyboard-configuration-protocol.c +++ b/third_party/wayland-protocols/protocol/keyboard-configuration-protocol.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright 2016 The Chromium Authors.
diff --git a/third_party/wayland-protocols/protocol/linux-dmabuf-protocol.c b/third_party/wayland-protocols/protocol/linux-dmabuf-protocol.c index 63b3346..d27b9be 100644 --- a/third_party/wayland-protocols/protocol/linux-dmabuf-protocol.c +++ b/third_party/wayland-protocols/protocol/linux-dmabuf-protocol.c
@@ -1,28 +1,26 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright © 2014, 2015 Collabora, Ltd. * - * Permission to use, copy, modify, distribute, and sell this - * software and its documentation for any purpose is hereby granted - * without fee, provided that the above copyright notice appear in - * all copies and that both that copyright notice and this permission - * notice appear in supporting documentation, and that the name of - * the copyright holders not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied - * warranty. + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ #include <stdlib.h> @@ -41,6 +39,11 @@ NULL, &zwp_linux_buffer_params_v1_interface, &wl_buffer_interface, + NULL, + NULL, + NULL, + NULL, + &wl_buffer_interface, }; static const struct wl_message zwp_linux_dmabuf_v1_requests[] = { @@ -50,28 +53,30 @@ static const struct wl_message zwp_linux_dmabuf_v1_events[] = { { "format", "u", types + 0 }, + { "modifier", "3uuu", types + 0 }, }; WL_EXPORT const struct wl_interface zwp_linux_dmabuf_v1_interface = { - "zwp_linux_dmabuf_v1", 1, + "zwp_linux_dmabuf_v1", 3, 2, zwp_linux_dmabuf_v1_requests, - 1, zwp_linux_dmabuf_v1_events, + 2, zwp_linux_dmabuf_v1_events, }; static const struct wl_message zwp_linux_buffer_params_v1_requests[] = { { "destroy", "", types + 0 }, { "add", "huuuuu", types + 0 }, { "create", "iiuu", types + 0 }, + { "create_immed", "2niiuu", types + 7 }, }; static const struct wl_message zwp_linux_buffer_params_v1_events[] = { - { "created", "n", types + 7 }, + { "created", "n", types + 12 }, { "failed", "", types + 0 }, }; WL_EXPORT const struct wl_interface zwp_linux_buffer_params_v1_interface = { - "zwp_linux_buffer_params_v1", 1, - 3, zwp_linux_buffer_params_v1_requests, + "zwp_linux_buffer_params_v1", 3, + 4, zwp_linux_buffer_params_v1_requests, 2, zwp_linux_buffer_params_v1_events, };
diff --git a/third_party/wayland-protocols/protocol/presentation-time-protocol.c b/third_party/wayland-protocols/protocol/presentation-time-protocol.c index 812d820..c3423f4 100644 --- a/third_party/wayland-protocols/protocol/presentation-time-protocol.c +++ b/third_party/wayland-protocols/protocol/presentation-time-protocol.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright © 2013-2014 Collabora, Ltd.
diff --git a/third_party/wayland-protocols/protocol/remote-shell-protocol.c b/third_party/wayland-protocols/protocol/remote-shell-protocol.c index 316ed59..49695d8 100644 --- a/third_party/wayland-protocols/protocol/remote-shell-protocol.c +++ b/third_party/wayland-protocols/protocol/remote-shell-protocol.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright 2016 The Chromium Authors.
diff --git a/third_party/wayland-protocols/protocol/secure-output-protocol.c b/third_party/wayland-protocols/protocol/secure-output-protocol.c index dd5b403..1ecc646 100644 --- a/third_party/wayland-protocols/protocol/secure-output-protocol.c +++ b/third_party/wayland-protocols/protocol/secure-output-protocol.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright 2016 The Chromium Authors.
diff --git a/third_party/wayland-protocols/protocol/stylus-protocol-v1.c b/third_party/wayland-protocols/protocol/stylus-protocol-v1.c index e84e4bb..d02b7c1 100644 --- a/third_party/wayland-protocols/protocol/stylus-protocol-v1.c +++ b/third_party/wayland-protocols/protocol/stylus-protocol-v1.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright 2016 The Chromium Authors.
diff --git a/third_party/wayland-protocols/protocol/stylus-protocol-v2.c b/third_party/wayland-protocols/protocol/stylus-protocol-v2.c index b3f143f..055a1e8 100644 --- a/third_party/wayland-protocols/protocol/stylus-protocol-v2.c +++ b/third_party/wayland-protocols/protocol/stylus-protocol-v2.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright 2016 The Chromium Authors.
diff --git a/third_party/wayland-protocols/protocol/stylus-tools-protocol.c b/third_party/wayland-protocols/protocol/stylus-tools-protocol.c index 06eaeed..3e7a04e 100644 --- a/third_party/wayland-protocols/protocol/stylus-tools-protocol.c +++ b/third_party/wayland-protocols/protocol/stylus-tools-protocol.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.12.90 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright 2017 The Chromium Authors.
diff --git a/third_party/wayland-protocols/protocol/viewporter-protocol.c b/third_party/wayland-protocols/protocol/viewporter-protocol.c index a3f24331..8bc362c7 100644 --- a/third_party/wayland-protocols/protocol/viewporter-protocol.c +++ b/third_party/wayland-protocols/protocol/viewporter-protocol.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright © 2013-2016 Collabora, Ltd.
diff --git a/third_party/wayland-protocols/protocol/vsync-feedback-protocol.c b/third_party/wayland-protocols/protocol/vsync-feedback-protocol.c index a021d91..c9627d2a 100644 --- a/third_party/wayland-protocols/protocol/vsync-feedback-protocol.c +++ b/third_party/wayland-protocols/protocol/vsync-feedback-protocol.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright 2016 The Chromium Authors.
diff --git a/third_party/wayland-protocols/protocol/xdg-shell-v5-protocol.c b/third_party/wayland-protocols/protocol/xdg-shell-v5-protocol.c index 42a44f0..f2646a2d 100644 --- a/third_party/wayland-protocols/protocol/xdg-shell-v5-protocol.c +++ b/third_party/wayland-protocols/protocol/xdg-shell-v5-protocol.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright © 2008-2013 Kristian Høgsberg
diff --git a/third_party/wayland-protocols/protocol/xdg-shell-v6-protocol.c b/third_party/wayland-protocols/protocol/xdg-shell-v6-protocol.c index d94fe6a4..ce44a5ee 100644 --- a/third_party/wayland-protocols/protocol/xdg-shell-v6-protocol.c +++ b/third_party/wayland-protocols/protocol/xdg-shell-v6-protocol.c
@@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.11.0 */ +/* Generated by wayland-scanner 1.13.0 */ /* * Copyright © 2008-2013 Kristian Høgsberg
diff --git a/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml b/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml index d15355d..1c6c71e7 100644 --- a/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml +++ b/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml
@@ -69,8 +69,8 @@ <enum name="error"> <entry name="role" value="0" summary="given wl_surface has another role"/> - <entry name="invalid_notification_id" value="1" - summary="invalid notification id"/> + <entry name="invalid_notification_key" value="1" + summary="invalid notification key"/> </enum> <enum name="layout_mode"> @@ -122,7 +122,7 @@ </description> <arg name="id" type="new_id" interface="zcr_notification_surface_v1"/> <arg name="surface" type="object" interface="wl_surface"/> - <arg name="notification_id" type="string" /> + <arg name="notification_key" type="string" /> </request> <event name="configuration_changed">
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 545c1e581..75faca3d 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -340,7 +340,7 @@ 'Android arm64 Builder': 'official_goma_minimal_symbols_android_arm64', 'Android Compile': 'official_goma_minimal_symbols_android', 'Android arm64 Compile': 'official_goma_minimal_symbols_android_arm64', - 'Linux Builder': 'official_goma_perf', + 'Linux Builder': 'official_goma', 'Mac Builder': 'official_goma', 'Win Builder': 'official_goma_x86', 'Win x64 Builder': 'official_goma', @@ -1362,10 +1362,6 @@ 'official', 'goma', ], - 'official_goma_perf': [ - 'official', 'goma', 'no_gnome_keyring', - ], - 'official_goma_chromeos': [ 'official', 'goma', 'chromeos', 'x11_cros', ], @@ -1838,10 +1834,6 @@ 'gn_args': 'android_ndk_version="r13b" android_ndk_major_version=13', }, - 'no_gnome_keyring': { - 'gn_args': 'use_gnome_keyring=false', - }, - 'no_pch': { 'gn_args': 'enable_precompiled_headers=false', },
diff --git a/tools/perf/page_sets/system_health/expectations.py b/tools/perf/page_sets/system_health/expectations.py index d2b5f25..ed17aec 100644 --- a/tools/perf/page_sets/system_health/expectations.py +++ b/tools/perf/page_sets/system_health/expectations.py
@@ -90,6 +90,8 @@ [expectations.ALL], 'crbug.com/728152') self.DisableStory('browse:media:flickr_infinite_scroll', [expectations.ALL], 'crbug.com/728785') + self.DisableStory('browse:chrome:newtab', + [expectations.ALL_ANDROID], 'crbug.com/735405') # TODO(rnephew): This disabling should move to CanRunOnBrowser. self.DisableStory('browse:chrome:omnibox', [expectations.ANDROID_WEBVIEW], @@ -126,6 +128,8 @@ [expectations.ALL], 'crbug.com/728152') self.DisableStory('browse:media:flickr_infinite_scroll', [expectations.ALL], 'crbug.com/728785') + self.DisableStory('browse:chrome:newtab', + [expectations.ALL_ANDROID], 'crbug.com/735405') # TODO(rnephew): This disabling should move to CanRunOnBrowser. self.DisableStory('browse:chrome:omnibox', [expectations.ANDROID_WEBVIEW], @@ -207,6 +211,8 @@ [expectations.ALL], 'crbug.com/728152') self.DisableStory('browse:media:flickr_infinite_scroll', [expectations.ALL], 'crbug.com/728785') + self.DisableStory('browse:chrome:newtab', + [expectations.ALL_ANDROID], 'crbug.com/735405') # TODO(rnephew): This disabling should move to CanRunOnBrowser. self.DisableStory('browse:chrome:omnibox', [expectations.ANDROID_WEBVIEW],
diff --git a/ui/ozone/platform/x11/x11_surface_factory.cc b/ui/ozone/platform/x11/x11_surface_factory.cc index a78204f..197b217 100644 --- a/ui/ozone/platform/x11/x11_surface_factory.cc +++ b/ui/ozone/platform/x11/x11_surface_factory.cc
@@ -59,9 +59,8 @@ std::vector<gl::GLImplementation> X11SurfaceFactory::GetAllowedGLImplementations() { - // DesktopGL (GLX) should be the first option when crbug.com/646982 is fixed. return std::vector<gl::GLImplementation>{ - gl::kGLImplementationEGLGLES2, gl::kGLImplementationDesktopGL, + gl::kGLImplementationDesktopGL, gl::kGLImplementationEGLGLES2, gl::kGLImplementationOSMesaGL, gl::kGLImplementationSwiftShaderGL}; }
diff --git a/ui/views/layout/layout_provider.cc b/ui/views/layout/layout_provider.cc index bad5553..3f0f606 100644 --- a/ui/views/layout/layout_provider.cc +++ b/ui/views/layout/layout_provider.cc
@@ -35,9 +35,7 @@ DCHECK_LT(metric, VIEWS_INSETS_MAX); switch (metric) { case InsetsMetric::INSETS_BUBBLE_CONTENTS: - return gfx::Insets( - GetDistanceMetric(DISTANCE_BUBBLE_CONTENTS_VERTICAL_MARGIN), - GetDistanceMetric(DISTANCE_BUBBLE_CONTENTS_HORIZONTAL_MARGIN)); + return gfx::Insets(13, 13); case InsetsMetric::INSETS_BUBBLE_TITLE: { const gfx::Insets bubble_contents = GetInsetsMetric(INSETS_BUBBLE_CONTENTS); @@ -53,9 +51,7 @@ dialog_contents.right()); } case InsetsMetric::INSETS_DIALOG_CONTENTS: - return gfx::Insets( - GetDistanceMetric(DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN), - GetDistanceMetric(DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN)); + return gfx::Insets(13, 20); case InsetsMetric::INSETS_DIALOG_TITLE: { const gfx::Insets dialog_contents = GetInsetsMetric(INSETS_DIALOG_CONTENTS); @@ -72,11 +68,6 @@ int LayoutProvider::GetDistanceMetric(int metric) const { DCHECK_GE(metric, VIEWS_INSETS_MAX); switch (metric) { - case DISTANCE_BUBBLE_CONTENTS_HORIZONTAL_MARGIN: - return 13; - case DISTANCE_BUBBLE_CONTENTS_VERTICAL_MARGIN: - case DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN: - return 13; case DistanceMetric::DISTANCE_BUTTON_HORIZONTAL_PADDING: return 16; case DistanceMetric::DISTANCE_BUTTON_MAX_LINKABLE_WIDTH: @@ -94,8 +85,6 @@ return 20; case DistanceMetric::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH: return 75; - case DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN: - return 20; case DISTANCE_UNRELATED_CONTROL_VERTICAL: return 20; }
diff --git a/ui/views/layout/layout_provider.h b/ui/views/layout/layout_provider.h index 92b5fdf..b7861b39 100644 --- a/ui/views/layout/layout_provider.h +++ b/ui/views/layout/layout_provider.h
@@ -52,10 +52,6 @@ // If a bubble has buttons, this is the margin between them and the rest of // the content. DISTANCE_BUBBLE_BUTTON_TOP_MARGIN = VIEWS_DISTANCE_START, - // Margin on the left and right of the contents of a bubble. - DISTANCE_BUBBLE_CONTENTS_HORIZONTAL_MARGIN, - // Margin on the top and bottom of the contents of a bubble. - DISTANCE_BUBBLE_CONTENTS_VERTICAL_MARGIN, // The default padding to add on each side of a button's label. DISTANCE_BUTTON_HORIZONTAL_PADDING, // The maximum width a button can have and still influence the sizes of @@ -69,10 +65,6 @@ DISTANCE_DIALOG_BUTTON_BOTTOM_MARGIN, // The default minimum width of a dialog button. DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH, - // Margin on the left and right of the contents of a dialog. - DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN, - // Margin on the top and bottom of the contents of a dialog. - DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN, // The spacing between a pair of related horizontal buttons, used for // dialog layout. DISTANCE_RELATED_BUTTON_HORIZONTAL,