| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/app_window/app_window.h" | 5 #include "extensions/browser/app_window/app_window.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 Show(delayed_show_type_); | 477 Show(delayed_show_type_); |
| 478 } | 478 } |
| 479 } | 479 } |
| 480 | 480 |
| 481 void AppWindow::SetOnFirstCommitCallback(const base::Closure& callback) { | 481 void AppWindow::SetOnFirstCommitCallback(const base::Closure& callback) { |
| 482 DCHECK(on_first_commit_callback_.is_null()); | 482 DCHECK(on_first_commit_callback_.is_null()); |
| 483 on_first_commit_callback_ = callback; | 483 on_first_commit_callback_ = callback; |
| 484 } | 484 } |
| 485 | 485 |
| 486 void AppWindow::OnReadyToCommitFirstNavigation() { | 486 void AppWindow::OnReadyToCommitFirstNavigation() { |
| 487 CHECK(content::IsBrowserSideNavigationEnabled()); | 487 if (!content::IsBrowserSideNavigationEnabled()) |
| 488 return; |
| 489 |
| 490 // PlzNavigate: execute renderer-side setup now that there is a renderer |
| 491 // process assigned to the navigation. With renderer-side navigation, this |
| 492 // would happen before the navigation starts, but PlzNavigate must wait until |
| 493 // this point in time in the navigation. |
| 494 |
| 488 WindowEventsReady(); | 495 WindowEventsReady(); |
| 489 if (on_first_commit_callback_.is_null()) | 496 if (on_first_commit_callback_.is_null()) |
| 490 return; | 497 return; |
| 491 // It is important that the callback executes after the calls to | 498 // It is important that the callback executes after the calls to |
| 492 // WebContentsObserver::ReadyToCommitNavigation have been processed. The | 499 // WebContentsObserver::ReadyToCommitNavigation have been processed. The |
| 493 // CommitNavigation IPC that will properly set up the renderer will only be | 500 // CommitNavigation IPC that will properly set up the renderer will only be |
| 494 // sent after these, and it must be sent before the callback gets to run, | 501 // sent after these, and it must be sent before the callback gets to run, |
| 495 // hence the use of PostTask. | 502 // hence the use of PostTask. |
| 496 base::ThreadTaskRunnerHandle::Get()->PostTask( | 503 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 497 FROM_HERE, base::ResetAndReturn(&on_first_commit_callback_)); | 504 FROM_HERE, base::ResetAndReturn(&on_first_commit_callback_)); |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 region.bounds.x(), | 1162 region.bounds.x(), |
| 1156 region.bounds.y(), | 1163 region.bounds.y(), |
| 1157 region.bounds.right(), | 1164 region.bounds.right(), |
| 1158 region.bounds.bottom(), | 1165 region.bounds.bottom(), |
| 1159 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 1166 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 1160 } | 1167 } |
| 1161 return sk_region; | 1168 return sk_region; |
| 1162 } | 1169 } |
| 1163 | 1170 |
| 1164 } // namespace extensions | 1171 } // namespace extensions |
| OLD | NEW |