| 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/omnibox/omnibox_edit_model.h" | 9 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
| 10 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 SearchTabHelper::~SearchTabHelper() { | 48 SearchTabHelper::~SearchTabHelper() { |
| 49 } | 49 } |
| 50 | 50 |
| 51 content::WebContents* SearchTabHelper::GetNTPWebContents() { | 51 content::WebContents* SearchTabHelper::GetNTPWebContents() { |
| 52 if (!ntp_web_contents_.get()) { | 52 if (!ntp_web_contents_.get()) { |
| 53 ntp_web_contents_.reset(content::WebContents::Create( | 53 ntp_web_contents_.reset(content::WebContents::Create( |
| 54 model_.tab_contents()->profile(), | 54 model_.tab_contents()->profile(), |
| 55 model_.tab_contents()->web_contents()->GetSiteInstance(), | 55 model_.tab_contents()->web_contents()->GetSiteInstance(), |
| 56 MSG_ROUTING_NONE, | 56 MSG_ROUTING_NONE, |
| 57 NULL, | |
| 58 NULL)); | 57 NULL)); |
| 59 ntp_web_contents_->GetController().LoadURL( | 58 ntp_web_contents_->GetController().LoadURL( |
| 60 GURL(chrome::kChromeUINewTabURL), | 59 GURL(chrome::kChromeUINewTabURL), |
| 61 content::Referrer(), | 60 content::Referrer(), |
| 62 content::PAGE_TRANSITION_START_PAGE, | 61 content::PAGE_TRANSITION_START_PAGE, |
| 63 std::string()); | 62 std::string()); |
| 64 } | 63 } |
| 65 return ntp_web_contents_.get(); | 64 return ntp_web_contents_.get(); |
| 66 } | 65 } |
| 67 | 66 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 116 |
| 118 void SearchTabHelper::FlushNTP(const GURL& url) { | 117 void SearchTabHelper::FlushNTP(const GURL& url) { |
| 119 if (!IsNTP(url) && | 118 if (!IsNTP(url) && |
| 120 !google_util::IsInstantExtendedAPIGoogleSearchUrl(url.spec())) { | 119 !google_util::IsInstantExtendedAPIGoogleSearchUrl(url.spec())) { |
| 121 ntp_web_contents_.reset(); | 120 ntp_web_contents_.reset(); |
| 122 } | 121 } |
| 123 } | 122 } |
| 124 | 123 |
| 125 } // namespace search | 124 } // namespace search |
| 126 } // namespace chrome | 125 } // namespace chrome |
| OLD | NEW |