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

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

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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 (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/website_settings/website_settings.h" 5 #include "chrome/browser/ui/website_settings/website_settings.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 std::string group_name = base::FieldTrialList::FindFullName( 150 std::string group_name = base::FieldTrialList::FindFullName(
151 kRememberCertificateErrorDecisionsFieldTrialName); 151 kRememberCertificateErrorDecisionsFieldTrialName);
152 152
153 // The Default and Disable groups are the "old-style" forget-at-session 153 // The Default and Disable groups are the "old-style" forget-at-session
154 // restart groups, so they do not get the button. 154 // restart groups, so they do not get the button.
155 bool in_experimental_group = !group_name.empty() && 155 bool in_experimental_group = !group_name.empty() &&
156 group_name.compare( 156 group_name.compare(
157 kRememberCertificateErrorDecisionsFieldTrialDefaultGroup) != 0 && 157 kRememberCertificateErrorDecisionsFieldTrialDefaultGroup) != 0 &&
158 group_name.compare( 158 group_name.compare(
159 kRememberCertificateErrorDecisionsFieldTrialDisableGroup) != 0; 159 kRememberCertificateErrorDecisionsFieldTrialDisableGroup) != 0;
160 bool has_command_line_switch = CommandLine::ForCurrentProcess()->HasSwitch( 160 bool has_command_line_switch =
161 switches::kRememberCertErrorDecisions); 161 base::CommandLine::ForCurrentProcess()->HasSwitch(
162 switches::kRememberCertErrorDecisions);
162 return in_experimental_group || has_command_line_switch; 163 return in_experimental_group || has_command_line_switch;
163 } 164 }
164 165
165 } // namespace 166 } // namespace
166 167
167 WebsiteSettings::WebsiteSettings( 168 WebsiteSettings::WebsiteSettings(
168 WebsiteSettingsUI* ui, 169 WebsiteSettingsUI* ui,
169 Profile* profile, 170 Profile* profile,
170 TabSpecificContentSettings* tab_specific_content_settings, 171 TabSpecificContentSettings* tab_specific_content_settings,
171 InfoBarService* infobar_service, 172 InfoBarService* infobar_service,
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 ui_->SetSelectedTab(tab_id); 682 ui_->SetSelectedTab(tab_id);
682 } 683 }
683 684
684 void WebsiteSettings::PresentSitePermissions() { 685 void WebsiteSettings::PresentSitePermissions() {
685 PermissionInfoList permission_info_list; 686 PermissionInfoList permission_info_list;
686 687
687 WebsiteSettingsUI::PermissionInfo permission_info; 688 WebsiteSettingsUI::PermissionInfo permission_info;
688 for (size_t i = 0; i < arraysize(kPermissionType); ++i) { 689 for (size_t i = 0; i < arraysize(kPermissionType); ++i) {
689 permission_info.type = kPermissionType[i]; 690 permission_info.type = kPermissionType[i];
690 if (permission_info.type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) { 691 if (permission_info.type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) {
691 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 692 const base::CommandLine* command_line =
693 base::CommandLine::ForCurrentProcess();
692 if (!command_line->HasSwitch(switches::kEnableWebMIDI)) 694 if (!command_line->HasSwitch(switches::kEnableWebMIDI))
693 continue; 695 continue;
694 } 696 }
695 697
696 content_settings::SettingInfo info; 698 content_settings::SettingInfo info;
697 if (permission_info.type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) { 699 if (permission_info.type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) {
698 scoped_ptr<base::Value> mic_value = 700 scoped_ptr<base::Value> mic_value =
699 content_settings_->GetWebsiteSettingWithoutOverride( 701 content_settings_->GetWebsiteSettingWithoutOverride(
700 site_url_, 702 site_url_,
701 site_url_, 703 site_url_,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 if (visited_before_today) { 822 if (visited_before_today) {
821 first_visit_text = l10n_util::GetStringFUTF16( 823 first_visit_text = l10n_util::GetStringFUTF16(
822 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, 824 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY,
823 base::TimeFormatShortDate(first_visit)); 825 base::TimeFormatShortDate(first_visit));
824 } else { 826 } else {
825 first_visit_text = l10n_util::GetStringUTF16( 827 first_visit_text = l10n_util::GetStringUTF16(
826 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY); 828 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY);
827 } 829 }
828 ui_->SetFirstVisit(first_visit_text); 830 ui_->SetFirstVisit(first_visit_text);
829 } 831 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/website_settings/permission_bubble_manager_unittest.cc ('k') | chrome/browser/ui/webui/about_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698