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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 3922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3933 DownloadStartedAnimation::Show(shelf_tab); | 3933 DownloadStartedAnimation::Show(shelf_tab); |
3934 } | 3934 } |
3935 #endif | 3935 #endif |
3936 } | 3936 } |
3937 | 3937 |
3938 // If the download occurs in a new tab, close it. | 3938 // If the download occurs in a new tab, close it. |
3939 if (source->GetController().IsInitialNavigation() && tab_count() > 1) | 3939 if (source->GetController().IsInitialNavigation() && tab_count() > 1) |
3940 CloseContents(source); | 3940 CloseContents(source); |
3941 } | 3941 } |
3942 | 3942 |
3943 void Browser::ShowPageInfo(const GURL& url, | 3943 void Browser::ShowPageInfo(content::WebContents* web_contents, |
| 3944 const GURL& url, |
3944 const SSLStatus& ssl, | 3945 const SSLStatus& ssl, |
3945 bool show_history) { | 3946 bool show_history) { |
3946 window()->ShowPageInfo(profile_, url, ssl, show_history); | 3947 Profile* profile = Profile::FromBrowserContext( |
| 3948 web_contents->GetBrowserContext()); |
| 3949 TabContentsWrapper* wrapper = |
| 3950 TabContentsWrapper::GetCurrentWrapperForContents(web_contents); |
| 3951 |
| 3952 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 3953 switches::kEnableWebsiteSettings)) { |
| 3954 window()->ShowWebsiteSettings(profile, wrapper, url, ssl, show_history); |
| 3955 } else { |
| 3956 window()->ShowPageInfo(profile, url, ssl, show_history); |
| 3957 } |
3947 } | 3958 } |
3948 | 3959 |
3949 void Browser::ViewSourceForTab(WebContents* source, const GURL& page_url) { | 3960 void Browser::ViewSourceForTab(WebContents* source, const GURL& page_url) { |
3950 DCHECK(source); | 3961 DCHECK(source); |
3951 TabContentsWrapper* wrapper = GetTabContentsWrapperAt( | 3962 TabContentsWrapper* wrapper = GetTabContentsWrapperAt( |
3952 tab_handler_->GetTabStripModel()->GetWrapperIndex(source)); | 3963 tab_handler_->GetTabStripModel()->GetWrapperIndex(source)); |
3953 ViewSource(wrapper); | 3964 ViewSource(wrapper); |
3954 } | 3965 } |
3955 | 3966 |
3956 void Browser::ViewSourceForFrame(WebContents* source, | 3967 void Browser::ViewSourceForFrame(WebContents* source, |
(...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5555 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; | 5566 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; |
5556 ShowSingletonTabOverwritingNTP(params); | 5567 ShowSingletonTabOverwritingNTP(params); |
5557 } else { | 5568 } else { |
5558 service->ShowLoginDialog(); | 5569 service->ShowLoginDialog(); |
5559 } | 5570 } |
5560 } | 5571 } |
5561 | 5572 |
5562 void Browser::ToggleSpeechInput() { | 5573 void Browser::ToggleSpeechInput() { |
5563 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5574 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
5564 } | 5575 } |
OLD | NEW |