OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/chrome/browser/infobars/infobar_manager_impl.h" | 5 #include "ios/chrome/browser/infobars/infobar_manager_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "components/infobars/core/confirm_infobar_delegate.h" | 9 #include "components/infobars/core/confirm_infobar_delegate.h" |
10 #include "components/infobars/core/infobar.h" | 10 #include "components/infobars/core/infobar.h" |
11 #include "components/infobars/core/infobar_delegate.h" | 11 #include "components/infobars/core/infobar_delegate.h" |
12 #include "ios/chrome/browser/infobars/infobar_utils.h" | 12 #include "ios/chrome/browser/infobars/infobar_utils.h" |
13 #include "ios/web/public/load_committed_details.h" | 13 #include "ios/web/public/load_committed_details.h" |
14 #include "ios/web/public/navigation_item.h" | 14 #include "ios/web/public/navigation_item.h" |
15 #include "ios/web/public/navigation_manager.h" | 15 #include "ios/web/public/navigation_manager.h" |
16 #include "ios/web/public/web_state/web_state.h" | 16 #include "ios/web/public/web_state/web_state.h" |
17 #include "ui/base/page_transition_types.h" | 17 #include "ui/base/page_transition_types.h" |
18 | 18 |
| 19 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 20 #error "This file requires ARC support." |
| 21 #endif |
| 22 |
19 DEFINE_WEB_STATE_USER_DATA_KEY(InfoBarManagerImpl); | 23 DEFINE_WEB_STATE_USER_DATA_KEY(InfoBarManagerImpl); |
20 | 24 |
21 namespace { | 25 namespace { |
22 | 26 |
23 infobars::InfoBarDelegate::NavigationDetails | 27 infobars::InfoBarDelegate::NavigationDetails |
24 NavigationDetailsFromLoadCommittedDetails( | 28 NavigationDetailsFromLoadCommittedDetails( |
25 const web::LoadCommittedDetails& load_details) { | 29 const web::LoadCommittedDetails& load_details) { |
26 infobars::InfoBarDelegate::NavigationDetails navigation_details; | 30 infobars::InfoBarDelegate::NavigationDetails navigation_details; |
27 navigation_details.entry_id = load_details.item->GetUniqueID(); | 31 navigation_details.entry_id = load_details.item->GetUniqueID(); |
28 const ui::PageTransition transition = load_details.item->GetTransitionType(); | 32 const ui::PageTransition transition = load_details.item->GetTransitionType(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // or use it otherwise during the destruction. | 82 // or use it otherwise during the destruction. |
79 web_state()->RemoveUserData(UserDataKey()); | 83 web_state()->RemoveUserData(UserDataKey()); |
80 // That was the equivalent of "delete this". This object is now destroyed; | 84 // That was the equivalent of "delete this". This object is now destroyed; |
81 // returning from this function is the only safe thing to do. | 85 // returning from this function is the only safe thing to do. |
82 } | 86 } |
83 | 87 |
84 void InfoBarManagerImpl::OpenURL(const GURL& url, | 88 void InfoBarManagerImpl::OpenURL(const GURL& url, |
85 WindowOpenDisposition disposition) { | 89 WindowOpenDisposition disposition) { |
86 NOTIMPLEMENTED(); | 90 NOTIMPLEMENTED(); |
87 } | 91 } |
OLD | NEW |