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 #include "chrome/browser/ui/search/search_tab_helper.h" | 5 #include "chrome/browser/ui/search/search_tab_helper.h" |
6 | 6 |
7 #include "chrome/browser/google/google_util.h" | 7 #include "chrome/browser/google/google_util.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/search/search.h" | 9 #include "chrome/browser/ui/search/search.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // when "committed". This is because NTP is rendered natively so is faster | 81 // when "committed". This is because NTP is rendered natively so is faster |
82 // to render than the web contents and we need to coordinate the animations. | 82 // to render than the web contents and we need to coordinate the animations. |
83 if (IsNTP(url)) { | 83 if (IsNTP(url)) { |
84 ntp_load_state_ = WAITING_FOR_FRAME_ID; | 84 ntp_load_state_ = WAITING_FOR_FRAME_ID; |
85 UpdateModelBasedOnURL(url, ntp_load_state_, !is_initial_navigation_commit_); | 85 UpdateModelBasedOnURL(url, ntp_load_state_, !is_initial_navigation_commit_); |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 void SearchTabHelper::DidStartProvisionalLoadForFrame( | 89 void SearchTabHelper::DidStartProvisionalLoadForFrame( |
90 int64 frame_id, | 90 int64 frame_id, |
| 91 int64 parent_frame_id, |
91 bool is_main_frame, | 92 bool is_main_frame, |
92 const GURL& validated_url, | 93 const GURL& validated_url, |
93 bool is_error_page, | 94 bool is_error_page, |
94 content::RenderViewHost* render_view_host) { | 95 content::RenderViewHost* render_view_host) { |
95 if (ntp_load_state_ == WAITING_FOR_FRAME_ID && | 96 if (ntp_load_state_ == WAITING_FOR_FRAME_ID && |
96 is_main_frame && IsNTP(validated_url)) { | 97 is_main_frame && IsNTP(validated_url)) { |
97 content::NavigationEntry* pending_entry = | 98 content::NavigationEntry* pending_entry = |
98 web_contents()->GetController().GetPendingEntry(); | 99 web_contents()->GetController().GetPendingEntry(); |
99 if (pending_entry && IsNTP(pending_entry->GetURL())) { | 100 if (pending_entry && IsNTP(pending_entry->GetURL())) { |
100 ntp_load_state_ = WAITING_FOR_FRAME_LOAD; | 101 ntp_load_state_ = WAITING_FOR_FRAME_LOAD; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 174 } |
174 | 175 |
175 content::RenderWidgetHost* SearchTabHelper::GetRenderWidgetHost() { | 176 content::RenderWidgetHost* SearchTabHelper::GetRenderWidgetHost() { |
176 content::RenderWidgetHostView* rwhv = | 177 content::RenderWidgetHostView* rwhv = |
177 web_contents()->GetRenderWidgetHostView(); | 178 web_contents()->GetRenderWidgetHostView(); |
178 return rwhv ? rwhv->GetRenderWidgetHost() : NULL; | 179 return rwhv ? rwhv->GetRenderWidgetHost() : NULL; |
179 } | 180 } |
180 | 181 |
181 } // namespace search | 182 } // namespace search |
182 } // namespace chrome | 183 } // namespace chrome |
OLD | NEW |