Chromium Code Reviews| 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()) |
|
Devlin
2016/11/16 16:17:14
Can we add a comment for why we only perform the w
clamy
2016/11/17 14:07:41
Done.
| |
| 488 return; | |
| 489 | |
| 488 WindowEventsReady(); | 490 WindowEventsReady(); |
| 489 if (on_first_commit_callback_.is_null()) | 491 if (on_first_commit_callback_.is_null()) |
| 490 return; | 492 return; |
| 491 // It is important that the callback executes after the calls to | 493 // It is important that the callback executes after the calls to |
| 492 // WebContentsObserver::ReadyToCommitNavigation have been processed. The | 494 // WebContentsObserver::ReadyToCommitNavigation have been processed. The |
| 493 // CommitNavigation IPC that will properly set up the renderer will only be | 495 // 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, | 496 // sent after these, and it must be sent before the callback gets to run, |
| 495 // hence the use of PostTask. | 497 // hence the use of PostTask. |
| 496 base::ThreadTaskRunnerHandle::Get()->PostTask( | 498 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 497 FROM_HERE, base::ResetAndReturn(&on_first_commit_callback_)); | 499 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(), | 1157 region.bounds.x(), |
| 1156 region.bounds.y(), | 1158 region.bounds.y(), |
| 1157 region.bounds.right(), | 1159 region.bounds.right(), |
| 1158 region.bounds.bottom(), | 1160 region.bounds.bottom(), |
| 1159 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 1161 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 1160 } | 1162 } |
| 1161 return sk_region; | 1163 return sk_region; |
| 1162 } | 1164 } |
| 1163 | 1165 |
| 1164 } // namespace extensions | 1166 } // namespace extensions |
| OLD | NEW |