| OLD | NEW |
| 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/search/instant_service.h" | 5 #include "chrome/browser/search/instant_service.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/favicon/fallback_icon_service_factory.h" | 8 #include "chrome/browser/favicon/fallback_icon_service_factory.h" |
| 9 #include "chrome/browser/favicon/large_icon_service_factory.h" | 9 #include "chrome/browser/favicon/large_icon_service_factory.h" |
| 10 #include "chrome/browser/history/top_sites_factory.h" | 10 #include "chrome/browser/history/top_sites_factory.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "components/search_engines/template_url_service.h" | 31 #include "components/search_engines/template_url_service.h" |
| 32 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
| 33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
| 34 #include "content/public/browser/notification_types.h" | 34 #include "content/public/browser/notification_types.h" |
| 35 #include "content/public/browser/render_process_host.h" | 35 #include "content/public/browser/render_process_host.h" |
| 36 #include "content/public/browser/url_data_source.h" | 36 #include "content/public/browser/url_data_source.h" |
| 37 #include "grit/theme_resources.h" | 37 #include "grit/theme_resources.h" |
| 38 #include "third_party/skia/include/core/SkColor.h" | 38 #include "third_party/skia/include/core/SkColor.h" |
| 39 #include "ui/gfx/color_utils.h" | 39 #include "ui/gfx/color_utils.h" |
| 40 #include "ui/gfx/image/image_skia.h" | 40 #include "ui/gfx/image/image_skia.h" |
| 41 #include "ui/gfx/sys_color_change_listener.h" | |
| 42 | 41 |
| 43 #if !defined(OS_ANDROID) | 42 #if !defined(OS_ANDROID) |
| 44 #include "chrome/browser/search/local_ntp_source.h" | 43 #include "chrome/browser/search/local_ntp_source.h" |
| 45 #endif | 44 #endif |
| 46 | 45 |
| 47 #if defined(ENABLE_THEMES) | 46 #if defined(ENABLE_THEMES) |
| 48 #include "chrome/browser/themes/theme_properties.h" | 47 #include "chrome/browser/themes/theme_properties.h" |
| 49 #include "chrome/browser/themes/theme_service.h" | 48 #include "chrome/browser/themes/theme_service.h" |
| 50 #include "chrome/browser/themes/theme_service_factory.h" | 49 #include "chrome/browser/themes/theme_service_factory.h" |
| 51 #endif // defined(ENABLE_THEMES) | 50 #endif // defined(ENABLE_THEMES) |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 SkColor header_color = | 330 SkColor header_color = |
| 332 theme_service->GetColor(ThemeProperties::COLOR_NTP_HEADER); | 331 theme_service->GetColor(ThemeProperties::COLOR_NTP_HEADER); |
| 333 // Generate section border color from the header color. | 332 // Generate section border color from the header color. |
| 334 SkColor section_border_color = | 333 SkColor section_border_color = |
| 335 SkColorSetARGB(kSectionBorderAlphaTransparency, | 334 SkColorSetARGB(kSectionBorderAlphaTransparency, |
| 336 SkColorGetR(header_color), | 335 SkColorGetR(header_color), |
| 337 SkColorGetG(header_color), | 336 SkColorGetG(header_color), |
| 338 SkColorGetB(header_color)); | 337 SkColorGetB(header_color)); |
| 339 | 338 |
| 340 // Invert colors if needed. | 339 // Invert colors if needed. |
| 341 if (gfx::IsInvertedColorScheme()) { | 340 if (color_utils::IsInvertedColorScheme()) { |
| 342 background_color = color_utils::InvertColor(background_color); | 341 background_color = color_utils::InvertColor(background_color); |
| 343 text_color = color_utils::InvertColor(text_color); | 342 text_color = color_utils::InvertColor(text_color); |
| 344 link_color = color_utils::InvertColor(link_color); | 343 link_color = color_utils::InvertColor(link_color); |
| 345 text_color_light = color_utils::InvertColor(text_color_light); | 344 text_color_light = color_utils::InvertColor(text_color_light); |
| 346 header_color = color_utils::InvertColor(header_color); | 345 header_color = color_utils::InvertColor(header_color); |
| 347 section_border_color = color_utils::InvertColor(section_border_color); | 346 section_border_color = color_utils::InvertColor(section_border_color); |
| 348 } | 347 } |
| 349 | 348 |
| 350 // Set colors. | 349 // Set colors. |
| 351 theme_info_->background_color = SkColorToRGBAColor(background_color); | 350 theme_info_->background_color = SkColorToRGBAColor(background_color); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 } | 461 } |
| 463 | 462 |
| 464 void InstantService::ResetInstantSearchPrerenderer() { | 463 void InstantService::ResetInstantSearchPrerenderer() { |
| 465 if (!chrome::ShouldPrefetchSearchResults()) | 464 if (!chrome::ShouldPrefetchSearchResults()) |
| 466 return; | 465 return; |
| 467 | 466 |
| 468 GURL url(chrome::GetSearchResultPrefetchBaseURL(profile_)); | 467 GURL url(chrome::GetSearchResultPrefetchBaseURL(profile_)); |
| 469 instant_prerenderer_.reset( | 468 instant_prerenderer_.reset( |
| 470 url.is_valid() ? new InstantSearchPrerenderer(profile_, url) : NULL); | 469 url.is_valid() ? new InstantSearchPrerenderer(profile_, url) : NULL); |
| 471 } | 470 } |
| OLD | NEW |