| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 bool Browser::TabsNeedBeforeUnloadFired() { | 1204 bool Browser::TabsNeedBeforeUnloadFired() { |
| 1205 if (IsFastTabUnloadEnabled()) | 1205 if (IsFastTabUnloadEnabled()) |
| 1206 return fast_unload_controller_->TabsNeedBeforeUnloadFired(); | 1206 return fast_unload_controller_->TabsNeedBeforeUnloadFired(); |
| 1207 return unload_controller_->TabsNeedBeforeUnloadFired(); | 1207 return unload_controller_->TabsNeedBeforeUnloadFired(); |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 void Browser::ShowValidationMessage(content::WebContents* web_contents, | 1210 void Browser::ShowValidationMessage(content::WebContents* web_contents, |
| 1211 const gfx::Rect& anchor_in_root_view, | 1211 const gfx::Rect& anchor_in_root_view, |
| 1212 const base::string16& main_text, | 1212 const base::string16& main_text, |
| 1213 const base::string16& sub_text) { | 1213 const base::string16& sub_text) { |
| 1214 RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView(); | 1214 validation_message_bubble_ = |
| 1215 if (rwhv) { | 1215 TabDialogs::FromWebContents(web_contents) |
| 1216 validation_message_bubble_ = | 1216 ->ShowValidationMessage(anchor_in_root_view, main_text, sub_text); |
| 1217 chrome::ValidationMessageBubble::CreateAndShow( | |
| 1218 rwhv->GetRenderWidgetHost(), | |
| 1219 anchor_in_root_view, | |
| 1220 main_text, | |
| 1221 sub_text); | |
| 1222 } | |
| 1223 } | 1217 } |
| 1224 | 1218 |
| 1225 void Browser::HideValidationMessage(content::WebContents* web_contents) { | 1219 void Browser::HideValidationMessage(content::WebContents* web_contents) { |
| 1226 validation_message_bubble_.reset(); | 1220 validation_message_bubble_.reset(); |
| 1227 } | 1221 } |
| 1228 | 1222 |
| 1229 void Browser::MoveValidationMessage(content::WebContents* web_contents, | 1223 void Browser::MoveValidationMessage(content::WebContents* web_contents, |
| 1230 const gfx::Rect& anchor_in_root_view) { | 1224 const gfx::Rect& anchor_in_root_view) { |
| 1231 if (!validation_message_bubble_) | 1225 if (!validation_message_bubble_) |
| 1232 return; | 1226 return; |
| (...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2512 if (contents && !allow_js_access) { | 2506 if (contents && !allow_js_access) { |
| 2513 contents->web_contents()->GetController().LoadURL( | 2507 contents->web_contents()->GetController().LoadURL( |
| 2514 target_url, | 2508 target_url, |
| 2515 content::Referrer(), | 2509 content::Referrer(), |
| 2516 ui::PAGE_TRANSITION_LINK, | 2510 ui::PAGE_TRANSITION_LINK, |
| 2517 std::string()); // No extra headers. | 2511 std::string()); // No extra headers. |
| 2518 } | 2512 } |
| 2519 | 2513 |
| 2520 return contents != NULL; | 2514 return contents != NULL; |
| 2521 } | 2515 } |
| OLD | NEW |