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/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 DCHECK(theme_provider); | 860 DCHECK(theme_provider); |
861 | 861 |
862 if (!chrome::search::IsInstantExtendedAPIEnabled(browser()->profile())) | 862 if (!chrome::search::IsInstantExtendedAPIEnabled(browser()->profile())) |
863 return theme_provider->GetColor(ThemeService::COLOR_TOOLBAR); | 863 return theme_provider->GetColor(ThemeService::COLOR_TOOLBAR); |
864 | 864 |
865 switch (mode) { | 865 switch (mode) { |
866 case chrome::search::Mode::MODE_NTP: | 866 case chrome::search::Mode::MODE_NTP: |
867 return theme_provider->GetColor( | 867 return theme_provider->GetColor( |
868 ThemeService::COLOR_SEARCH_NTP_BACKGROUND); | 868 ThemeService::COLOR_SEARCH_NTP_BACKGROUND); |
869 | 869 |
870 case chrome::search::Mode::MODE_SEARCH: | 870 case chrome::search::Mode::MODE_SEARCH_SUGGESTIONS: |
| 871 case chrome::search::Mode::MODE_SEARCH_RESULTS: |
871 return theme_provider->GetColor( | 872 return theme_provider->GetColor( |
872 ThemeService::COLOR_SEARCH_SEARCH_BACKGROUND); | 873 ThemeService::COLOR_SEARCH_SEARCH_BACKGROUND); |
873 | 874 |
874 case chrome::search::Mode::MODE_DEFAULT: | 875 case chrome::search::Mode::MODE_DEFAULT: |
875 default: | 876 default: |
876 return theme_provider->GetColor( | 877 return theme_provider->GetColor( |
877 ThemeService::COLOR_SEARCH_DEFAULT_BACKGROUND); | 878 ThemeService::COLOR_SEARCH_DEFAULT_BACKGROUND); |
878 } | 879 } |
879 } | 880 } |
880 | 881 |
881 gfx::ImageSkia* BrowserView::GetToolbarBackgroundImage( | 882 gfx::ImageSkia* BrowserView::GetToolbarBackgroundImage( |
882 chrome::search::Mode::Type mode) { | 883 chrome::search::Mode::Type mode) { |
883 ui::ThemeProvider* theme_provider = GetThemeProvider(); | 884 ui::ThemeProvider* theme_provider = GetThemeProvider(); |
884 DCHECK(theme_provider); | 885 DCHECK(theme_provider); |
885 if (!chrome::search::IsInstantExtendedAPIEnabled(browser()->profile())) | 886 if (!chrome::search::IsInstantExtendedAPIEnabled(browser()->profile())) |
886 return theme_provider->GetImageSkiaNamed(IDR_THEME_TOOLBAR); | 887 return theme_provider->GetImageSkiaNamed(IDR_THEME_TOOLBAR); |
887 | 888 |
888 switch (mode) { | 889 switch (mode) { |
889 case chrome::search::Mode::MODE_NTP: | 890 case chrome::search::Mode::MODE_NTP: |
890 return theme_provider->GetImageSkiaNamed(IDR_THEME_NTP_BACKGROUND); | 891 return theme_provider->GetImageSkiaNamed(IDR_THEME_NTP_BACKGROUND); |
891 | 892 |
892 case chrome::search::Mode::MODE_SEARCH: | 893 case chrome::search::Mode::MODE_SEARCH_SUGGESTIONS: |
| 894 case chrome::search::Mode::MODE_SEARCH_RESULTS: |
893 case chrome::search::Mode::MODE_DEFAULT: | 895 case chrome::search::Mode::MODE_DEFAULT: |
894 default: | 896 default: |
895 return theme_provider->GetImageSkiaNamed(IDR_THEME_TOOLBAR_SEARCH); | 897 return theme_provider->GetImageSkiaNamed(IDR_THEME_TOOLBAR_SEARCH); |
896 } | 898 } |
897 } | 899 } |
898 | 900 |
899 LocationBar* BrowserView::GetLocationBar() const { | 901 LocationBar* BrowserView::GetLocationBar() const { |
900 return GetLocationBarView(); | 902 return GetLocationBarView(); |
901 } | 903 } |
902 | 904 |
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2604 | 2606 |
2605 Browser* modal_browser = | 2607 Browser* modal_browser = |
2606 browser::FindBrowserWithWebContents(active_dialog->web_contents()); | 2608 browser::FindBrowserWithWebContents(active_dialog->web_contents()); |
2607 if (modal_browser && (browser_ != modal_browser)) { | 2609 if (modal_browser && (browser_ != modal_browser)) { |
2608 modal_browser->window()->FlashFrame(true); | 2610 modal_browser->window()->FlashFrame(true); |
2609 modal_browser->window()->Activate(); | 2611 modal_browser->window()->Activate(); |
2610 } | 2612 } |
2611 | 2613 |
2612 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); | 2614 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
2613 } | 2615 } |
OLD | NEW |