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 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_UI_DATA_H_ | |
6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_UI_DATA_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/macros.h" | |
11 #include "content/public/browser/navigation_ui_data.h" | |
12 #include "extensions/browser/extension_navigation_ui_data.h" | |
13 | |
14 namespace content { | |
15 class NavigationHandle; | |
16 } | |
17 | |
18 class ChromeNavigationUIData : public content::NavigationUIData { | |
19 public: | |
20 ChromeNavigationUIData(); | |
21 explicit ChromeNavigationUIData(content::NavigationHandle* navigation_handle); | |
22 ~ChromeNavigationUIData() override; | |
23 | |
24 // Creates a new ChromeNavigationUIData that is a deep copy of the original. | |
25 // Any | |
Devlin
2016/09/16 16:17:26
nit: wrapping
clamy
2016/09/19 15:10:03
Done.
| |
26 // changes to the original after the clone is created will not be reflected in | |
27 // the clone. | |
28 // |extension_data_| is deep copied. | |
29 std::unique_ptr<content::NavigationUIData> Clone() const override; | |
30 | |
31 #if defined(ENABLE_EXTENSIONS) | |
32 void SetExtensionNavigationUIData( | |
33 std::unique_ptr<extensions::ExtensionNavigationUIData> extension_data) { | |
34 extension_data_ = std::move(extension_data); | |
35 } | |
36 | |
37 extensions::ExtensionNavigationUIData* GetExtensionNavigationUIData() const { | |
38 return extension_data_.get(); | |
39 } | |
40 #endif | |
41 | |
42 private: | |
43 #if defined(ENABLE_EXTENSIONS) | |
44 // Manages the lifetime of optional ExtensionNavigationUIData information. | |
45 std::unique_ptr<extensions::ExtensionNavigationUIData> extension_data_; | |
46 #endif | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(ChromeNavigationUIData); | |
49 }; | |
50 | |
51 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_UI_DATA_H_ | |
OLD | NEW |