| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/info_bar_alternate_nav_url_view.h" | 5 #include "chrome/browser/views/info_bar_alternate_nav_url_view.h" |
| 6 | 6 |
| 7 #include "chrome/app/theme/theme_resources.h" | 7 #include "chrome/app/theme/theme_resources.h" |
| 8 #include "chrome/browser/web_contents.h" | 8 #include "chrome/browser/web_contents.h" |
| 9 #include "chrome/browser/views/event_utils.h" | 9 #include "chrome/browser/views/event_utils.h" |
| 10 #include "chrome/browser/views/info_bar_view.h" | 10 #include "chrome/browser/views/info_bar_view.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // in the other order would be problematic if navigation synchronously closed | 53 // in the other order would be problematic if navigation synchronously closed |
| 54 // the bar, as on return from the call, |this| would not exist, and calling | 54 // the bar, as on return from the call, |this| would not exist, and calling |
| 55 // Close() would corrupt memory). This means we need to save off all members | 55 // Close() would corrupt memory). This means we need to save off all members |
| 56 // we need before calling Close(), which destroys us. | 56 // we need before calling Close(), which destroys us. |
| 57 PageNavigator* const navigator = | 57 PageNavigator* const navigator = |
| 58 static_cast<InfoBarView*>(GetParent())->web_contents(); | 58 static_cast<InfoBarView*>(GetParent())->web_contents(); |
| 59 const GURL gurl(alternate_nav_url_); | 59 const GURL gurl(alternate_nav_url_); |
| 60 | 60 |
| 61 BeginClose(); | 61 BeginClose(); |
| 62 | 62 |
| 63 navigator->OpenURL(gurl, event_utils::DispositionFromEventFlags(event_flags), | 63 navigator->OpenURL(gurl, GURL(), |
| 64 event_utils::DispositionFromEventFlags(event_flags), |
| 64 // Pretend the user typed this URL, so that navigating to | 65 // Pretend the user typed this URL, so that navigating to |
| 65 // it will be the default action when it's typed again in | 66 // it will be the default action when it's typed again in |
| 66 // the future. | 67 // the future. |
| 67 PageTransition::TYPED); | 68 PageTransition::TYPED); |
| 68 } | 69 } |
| 69 | 70 |
| OLD | NEW |