| 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/views/search_view_controller.h" | 5 #include "chrome/browser/ui/views/search_view_controller.h" |
| 6 | 6 |
| 7 #include "chrome/browser/instant/instant_controller.h" | 7 #include "chrome/browser/instant/instant_controller.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/search_engines/search_engine_type.h" | 9 #include "chrome/browser/search_engines/search_engine_type.h" |
| 10 #include "chrome/browser/search_engines/template_url.h" | 10 #include "chrome/browser/search_engines/template_url.h" |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 ntp_container_ = new views::View; | 468 ntp_container_ = new views::View; |
| 469 ntp_container_->set_background(new NTPViewBackground); | 469 ntp_container_->set_background(new NTPViewBackground); |
| 470 ntp_container_->SetPaintToLayer(true); | 470 ntp_container_->SetPaintToLayer(true); |
| 471 ntp_container_->layer()->SetMasksToBounds(true); | 471 ntp_container_->layer()->SetMasksToBounds(true); |
| 472 | 472 |
| 473 const TemplateURL* default_provider = | 473 const TemplateURL* default_provider = |
| 474 TemplateURLServiceFactory::GetForProfile( | 474 TemplateURLServiceFactory::GetForProfile( |
| 475 Profile::FromBrowserContext(browser_context_))-> | 475 Profile::FromBrowserContext(browser_context_))-> |
| 476 GetDefaultSearchProvider(); | 476 GetDefaultSearchProvider(); |
| 477 | 477 |
| 478 if (default_provider && InstantUI::ShouldShowSearchProviderLogo() && | 478 if (default_provider && |
| 479 InstantUI::ShouldShowSearchProviderLogo(browser_context_) && |
| 479 (TemplateURLPrepopulateData::GetEngineType(default_provider->url()) == | 480 (TemplateURLPrepopulateData::GetEngineType(default_provider->url()) == |
| 480 SEARCH_ENGINE_GOOGLE)) { | 481 SEARCH_ENGINE_GOOGLE)) { |
| 481 default_provider_logo_.reset(new views::ImageView()); | 482 default_provider_logo_.reset(new views::ImageView()); |
| 482 default_provider_logo_->set_owned_by_client(); | 483 default_provider_logo_->set_owned_by_client(); |
| 483 default_provider_logo_->SetImage(ui::ResourceBundle::GetSharedInstance(). | 484 default_provider_logo_->SetImage(ui::ResourceBundle::GetSharedInstance(). |
| 484 GetImageSkiaNamed(IDR_GOOGLE_LOGO_LG)); | 485 GetImageSkiaNamed(IDR_GOOGLE_LOGO_LG)); |
| 485 default_provider_logo_->SetPaintToLayer(true); | 486 default_provider_logo_->SetPaintToLayer(true); |
| 486 default_provider_logo_->SetFillsBoundsOpaquely(false); | 487 default_provider_logo_->SetFillsBoundsOpaquely(false); |
| 487 } | 488 } |
| 488 | 489 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 | 603 |
| 603 chrome::search::SearchModel* SearchViewController::search_model() { | 604 chrome::search::SearchModel* SearchViewController::search_model() { |
| 604 return tab_contents_ ? chrome::search::SearchTabHelper::FromWebContents( | 605 return tab_contents_ ? chrome::search::SearchTabHelper::FromWebContents( |
| 605 tab_contents_->web_contents())->model() | 606 tab_contents_->web_contents())->model() |
| 606 : NULL; | 607 : NULL; |
| 607 } | 608 } |
| 608 | 609 |
| 609 content::WebContents* SearchViewController::web_contents() { | 610 content::WebContents* SearchViewController::web_contents() { |
| 610 return tab_contents_ ? tab_contents_->web_contents() : NULL; | 611 return tab_contents_ ? tab_contents_->web_contents() : NULL; |
| 611 } | 612 } |
| OLD | NEW |