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 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1884 return chrome::CanReload(this); | 1884 return chrome::CanReload(this); |
1885 } | 1885 } |
1886 | 1886 |
1887 bool Browser::CanSaveContents(content::WebContents* web_contents) const { | 1887 bool Browser::CanSaveContents(content::WebContents* web_contents) const { |
1888 return chrome::CanSavePage(this); | 1888 return chrome::CanSavePage(this); |
1889 } | 1889 } |
1890 | 1890 |
1891 /////////////////////////////////////////////////////////////////////////////// | 1891 /////////////////////////////////////////////////////////////////////////////// |
1892 // Browser, SearchTabHelperDelegate implementation: | 1892 // Browser, SearchTabHelperDelegate implementation: |
1893 | 1893 |
1894 void Browser::NavigateOnThumbnailClick(const GURL& url, | |
1895 WindowOpenDisposition disposition, | |
1896 content::WebContents* source_contents) { | |
1897 DCHECK(source_contents); | |
1898 // We're guaranteed that AUTO_BOOKMARK is the right transition since this only | |
1899 // gets called to handle clicks in the new tab page (to navigate to most | |
1900 // visited item URLs) and in the search results page (to navigate to | |
1901 // privileged destinations (e.g. chrome://URLs)). | |
1902 // | |
1903 // TODO(kmadhusu): Page transitions to privileged destinations should be | |
1904 // marked as "LINK" instead of "AUTO_BOOKMARK"? | |
1905 chrome::NavigateParams params(this, url, | |
1906 ui::PAGE_TRANSITION_AUTO_BOOKMARK); | |
1907 params.referrer = content::Referrer(); | |
1908 params.source_contents = source_contents; | |
1909 params.disposition = disposition; | |
1910 params.is_renderer_initiated = false; | |
1911 params.initiating_profile = profile_; | |
1912 chrome::Navigate(¶ms); | |
1913 } | |
1914 | |
1915 void Browser::OnWebContentsInstantSupportDisabled( | 1894 void Browser::OnWebContentsInstantSupportDisabled( |
1916 const content::WebContents* web_contents) { | 1895 const content::WebContents* web_contents) { |
1917 DCHECK(web_contents); | 1896 DCHECK(web_contents); |
1918 if (tab_strip_model_->GetActiveWebContents() == web_contents) | 1897 if (tab_strip_model_->GetActiveWebContents() == web_contents) |
1919 UpdateToolbar(false); | 1898 UpdateToolbar(false); |
1920 } | 1899 } |
1921 | 1900 |
1922 OmniboxView* Browser::GetOmniboxView() { | 1901 OmniboxView* Browser::GetOmniboxView() { |
1923 return window_->GetLocationBar()->GetOmniboxView(); | 1902 return window_->GetLocationBar()->GetOmniboxView(); |
1924 } | 1903 } |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2623 if (contents && !allow_js_access) { | 2602 if (contents && !allow_js_access) { |
2624 contents->web_contents()->GetController().LoadURL( | 2603 contents->web_contents()->GetController().LoadURL( |
2625 target_url, | 2604 target_url, |
2626 content::Referrer(), | 2605 content::Referrer(), |
2627 ui::PAGE_TRANSITION_LINK, | 2606 ui::PAGE_TRANSITION_LINK, |
2628 std::string()); // No extra headers. | 2607 std::string()); // No extra headers. |
2629 } | 2608 } |
2630 | 2609 |
2631 return contents != NULL; | 2610 return contents != NULL; |
2632 } | 2611 } |
OLD | NEW |