| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/options/advanced_contents_view.h" | 5 #include "chrome/browser/views/options/advanced_contents_view.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include <cryptuiapi.h> | 9 #include <cryptuiapi.h> |
| 10 #pragma comment(lib, "cryptui.lib") | 10 #pragma comment(lib, "cryptui.lib") |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/thread.h" | 22 #include "base/thread.h" |
| 23 #include "chrome/browser/browser.h" | 23 #include "chrome/browser/browser.h" |
| 24 #include "chrome/browser/browser_list.h" | 24 #include "chrome/browser/browser_list.h" |
| 25 #include "chrome/browser/browser_process.h" | 25 #include "chrome/browser/browser_process.h" |
| 26 #include "chrome/browser/download/download_manager.h" | 26 #include "chrome/browser/download/download_manager.h" |
| 27 #include "chrome/browser/gears_integration.h" | 27 #include "chrome/browser/gears_integration.h" |
| 28 #include "chrome/browser/net/predictor_api.h" | 28 #include "chrome/browser/net/predictor_api.h" |
| 29 #include "chrome/browser/options_util.h" | 29 #include "chrome/browser/options_util.h" |
| 30 #include "chrome/browser/pref_member.h" | 30 #include "chrome/browser/pref_member.h" |
| 31 #include "chrome/browser/pref_service.h" | 31 #include "chrome/browser/pref_service.h" |
| 32 #include "chrome/browser/pref_set_observer.h" |
| 32 #include "chrome/browser/profile.h" | 33 #include "chrome/browser/profile.h" |
| 33 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 34 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 34 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 35 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 35 #include "chrome/browser/shell_dialogs.h" | 36 #include "chrome/browser/shell_dialogs.h" |
| 36 #include "chrome/browser/views/browser_dialogs.h" | 37 #include "chrome/browser/views/browser_dialogs.h" |
| 37 #include "chrome/browser/views/clear_browsing_data.h" | 38 #include "chrome/browser/views/clear_browsing_data.h" |
| 38 #include "chrome/browser/views/list_background.h" | 39 #include "chrome/browser/views/list_background.h" |
| 39 #include "chrome/browser/views/options/content_settings_window_view.h" | 40 #include "chrome/browser/views/options/content_settings_window_view.h" |
| 40 #include "chrome/browser/views/options/fonts_languages_window_view.h" | 41 #include "chrome/browser/views/options/fonts_languages_window_view.h" |
| 41 #include "chrome/browser/views/restart_message_box.h" | 42 #include "chrome/browser/views/restart_message_box.h" |
| (...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 protected: | 947 protected: |
| 947 // OptionsPageView overrides: | 948 // OptionsPageView overrides: |
| 948 virtual void InitControlLayout(); | 949 virtual void InitControlLayout(); |
| 949 virtual void NotifyPrefChanged(const std::wstring* pref_name); | 950 virtual void NotifyPrefChanged(const std::wstring* pref_name); |
| 950 | 951 |
| 951 private: | 952 private: |
| 952 // Controls for this section: | 953 // Controls for this section: |
| 953 views::Label* change_proxies_label_; | 954 views::Label* change_proxies_label_; |
| 954 views::NativeButton* change_proxies_button_; | 955 views::NativeButton* change_proxies_button_; |
| 955 | 956 |
| 957 // Tracks the proxy preferences. |
| 958 scoped_ptr<PrefSetObserver> proxy_prefs_; |
| 959 |
| 956 DISALLOW_COPY_AND_ASSIGN(NetworkSection); | 960 DISALLOW_COPY_AND_ASSIGN(NetworkSection); |
| 957 }; | 961 }; |
| 958 | 962 |
| 959 NetworkSection::NetworkSection(Profile* profile) | 963 NetworkSection::NetworkSection(Profile* profile) |
| 960 : change_proxies_label_(NULL), | 964 : change_proxies_label_(NULL), |
| 961 change_proxies_button_(NULL), | 965 change_proxies_button_(NULL), |
| 962 AdvancedSection(profile, | 966 AdvancedSection(profile, |
| 963 l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_NETWORK)) { | 967 l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_NETWORK)) { |
| 964 } | 968 } |
| 965 | 969 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 991 const int dependent_labeled_field_set_id = 2; | 995 const int dependent_labeled_field_set_id = 2; |
| 992 AddDependentTwoColumnSet(layout, dependent_labeled_field_set_id); | 996 AddDependentTwoColumnSet(layout, dependent_labeled_field_set_id); |
| 993 const int dns_set_id = 3; | 997 const int dns_set_id = 3; |
| 994 AddDependentTwoColumnSet(layout, dns_set_id); | 998 AddDependentTwoColumnSet(layout, dns_set_id); |
| 995 | 999 |
| 996 // Proxy settings. | 1000 // Proxy settings. |
| 997 AddWrappingLabelRow(layout, change_proxies_label_, single_column_view_set_id, | 1001 AddWrappingLabelRow(layout, change_proxies_label_, single_column_view_set_id, |
| 998 true); | 1002 true); |
| 999 AddLeadingControl(layout, change_proxies_button_, indented_view_set_id, | 1003 AddLeadingControl(layout, change_proxies_button_, indented_view_set_id, |
| 1000 false); | 1004 false); |
| 1005 |
| 1006 proxy_prefs_.reset(PrefSetObserver::CreateProxyPrefSetObserver( |
| 1007 profile()->GetPrefs(), this)); |
| 1008 NotifyPrefChanged(NULL); |
| 1001 } | 1009 } |
| 1002 | 1010 |
| 1003 void NetworkSection::NotifyPrefChanged(const std::wstring* pref_name) { | 1011 void NetworkSection::NotifyPrefChanged(const std::wstring* pref_name) { |
| 1012 if (!pref_name || proxy_prefs_->IsObserved(*pref_name)) { |
| 1013 change_proxies_button_->SetEnabled(!proxy_prefs_->IsManaged()); |
| 1014 } |
| 1004 } | 1015 } |
| 1005 | 1016 |
| 1006 } // namespace | 1017 } // namespace |
| 1007 | 1018 |
| 1008 //////////////////////////////////////////////////////////////////////////////// | 1019 //////////////////////////////////////////////////////////////////////////////// |
| 1009 // DownloadSection | 1020 // DownloadSection |
| 1010 | 1021 |
| 1011 class DownloadSection : public AdvancedSection, | 1022 class DownloadSection : public AdvancedSection, |
| 1012 public views::ButtonListener, | 1023 public views::ButtonListener, |
| 1013 public SelectFileDialog::Listener { | 1024 public SelectFileDialog::Listener { |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 // AdvancedScrollViewContainer, views::View overrides: | 1406 // AdvancedScrollViewContainer, views::View overrides: |
| 1396 | 1407 |
| 1397 void AdvancedScrollViewContainer::Layout() { | 1408 void AdvancedScrollViewContainer::Layout() { |
| 1398 gfx::Rect lb = GetLocalBounds(false); | 1409 gfx::Rect lb = GetLocalBounds(false); |
| 1399 | 1410 |
| 1400 gfx::Size border = gfx::NativeTheme::instance()->GetThemeBorderSize( | 1411 gfx::Size border = gfx::NativeTheme::instance()->GetThemeBorderSize( |
| 1401 gfx::NativeTheme::LIST); | 1412 gfx::NativeTheme::LIST); |
| 1402 lb.Inset(border.width(), border.height()); | 1413 lb.Inset(border.width(), border.height()); |
| 1403 scroll_view_->SetBounds(lb); | 1414 scroll_view_->SetBounds(lb); |
| 1404 } | 1415 } |
| OLD | NEW |