Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: chrome/browser/ui/search/instant_page.cc

Issue 19054012: Reload Local NTP on default search provider change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/instant_page.h" 5 #include "chrome/browser/ui/search/instant_page.h"
6 6
7 #include "apps/app_launcher.h" 7 #include "apps/app_launcher.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/search/search.h" 9 #include "chrome/browser/search/search.h"
10 #include "chrome/browser/ui/search/instant_ntp.h" 10 #include "chrome/browser/ui/search/instant_ntp.h"
(...skipping 21 matching lines...) Expand all
32 return contents() ? 32 return contents() ?
33 SearchTabHelper::FromWebContents(contents())->SupportsInstant() : false; 33 SearchTabHelper::FromWebContents(contents())->SupportsInstant() : false;
34 } 34 }
35 35
36 const std::string& InstantPage::instant_url() const { 36 const std::string& InstantPage::instant_url() const {
37 return instant_url_; 37 return instant_url_;
38 } 38 }
39 39
40 bool InstantPage::IsLocal() const { 40 bool InstantPage::IsLocal() const {
41 return contents() && 41 return contents() &&
42 (contents()->GetURL() == GURL(chrome::kChromeSearchLocalNtpUrl) || 42 contents()->GetURL() == GURL(chrome::kChromeSearchLocalNtpUrl);
43 contents()->GetURL() == GURL(chrome::kChromeSearchLocalGoogleNtpUrl));
44 } 43 }
45 44
46 void InstantPage::InitializeFonts() { 45 void InstantPage::InitializeFonts() {
47 #if defined(OS_MACOSX) 46 #if defined(OS_MACOSX)
48 // This value should be kept in sync with OmniboxViewMac::GetFieldFont. 47 // This value should be kept in sync with OmniboxViewMac::GetFieldFont.
49 const gfx::Font& omnibox_font = 48 const gfx::Font& omnibox_font =
50 ui::ResourceBundle::GetSharedInstance().GetFont( 49 ui::ResourceBundle::GetSharedInstance().GetFont(
51 ui::ResourceBundle::MediumFont).DeriveFont(1); 50 ui::ResourceBundle::MediumFont).DeriveFont(1);
52 #else 51 #else
53 const gfx::Font& omnibox_font = 52 const gfx::Font& omnibox_font =
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 delegate_->UndoAllMostVisitedDeletions(); 242 delegate_->UndoAllMostVisitedDeletions();
244 } 243 }
245 244
246 void InstantPage::ClearContents() { 245 void InstantPage::ClearContents() {
247 if (contents()) 246 if (contents())
248 SearchTabHelper::FromWebContents(contents())->model()->RemoveObserver(this); 247 SearchTabHelper::FromWebContents(contents())->model()->RemoveObserver(this);
249 248
250 sender()->SetContents(NULL); 249 sender()->SetContents(NULL);
251 Observe(NULL); 250 Observe(NULL);
252 } 251 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_extended_interactive_uitest.cc ('k') | chrome/browser/ui/search/instant_page_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698