| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/autofill/autofill_dialog_sign_in_delegate.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_sign_in_delegate.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" | 7 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" |
| 8 #include "chrome/browser/ui/browser_finder.h" | 8 #include "chrome/browser/ui/browser_finder.h" |
| 9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
| 10 #include "components/autofill/content/browser/wallet/wallet_service_url.h" | 10 #include "components/autofill/content/browser/wallet/wallet_service_url.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 std::string()); | 82 std::string()); |
| 83 return source; | 83 return source; |
| 84 } | 84 } |
| 85 | 85 |
| 86 // This gets invoked whenever there is an attempt to open a new window/tab. | 86 // This gets invoked whenever there is an attempt to open a new window/tab. |
| 87 // Reroute to the original browser. | 87 // Reroute to the original browser. |
| 88 void AutofillDialogSignInDelegate::AddNewContents( | 88 void AutofillDialogSignInDelegate::AddNewContents( |
| 89 content::WebContents* source, | 89 content::WebContents* source, |
| 90 content::WebContents* new_contents, | 90 content::WebContents* new_contents, |
| 91 WindowOpenDisposition disposition, | 91 WindowOpenDisposition disposition, |
| 92 const gfx::Rect& initial_pos, | 92 const gfx::Rect& initial_rect, |
| 93 bool user_gesture, | 93 bool user_gesture, |
| 94 bool* was_blocked) { | 94 bool* was_blocked) { |
| 95 chrome::AddWebContents( | 95 chrome::AddWebContents( |
| 96 chrome::FindBrowserWithWebContents(originating_web_contents_), | 96 chrome::FindBrowserWithWebContents(originating_web_contents_), |
| 97 source, new_contents, disposition, initial_pos, user_gesture, | 97 source, new_contents, disposition, initial_rect, user_gesture, |
| 98 was_blocked); | 98 was_blocked); |
| 99 } | 99 } |
| 100 | 100 |
| 101 bool AutofillDialogSignInDelegate::PreHandleGestureEvent( | 101 bool AutofillDialogSignInDelegate::PreHandleGestureEvent( |
| 102 content::WebContents* source, | 102 content::WebContents* source, |
| 103 const blink::WebGestureEvent& event) { | 103 const blink::WebGestureEvent& event) { |
| 104 // Disable pinch zooming. | 104 // Disable pinch zooming. |
| 105 return event.type == blink::WebGestureEvent::GesturePinchBegin || | 105 return event.type == blink::WebGestureEvent::GesturePinchBegin || |
| 106 event.type == blink::WebGestureEvent::GesturePinchUpdate || | 106 event.type == blink::WebGestureEvent::GesturePinchUpdate || |
| 107 event.type == blink::WebGestureEvent::GesturePinchEnd; | 107 event.type == blink::WebGestureEvent::GesturePinchEnd; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 125 | 125 |
| 126 void AutofillDialogSignInDelegate::EnableAutoResize() { | 126 void AutofillDialogSignInDelegate::EnableAutoResize() { |
| 127 DCHECK(!minimum_size_.IsEmpty()); | 127 DCHECK(!minimum_size_.IsEmpty()); |
| 128 DCHECK(!maximum_size_.IsEmpty()); | 128 DCHECK(!maximum_size_.IsEmpty()); |
| 129 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | 129 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
| 130 if (host) | 130 if (host) |
| 131 host->EnableAutoResize(minimum_size_, maximum_size_); | 131 host->EnableAutoResize(minimum_size_, maximum_size_); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace autofill | 134 } // namespace autofill |
| OLD | NEW |