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/chromeos/options/network_config_view.h" | 5 #include "chrome/browser/chromeos/options/network_config_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "chromeos/network/network_state_handler.h" | 26 #include "chromeos/network/network_state_handler.h" |
27 #include "components/device_event_log/device_event_log.h" | 27 #include "components/device_event_log/device_event_log.h" |
28 #include "components/user_manager/user.h" | 28 #include "components/user_manager/user.h" |
29 #include "grit/components_scaled_resources.h" | 29 #include "grit/components_scaled_resources.h" |
30 #include "ui/accessibility/ax_view_state.h" | 30 #include "ui/accessibility/ax_view_state.h" |
31 #include "ui/aura/window_event_dispatcher.h" | 31 #include "ui/aura/window_event_dispatcher.h" |
32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
34 #include "ui/gfx/geometry/rect.h" | 34 #include "ui/gfx/geometry/rect.h" |
35 #include "ui/gfx/image/image.h" | 35 #include "ui/gfx/image/image.h" |
36 #include "ui/views/controls/button/label_button.h" | 36 #include "ui/views/controls/button/md_text_button.h" |
37 #include "ui/views/controls/image_view.h" | 37 #include "ui/views/controls/image_view.h" |
38 #include "ui/views/layout/layout_constants.h" | 38 #include "ui/views/layout/layout_constants.h" |
39 #include "ui/views/widget/widget.h" | 39 #include "ui/views/widget/widget.h" |
40 | 40 |
41 using views::Widget; | 41 using views::Widget; |
42 | 42 |
43 namespace chromeos { | 43 namespace chromeos { |
44 | 44 |
45 namespace { | 45 namespace { |
46 | 46 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 child_config_view_ = new VPNConfigView(this, service_path); | 95 child_config_view_ = new VPNConfigView(this, service_path); |
96 } | 96 } |
97 return child_config_view_ != nullptr; | 97 return child_config_view_ != nullptr; |
98 } | 98 } |
99 | 99 |
100 bool NetworkConfigView::InitWithType(const std::string& type) { | 100 bool NetworkConfigView::InitWithType(const std::string& type) { |
101 if (type == shill::kTypeWifi) { | 101 if (type == shill::kTypeWifi) { |
102 child_config_view_ = new WifiConfigView(this, | 102 child_config_view_ = new WifiConfigView(this, |
103 "" /* service_path */, | 103 "" /* service_path */, |
104 false /* show_8021x */); | 104 false /* show_8021x */); |
105 advanced_button_ = new views::LabelButton(this, l10n_util::GetStringUTF16( | 105 advanced_button_ = views::MdTextButton::CreateSecondaryUiButton( |
106 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_ADVANCED_BUTTON)); | 106 this, l10n_util::GetStringUTF16( |
107 advanced_button_->SetStyle(views::Button::STYLE_BUTTON); | 107 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_ADVANCED_BUTTON)); |
108 } else if (type == shill::kTypeVPN) { | 108 } else if (type == shill::kTypeVPN) { |
109 child_config_view_ = new VPNConfigView(this, | 109 child_config_view_ = new VPNConfigView(this, |
110 "" /* service_path */); | 110 "" /* service_path */); |
111 } | 111 } |
112 return child_config_view_ != nullptr; | 112 return child_config_view_ != nullptr; |
113 } | 113 } |
114 | 114 |
115 NetworkConfigView::~NetworkConfigView() { | 115 NetworkConfigView::~NetworkConfigView() { |
116 DCHECK(GetActiveDialog() == this); | 116 DCHECK(GetActiveDialog() == this); |
117 SetActiveDialog(nullptr); | 117 SetActiveDialog(nullptr); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 image_view_ = new views::ImageView(); | 351 image_view_ = new views::ImageView(); |
352 // Disable |image_view_| so mouse events propagate to the parent. | 352 // Disable |image_view_| so mouse events propagate to the parent. |
353 image_view_->SetEnabled(false); | 353 image_view_->SetEnabled(false); |
354 image_view_->SetImage(image_); | 354 image_view_->SetImage(image_); |
355 image_view_->SetTooltipText( | 355 image_view_->SetTooltipText( |
356 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); | 356 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); |
357 AddChildView(image_view_); | 357 AddChildView(image_view_); |
358 } | 358 } |
359 | 359 |
360 } // namespace chromeos | 360 } // namespace chromeos |
OLD | NEW |