| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2005 // Browser, SearchEngineTabHelperDelegate implementation: | 2005 // Browser, SearchEngineTabHelperDelegate implementation: |
| 2006 | 2006 |
| 2007 void Browser::ConfirmAddSearchProvider(TemplateURL* template_url, | 2007 void Browser::ConfirmAddSearchProvider(TemplateURL* template_url, |
| 2008 Profile* profile) { | 2008 Profile* profile) { |
| 2009 window()->ConfirmAddSearchProvider(template_url, profile); | 2009 window()->ConfirmAddSearchProvider(template_url, profile); |
| 2010 } | 2010 } |
| 2011 | 2011 |
| 2012 /////////////////////////////////////////////////////////////////////////////// | 2012 /////////////////////////////////////////////////////////////////////////////// |
| 2013 // Browser, SearchTabHelperDelegate implementation: | 2013 // Browser, SearchTabHelperDelegate implementation: |
| 2014 | 2014 |
| 2015 void Browser::NavigateOnThumbnailClick(const GURL& url, | |
| 2016 WindowOpenDisposition disposition, | |
| 2017 content::WebContents* source_contents) { | |
| 2018 DCHECK(source_contents); | |
| 2019 // We're guaranteed that AUTO_BOOKMARK is the right transition since this only | |
| 2020 // gets called to handle clicks in the new tab page (to navigate to most | |
| 2021 // visited item URLs) and in the search results page (to navigate to | |
| 2022 // privileged destinations (e.g. chrome://URLs)). | |
| 2023 // | |
| 2024 // TODO(kmadhusu): Page transitions to privileged destinations should be | |
| 2025 // marked as "LINK" instead of "AUTO_BOOKMARK"? | |
| 2026 chrome::NavigateParams params(this, url, | |
| 2027 ui::PAGE_TRANSITION_AUTO_BOOKMARK); | |
| 2028 params.referrer = content::Referrer(); | |
| 2029 params.source_contents = source_contents; | |
| 2030 params.disposition = disposition; | |
| 2031 params.is_renderer_initiated = false; | |
| 2032 params.initiating_profile = profile_; | |
| 2033 chrome::Navigate(¶ms); | |
| 2034 } | |
| 2035 | |
| 2036 void Browser::OnWebContentsInstantSupportDisabled( | 2015 void Browser::OnWebContentsInstantSupportDisabled( |
| 2037 const content::WebContents* web_contents) { | 2016 const content::WebContents* web_contents) { |
| 2038 DCHECK(web_contents); | 2017 DCHECK(web_contents); |
| 2039 if (tab_strip_model_->GetActiveWebContents() == web_contents) | 2018 if (tab_strip_model_->GetActiveWebContents() == web_contents) |
| 2040 UpdateToolbar(false); | 2019 UpdateToolbar(false); |
| 2041 } | 2020 } |
| 2042 | 2021 |
| 2043 OmniboxView* Browser::GetOmniboxView() { | 2022 OmniboxView* Browser::GetOmniboxView() { |
| 2044 return window_->GetLocationBar()->GetOmniboxView(); | 2023 return window_->GetLocationBar()->GetOmniboxView(); |
| 2045 } | 2024 } |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2745 if (contents && !allow_js_access) { | 2724 if (contents && !allow_js_access) { |
| 2746 contents->web_contents()->GetController().LoadURL( | 2725 contents->web_contents()->GetController().LoadURL( |
| 2747 target_url, | 2726 target_url, |
| 2748 content::Referrer(), | 2727 content::Referrer(), |
| 2749 ui::PAGE_TRANSITION_LINK, | 2728 ui::PAGE_TRANSITION_LINK, |
| 2750 std::string()); // No extra headers. | 2729 std::string()); // No extra headers. |
| 2751 } | 2730 } |
| 2752 | 2731 |
| 2753 return contents != NULL; | 2732 return contents != NULL; |
| 2754 } | 2733 } |
| OLD | NEW |