| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 } | 521 } |
| 522 | 522 |
| 523 void OnCommit() override {} | 523 void OnCommit() override {} |
| 524 | 524 |
| 525 int64_t TraceId() const override { return latency_info_.trace_id(); } | 525 int64_t TraceId() const override { return latency_info_.trace_id(); } |
| 526 | 526 |
| 527 private: | 527 private: |
| 528 ui::LatencyInfo latency_info_; | 528 ui::LatencyInfo latency_info_; |
| 529 }; | 529 }; |
| 530 | 530 |
| 531 const char kWindowFeatureBackground[] = "background"; | |
| 532 const char kWindowFeaturePersistent[] = "persistent"; | |
| 533 | |
| 534 content::mojom::WindowContainerType WindowFeaturesToContainerType( | 531 content::mojom::WindowContainerType WindowFeaturesToContainerType( |
| 535 const blink::WebWindowFeatures& window_features) { | 532 const blink::WebWindowFeatures& window_features) { |
| 536 bool background = false; | 533 if (window_features.background) { |
| 537 bool persistent = false; | 534 if (window_features.persistent) |
| 538 | |
| 539 for (size_t i = 0; i < window_features.additional_features.size(); ++i) { | |
| 540 blink::WebString feature = window_features.additional_features[i]; | |
| 541 if (feature.ContainsOnlyASCII()) { | |
| 542 std::string featureASCII = feature.Ascii(); | |
| 543 if (base::LowerCaseEqualsASCII(featureASCII, kWindowFeatureBackground)) { | |
| 544 background = true; | |
| 545 } else if (base::LowerCaseEqualsASCII(featureASCII, | |
| 546 kWindowFeaturePersistent)) { | |
| 547 persistent = true; | |
| 548 } | |
| 549 } | |
| 550 } | |
| 551 | |
| 552 if (background) { | |
| 553 if (persistent) | |
| 554 return content::mojom::WindowContainerType::PERSISTENT; | 535 return content::mojom::WindowContainerType::PERSISTENT; |
| 555 else | 536 else |
| 556 return content::mojom::WindowContainerType::BACKGROUND; | 537 return content::mojom::WindowContainerType::BACKGROUND; |
| 557 } else { | 538 } else { |
| 558 return content::mojom::WindowContainerType::NORMAL; | 539 return content::mojom::WindowContainerType::NORMAL; |
| 559 } | 540 } |
| 560 } | 541 } |
| 561 | 542 |
| 562 } // namespace | 543 } // namespace |
| 563 | 544 |
| (...skipping 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2662 input_event.GetCoalescedEventsPointers(), latency_info, | 2643 input_event.GetCoalescedEventsPointers(), latency_info, |
| 2663 dispatch_type); | 2644 dispatch_type); |
| 2664 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 2645 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
| 2665 } | 2646 } |
| 2666 idle_user_detector_->ActivityDetected(); | 2647 idle_user_detector_->ActivityDetected(); |
| 2667 return RenderWidget::HandleInputEvent(input_event, latency_info, | 2648 return RenderWidget::HandleInputEvent(input_event, latency_info, |
| 2668 dispatch_type); | 2649 dispatch_type); |
| 2669 } | 2650 } |
| 2670 | 2651 |
| 2671 } // namespace content | 2652 } // namespace content |
| OLD | NEW |