| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/browser/tab_contents/tab_contents_observer.h" | 9 #include "content/browser/tab_contents/tab_contents_observer.h" |
| 10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 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 scoped_refptr<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 ViewHostMsg_FrameNavigate_Params& params); | 41 const ViewHostMsg_FrameNavigate_Params& params); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // TabContentsObserver implementation. | 44 // TabContentsObserver implementation. |
| 45 virtual bool OnMessageReceived(const IPC::Message& message); | 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 ViewHostMsg_FrameNavigate_Params& params); | 48 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; |
| 49 virtual void DidNavigateAnyFrame( | 49 virtual void DidNavigateAnyFrame( |
| 50 const content::LoadCommittedDetails& details, | 50 const content::LoadCommittedDetails& details, |
| 51 const ViewHostMsg_FrameNavigate_Params& params); | 51 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE; |
| 52 | 52 |
| 53 // content::NotificationObserver implementation. | 53 // content::NotificationObserver implementation. |
| 54 virtual void Observe(int type, | 54 virtual void Observe(int type, |
| 55 const content::NotificationSource& source, | 55 const content::NotificationSource& source, |
| 56 const content::NotificationDetails& details); | 56 const content::NotificationDetails& details) OVERRIDE; |
| 57 | 57 |
| 58 void OnPageContents(const GURL& url, | 58 void OnPageContents(const GURL& url, |
| 59 int32 page_id, | 59 int32 page_id, |
| 60 const string16& contents); | 60 const string16& contents); |
| 61 void OnThumbnail(const GURL& url, | 61 void OnThumbnail(const GURL& url, |
| 62 const ThumbnailScore& score, | 62 const ThumbnailScore& score, |
| 63 const SkBitmap& bitmap); | 63 const SkBitmap& bitmap); |
| 64 | 64 |
| 65 // Helper function to return the history service. May return NULL. | 65 // Helper function to return the history service. May return NULL. |
| 66 HistoryService* GetHistoryService(); | 66 HistoryService* GetHistoryService(); |
| 67 | 67 |
| 68 // Whether we have a (non-empty) title for the current page. | 68 // Whether we have a (non-empty) title for the current page. |
| 69 // Used to prevent subsequent title updates from affecting history. This | 69 // Used to prevent subsequent title updates from affecting history. This |
| 70 // prevents some weirdness because some AJAXy apps use titles for status | 70 // prevents some weirdness because some AJAXy apps use titles for status |
| 71 // messages. | 71 // messages. |
| 72 bool received_page_title_; | 72 bool received_page_title_; |
| 73 | 73 |
| 74 content::NotificationRegistrar registrar_; | 74 content::NotificationRegistrar registrar_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(HistoryTabHelper); | 76 DISALLOW_COPY_AND_ASSIGN(HistoryTabHelper); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 #endif // CHROME_BROWSER_HISTORY_HISTORY_TAB_HELPER_H_ | 79 #endif // CHROME_BROWSER_HISTORY_HISTORY_TAB_HELPER_H_ |
| OLD | NEW |