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_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 return false; | 855 return false; |
856 } | 856 } |
857 return !browser->is_devtools() && | 857 return !browser->is_devtools() && |
858 !(GetContentRestrictions(browser) & CONTENT_RESTRICTION_SAVE); | 858 !(GetContentRestrictions(browser) & CONTENT_RESTRICTION_SAVE); |
859 } | 859 } |
860 | 860 |
861 void ShowFindBar(Browser* browser) { | 861 void ShowFindBar(Browser* browser) { |
862 browser->GetFindBarController()->Show(); | 862 browser->GetFindBarController()->Show(); |
863 } | 863 } |
864 | 864 |
865 void ShowWebsiteSettings( | 865 void ShowWebsiteSettings(Browser* browser, |
866 Browser* browser, | 866 content::WebContents* web_contents, |
867 content::WebContents* web_contents, | 867 const GURL& url, |
868 const GURL& url, | 868 const security_state::SecurityInfo& security_info) { |
869 const security_state::SecurityStateModel::SecurityInfo& security_info) { | |
870 browser->window()->ShowWebsiteSettings( | 869 browser->window()->ShowWebsiteSettings( |
871 Profile::FromBrowserContext(web_contents->GetBrowserContext()), | 870 Profile::FromBrowserContext(web_contents->GetBrowserContext()), |
872 web_contents, url, security_info); | 871 web_contents, url, security_info); |
873 } | 872 } |
874 | 873 |
875 void Print(Browser* browser) { | 874 void Print(Browser* browser) { |
876 #if defined(ENABLE_PRINTING) | 875 #if defined(ENABLE_PRINTING) |
877 printing::StartPrint( | 876 printing::StartPrint( |
878 browser->tab_strip_model()->GetActiveWebContents(), | 877 browser->tab_strip_model()->GetActiveWebContents(), |
879 browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled), | 878 browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled), |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); | 1296 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); |
1298 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1297 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1299 | 1298 |
1300 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1299 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1301 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1300 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1302 app_browser->window()->Show(); | 1301 app_browser->window()->Show(); |
1303 } | 1302 } |
1304 #endif // defined(ENABLE_EXTENSIONS) | 1303 #endif // defined(ENABLE_EXTENSIONS) |
1305 | 1304 |
1306 } // namespace chrome | 1305 } // namespace chrome |
OLD | NEW |