OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_HISTORY_HISTORY_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_TAB_HELPER_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_TAB_HELPER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
12 | 12 |
13 class HistoryService; | 13 class HistoryService; |
14 class SkBitmap; | 14 class SkBitmap; |
15 struct ThumbnailScore; | 15 struct ThumbnailScore; |
16 | 16 |
17 namespace history { | 17 namespace history { |
18 class HistoryAddPageArgs; | 18 struct HistoryAddPageArgs; |
19 } | 19 } |
20 | 20 |
21 class HistoryTabHelper : public content::WebContentsObserver, | 21 class HistoryTabHelper : public content::WebContentsObserver, |
22 public content::NotificationObserver { | 22 public content::NotificationObserver { |
23 public: | 23 public: |
24 explicit HistoryTabHelper(content::WebContents* web_contents); | 24 explicit HistoryTabHelper(content::WebContents* web_contents); |
25 virtual ~HistoryTabHelper(); | 25 virtual ~HistoryTabHelper(); |
26 | 26 |
27 // Updates history with the specified navigation. This is called by | 27 // Updates history with the specified navigation. This is called by |
28 // OnMsgNavigate to update history state. | 28 // OnMsgNavigate to update history state. |
29 void UpdateHistoryForNavigation( | 29 void UpdateHistoryForNavigation( |
30 scoped_refptr<history::HistoryAddPageArgs> add_page_args); | 30 const history::HistoryAddPageArgs& add_page_args); |
31 | 31 |
32 // Sends the page title to the history service. This is called when we receive | 32 // Sends the page title to the history service. This is called when we receive |
33 // the page title and we know we want to update history. | 33 // the page title and we know we want to update history. |
34 void UpdateHistoryPageTitle(const content::NavigationEntry& entry); | 34 void UpdateHistoryPageTitle(const content::NavigationEntry& entry); |
35 | 35 |
36 // Returns the history::HistoryAddPageArgs to use for adding a page to | 36 // Returns the history::HistoryAddPageArgs to use for adding a page to |
37 // history. | 37 // history. |
38 scoped_refptr<history::HistoryAddPageArgs> CreateHistoryAddPageArgs( | 38 history::HistoryAddPageArgs CreateHistoryAddPageArgs( |
39 const GURL& virtual_url, | 39 const GURL& virtual_url, |
40 const content::LoadCommittedDetails& details, | 40 const content::LoadCommittedDetails& details, |
41 const content::FrameNavigateParams& params); | 41 const content::FrameNavigateParams& params); |
42 | 42 |
43 private: | 43 private: |
44 // content::WebContentsObserver implementation. | 44 // content::WebContentsObserver implementation. |
45 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 45 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
46 virtual void DidNavigateMainFrame( | 46 virtual void DidNavigateMainFrame( |
47 const content::LoadCommittedDetails& details, | 47 const content::LoadCommittedDetails& details, |
48 const content::FrameNavigateParams& params) OVERRIDE; | 48 const content::FrameNavigateParams& params) OVERRIDE; |
(...skipping 22 matching lines...) Expand all Loading... |
71 // prevents some weirdness because some AJAXy apps use titles for status | 71 // prevents some weirdness because some AJAXy apps use titles for status |
72 // messages. | 72 // messages. |
73 bool received_page_title_; | 73 bool received_page_title_; |
74 | 74 |
75 content::NotificationRegistrar registrar_; | 75 content::NotificationRegistrar registrar_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(HistoryTabHelper); | 77 DISALLOW_COPY_AND_ASSIGN(HistoryTabHelper); |
78 }; | 78 }; |
79 | 79 |
80 #endif // CHROME_BROWSER_HISTORY_HISTORY_TAB_HELPER_H_ | 80 #endif // CHROME_BROWSER_HISTORY_HISTORY_TAB_HELPER_H_ |
OLD | NEW |