OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "extensions/browser/extension_navigation_ui_data.h" |
| 6 |
| 7 #include "content/public/browser/navigation_handle.h" |
| 8 |
| 9 namespace extensions { |
| 10 |
| 11 ExtensionNavigationUIData::ExtensionNavigationUIData() {} |
| 12 |
| 13 ExtensionNavigationUIData::ExtensionNavigationUIData( |
| 14 content::NavigationHandle* navigation_handle, |
| 15 int tab_id, |
| 16 int window_id) { |
| 17 // TODO(clamy): See if it would be possible to have just one source for the |
| 18 // FrameData that works both for navigations and subresources loads. |
| 19 frame_data_.frame_id = ExtensionApiFrameIdMap::GetFrameId(navigation_handle); |
| 20 frame_data_.parent_frame_id = |
| 21 ExtensionApiFrameIdMap::GetParentFrameId(navigation_handle); |
| 22 frame_data_.tab_id = tab_id; |
| 23 frame_data_.window_id = window_id; |
| 24 } |
| 25 |
| 26 std::unique_ptr<ExtensionNavigationUIData> ExtensionNavigationUIData::DeepCopy() |
| 27 const { |
| 28 std::unique_ptr<ExtensionNavigationUIData> copy( |
| 29 new ExtensionNavigationUIData()); |
| 30 copy->set_frame_data(frame_data_); |
| 31 return copy; |
| 32 } |
| 33 |
| 34 } // namespace extensions |
OLD | NEW |