Chromium Code Reviews| 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 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 2392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2403 } | 2403 } |
| 2404 | 2404 |
| 2405 // We are supposed to get a single call to Show for a newly created RenderView | 2405 // We are supposed to get a single call to Show for a newly created RenderView |
| 2406 // that was created via RenderViewImpl::CreateWebView. So, we wait until this | 2406 // that was created via RenderViewImpl::CreateWebView. So, we wait until this |
| 2407 // point to dispatch the ShowView message. | 2407 // point to dispatch the ShowView message. |
| 2408 // | 2408 // |
| 2409 // This method provides us with the information about how to display the newly | 2409 // This method provides us with the information about how to display the newly |
| 2410 // created RenderView (i.e., as a blocked popup or as a new tab). | 2410 // created RenderView (i.e., as a blocked popup or as a new tab). |
| 2411 // | 2411 // |
| 2412 void RenderViewImpl::show(WebNavigationPolicy policy) { | 2412 void RenderViewImpl::show(WebNavigationPolicy policy) { |
| 2413 DCHECK(!did_show_) << "received extraneous Show call"; | 2413 if (did_show_) { |
| 2414 #if defined(OS_ANDROID) | |
|
joth
2012/10/25 17:27:18
maybe add a comment to explain the reasoning here.
mnaganov (inactive)
2012/10/26 10:05:42
Done.
| |
| 2415 if (!webkit_preferences_.supports_multiple_windows) | |
| 2416 return; | |
| 2417 #endif | |
| 2418 NOTREACHED() << "received extraneous Show call"; | |
| 2419 return; | |
| 2420 } | |
| 2421 did_show_ = true; | |
| 2422 | |
| 2414 DCHECK(opener_id_ != MSG_ROUTING_NONE); | 2423 DCHECK(opener_id_ != MSG_ROUTING_NONE); |
| 2415 | 2424 |
| 2416 if (did_show_) | |
| 2417 return; | |
| 2418 did_show_ = true; | |
| 2419 | |
| 2420 if (GetContentClient()->renderer()->AllowPopup(creator_url_)) | 2425 if (GetContentClient()->renderer()->AllowPopup(creator_url_)) |
| 2421 opened_by_user_gesture_ = true; | 2426 opened_by_user_gesture_ = true; |
| 2422 | 2427 |
| 2423 // Force new windows to a popup if they were not opened with a user gesture. | 2428 // Force new windows to a popup if they were not opened with a user gesture. |
| 2424 if (!opened_by_user_gesture_) { | 2429 if (!opened_by_user_gesture_) { |
| 2425 // We exempt background tabs for compat with older versions of Chrome. | 2430 // We exempt background tabs for compat with older versions of Chrome. |
| 2426 // TODO(darin): This seems bogus. These should have a user gesture, so | 2431 // TODO(darin): This seems bogus. These should have a user gesture, so |
| 2427 // we probably don't need this check. | 2432 // we probably don't need this check. |
| 2428 if (policy != WebKit::WebNavigationPolicyNewBackgroundTab) | 2433 if (policy != WebKit::WebNavigationPolicyNewBackgroundTab) |
| 2429 policy = WebKit::WebNavigationPolicyNewPopup; | 2434 policy = WebKit::WebNavigationPolicyNewPopup; |
| (...skipping 3997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6427 } | 6432 } |
| 6428 #endif | 6433 #endif |
| 6429 | 6434 |
| 6430 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6435 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
| 6431 TransportDIB::Handle dib_handle) { | 6436 TransportDIB::Handle dib_handle) { |
| 6432 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6437 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
| 6433 RenderProcess::current()->ReleaseTransportDIB(dib); | 6438 RenderProcess::current()->ReleaseTransportDIB(dib); |
| 6434 } | 6439 } |
| 6435 | 6440 |
| 6436 } // namespace content | 6441 } // namespace content |
| OLD | NEW |