Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Side by Side Diff: chrome/browser/ui/browser_commands.cc

Issue 1314953009: Refactor WebsiteSettings to operate on a SecurityInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 namespace { 110 namespace {
111 const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3"; 111 const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3";
112 } 112 }
113 113
114 using base::UserMetricsAction; 114 using base::UserMetricsAction;
115 using bookmarks::BookmarkModel; 115 using bookmarks::BookmarkModel;
116 using content::NavigationController; 116 using content::NavigationController;
117 using content::NavigationEntry; 117 using content::NavigationEntry;
118 using content::OpenURLParams; 118 using content::OpenURLParams;
119 using content::Referrer; 119 using content::Referrer;
120 using content::SSLStatus;
121 using content::WebContents; 120 using content::WebContents;
122 121
123 namespace chrome { 122 namespace chrome {
124 namespace { 123 namespace {
125 124
126 bool CanBookmarkCurrentPageInternal(const Browser* browser, 125 bool CanBookmarkCurrentPageInternal(const Browser* browser,
127 bool check_remove_bookmark_ui) { 126 bool check_remove_bookmark_ui) {
128 BookmarkModel* model = 127 BookmarkModel* model =
129 BookmarkModelFactory::GetForProfile(browser->profile()); 128 BookmarkModelFactory::GetForProfile(browser->profile());
130 return browser_defaults::bookmarks_enabled && 129 return browser_defaults::bookmarks_enabled &&
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 return false; 852 return false;
854 } 853 }
855 return !browser->is_devtools() && 854 return !browser->is_devtools() &&
856 !(GetContentRestrictions(browser) & CONTENT_RESTRICTION_SAVE); 855 !(GetContentRestrictions(browser) & CONTENT_RESTRICTION_SAVE);
857 } 856 }
858 857
859 void ShowFindBar(Browser* browser) { 858 void ShowFindBar(Browser* browser) {
860 browser->GetFindBarController()->Show(); 859 browser->GetFindBarController()->Show();
861 } 860 }
862 861
863 void ShowWebsiteSettings(Browser* browser, 862 void ShowWebsiteSettings(
864 content::WebContents* web_contents, 863 Browser* browser,
865 const GURL& url, 864 content::WebContents* web_contents,
866 const SSLStatus& ssl) { 865 const GURL& url,
866 const SecurityStateModel::SecurityInfo& security_info) {
867 browser->window()->ShowWebsiteSettings( 867 browser->window()->ShowWebsiteSettings(
868 Profile::FromBrowserContext(web_contents->GetBrowserContext()), 868 Profile::FromBrowserContext(web_contents->GetBrowserContext()),
869 web_contents, url, ssl); 869 web_contents, url, security_info);
870 } 870 }
871 871
872 void Print(Browser* browser) { 872 void Print(Browser* browser) {
873 #if defined(ENABLE_PRINTING) 873 #if defined(ENABLE_PRINTING)
874 printing::StartPrint( 874 printing::StartPrint(
875 browser->tab_strip_model()->GetActiveWebContents(), 875 browser->tab_strip_model()->GetActiveWebContents(),
876 browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled), 876 browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled),
877 false); 877 false);
878 #endif // defined(ENABLE_PRINTING) 878 #endif // defined(ENABLE_PRINTING)
879 } 879 }
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 browser->host_desktop_type())); 1284 browser->host_desktop_type()));
1285 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1285 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1286 1286
1287 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1287 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1288 contents->GetRenderViewHost()->SyncRendererPrefs(); 1288 contents->GetRenderViewHost()->SyncRendererPrefs();
1289 app_browser->window()->Show(); 1289 app_browser->window()->Show();
1290 } 1290 }
1291 #endif // defined(ENABLE_EXTENSIONS) 1291 #endif // defined(ENABLE_EXTENSIONS)
1292 1292
1293 } // namespace chrome 1293 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698