| 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 changes to the original after the clone is created will not be |
| 26 // reflected in the clone. |extension_data_| is deep copied. |
| 27 std::unique_ptr<content::NavigationUIData> Clone() const override; |
| 28 |
| 29 #if defined(ENABLE_EXTENSIONS) |
| 30 void SetExtensionNavigationUIData( |
| 31 std::unique_ptr<extensions::ExtensionNavigationUIData> extension_data) { |
| 32 extension_data_ = std::move(extension_data); |
| 33 } |
| 34 |
| 35 extensions::ExtensionNavigationUIData* GetExtensionNavigationUIData() const { |
| 36 return extension_data_.get(); |
| 37 } |
| 38 #endif |
| 39 |
| 40 private: |
| 41 #if defined(ENABLE_EXTENSIONS) |
| 42 // Manages the lifetime of optional ExtensionNavigationUIData information. |
| 43 std::unique_ptr<extensions::ExtensionNavigationUIData> extension_data_; |
| 44 #endif |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(ChromeNavigationUIData); |
| 47 }; |
| 48 |
| 49 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_NAVIGATION_UI_DATA_H_ |
| OLD | NEW |