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_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/common/web_contents_user_data.h" | 9 #include "chrome/browser/common/web_contents_user_data.h" |
10 #include "chrome/browser/ui/search/search_model.h" | 10 #include "chrome/browser/ui/search/search_model.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 int64 frame_id, | 53 int64 frame_id, |
54 content::RenderViewHost* render_view_host) OVERRIDE; | 54 content::RenderViewHost* render_view_host) OVERRIDE; |
55 | 55 |
56 // Overridden from content::NotificationObserver: | 56 // Overridden from content::NotificationObserver: |
57 virtual void Observe(int type, | 57 virtual void Observe(int type, |
58 const content::NotificationSource& source, | 58 const content::NotificationSource& source, |
59 const content::NotificationDetails& details) OVERRIDE; | 59 const content::NotificationDetails& details) OVERRIDE; |
60 | 60 |
61 private: | 61 private: |
62 explicit SearchTabHelper(content::WebContents* web_contents); | 62 explicit SearchTabHelper(content::WebContents* web_contents); |
63 static int kUserDataKey; | |
64 friend class WebContentsUserData<SearchTabHelper>; | 63 friend class WebContentsUserData<SearchTabHelper>; |
65 | 64 |
66 // Enum of the load states for the NTP. | 65 // Enum of the load states for the NTP. |
67 // | 66 // |
68 // Once the user loads the NTP the |ntp_load_state_| changes to | 67 // Once the user loads the NTP the |ntp_load_state_| changes to |
69 // WAITING_FOR_FRAME_ID and the search::mode::Type changes to | 68 // WAITING_FOR_FRAME_ID and the search::mode::Type changes to |
70 // MODE_NTP_LOADING. The |ntp_load_state_| progresses through the remaining | 69 // MODE_NTP_LOADING. The |ntp_load_state_| progresses through the remaining |
71 // states and when done search::mode::Type is changed to MODE_NTP. | 70 // states and when done search::mode::Type is changed to MODE_NTP. |
72 // | 71 // |
73 // This code is intended to avoid a flash between white (default background | 72 // This code is intended to avoid a flash between white (default background |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // See description above NTPLoadState. | 117 // See description above NTPLoadState. |
119 int64 main_frame_id_; | 118 int64 main_frame_id_; |
120 | 119 |
121 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); | 120 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); |
122 }; | 121 }; |
123 | 122 |
124 } // namespace search | 123 } // namespace search |
125 } // namespace chrome | 124 } // namespace chrome |
126 | 125 |
127 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 126 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
OLD | NEW |