| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog
.h" | 5 #include "chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog
.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "url/gurl.h" | 28 #include "url/gurl.h" |
| 29 | 29 |
| 30 using content::WebContents; | 30 using content::WebContents; |
| 31 | 31 |
| 32 namespace arc { | 32 namespace arc { |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 // TODO(yusukes|djacobo): Find a better way to detect a request loop and remove | 36 // TODO(yusukes|djacobo): Find a better way to detect a request loop and remove |
| 37 // the global variables. | 37 // the global variables. |
| 38 base::LazyInstance<GURL> g_last_url = LAZY_INSTANCE_INITIALIZER; | 38 base::LazyInstance<GURL>::DestructorAtExit g_last_url = |
| 39 LAZY_INSTANCE_INITIALIZER; |
| 39 ui::PageTransition g_last_page_transition; | 40 ui::PageTransition g_last_page_transition; |
| 40 | 41 |
| 41 // Shows the Chrome OS' original external protocol dialog as a fallback. | 42 // Shows the Chrome OS' original external protocol dialog as a fallback. |
| 42 void ShowFallbackExternalProtocolDialog(int render_process_host_id, | 43 void ShowFallbackExternalProtocolDialog(int render_process_host_id, |
| 43 int routing_id, | 44 int routing_id, |
| 44 const GURL& url) { | 45 const GURL& url) { |
| 45 WebContents* web_contents = | 46 WebContents* web_contents = |
| 46 tab_util::GetWebContentsByID(render_process_host_id, routing_id); | 47 tab_util::GetWebContentsByID(render_process_host_id, routing_id); |
| 47 new ExternalProtocolDialog(web_contents, url); | 48 new ExternalProtocolDialog(web_contents, url); |
| 48 } | 49 } |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 bool IsSafeToRedirectToArcWithoutUserConfirmationForTesting( | 508 bool IsSafeToRedirectToArcWithoutUserConfirmationForTesting( |
| 508 const GURL& url, | 509 const GURL& url, |
| 509 ui::PageTransition page_transition, | 510 ui::PageTransition page_transition, |
| 510 const GURL& last_url, | 511 const GURL& last_url, |
| 511 ui::PageTransition last_page_transition) { | 512 ui::PageTransition last_page_transition) { |
| 512 return IsSafeToRedirectToArcWithoutUserConfirmation( | 513 return IsSafeToRedirectToArcWithoutUserConfirmation( |
| 513 url, page_transition, last_url, last_page_transition); | 514 url, page_transition, last_url, last_page_transition); |
| 514 } | 515 } |
| 515 | 516 |
| 516 } // namespace arc | 517 } // namespace arc |
| OLD | NEW |