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/chromeos/login/network_selection_view.h" | 5 #include "chrome/browser/chromeos/login/network_selection_view.h" |
6 | 6 |
7 #include <signal.h> | 7 #include <signal.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
12 #include "app/resource_bundle.h" | 12 #include "app/resource_bundle.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "chrome/browser/chromeos/login/helper.h" | 14 #include "chrome/browser/chromeos/login/helper.h" |
15 #include "chrome/browser/chromeos/login/keyboard_switch_menu.h" | 15 #include "chrome/browser/chromeos/login/keyboard_switch_menu.h" |
16 #include "chrome/browser/chromeos/login/language_switch_menu.h" | 16 #include "chrome/browser/chromeos/login/language_switch_menu.h" |
17 #include "chrome/browser/chromeos/login/network_screen_delegate.h" | 17 #include "chrome/browser/chromeos/login/network_screen_delegate.h" |
18 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" | 18 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" |
19 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 19 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
20 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" | 20 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
21 #include "chrome/browser/chromeos/status/network_dropdown_button.h" | 21 #include "chrome/browser/chromeos/status/network_dropdown_button.h" |
22 #include "gfx/size.h" | 22 #include "gfx/size.h" |
23 #include "grit/chromium_strings.h" | 23 #include "grit/chromium_strings.h" |
24 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
25 #include "grit/theme_resources.h" | 25 #include "grit/theme_resources.h" |
26 #include "views/controls/button/native_button.h" | |
27 #include "views/controls/label.h" | 26 #include "views/controls/label.h" |
28 #include "views/controls/throbber.h" | 27 #include "views/controls/throbber.h" |
29 #include "views/fill_layout.h" | 28 #include "views/fill_layout.h" |
30 #include "views/grid_layout.h" | 29 #include "views/grid_layout.h" |
31 #include "views/standard_layout.h" | 30 #include "views/standard_layout.h" |
32 #include "views/widget/widget.h" | 31 #include "views/widget/widget.h" |
33 #include "views/widget/widget_gtk.h" | 32 #include "views/widget/widget_gtk.h" |
34 #include "views/window/non_client_view.h" | 33 #include "views/window/non_client_view.h" |
35 #include "views/window/window.h" | 34 #include "views/window/window.h" |
36 #include "views/window/window_gtk.h" | 35 #include "views/window/window_gtk.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Initializes menu button default properties. | 81 // Initializes menu button default properties. |
83 static void InitMenuButtonProperties(views::MenuButton* menu_button) { | 82 static void InitMenuButtonProperties(views::MenuButton* menu_button) { |
84 menu_button->SetFocusable(true); | 83 menu_button->SetFocusable(true); |
85 menu_button->SetNormalHasBorder(true); | 84 menu_button->SetNormalHasBorder(true); |
86 menu_button->SetEnabledColor(SK_ColorBLACK); | 85 menu_button->SetEnabledColor(SK_ColorBLACK); |
87 menu_button->SetHighlightColor(SK_ColorBLACK); | 86 menu_button->SetHighlightColor(SK_ColorBLACK); |
88 menu_button->SetHoverColor(SK_ColorBLACK); | 87 menu_button->SetHoverColor(SK_ColorBLACK); |
89 menu_button->set_animate_on_state_change(false); | 88 menu_button->set_animate_on_state_change(false); |
90 // Menu is positioned by bottom right corner of the MenuButton. | 89 // Menu is positioned by bottom right corner of the MenuButton. |
91 menu_button->set_menu_offset(kMenuHorizontalOffset, kMenuVerticalOffset); | 90 menu_button->set_menu_offset(kMenuHorizontalOffset, kMenuVerticalOffset); |
| 91 chromeos::CorrectMenuButtonFontSize(menu_button); |
92 } | 92 } |
93 | 93 |
94 } // namespace | 94 } // namespace |
95 | 95 |
96 namespace chromeos { | 96 namespace chromeos { |
97 | 97 |
98 // NetworkDropdownButton with custom Activate() behavior. | 98 // NetworkDropdownButton with custom Activate() behavior. |
99 class NetworkControlReportOnActivate : public NetworkDropdownButton { | 99 class NetworkControlReportOnActivate : public NetworkDropdownButton { |
100 public: | 100 public: |
101 NetworkControlReportOnActivate(bool browser_mode, | 101 NetworkControlReportOnActivate(bool browser_mode, |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 } | 438 } |
439 | 439 |
440 //////////////////////////////////////////////////////////////////////////////// | 440 //////////////////////////////////////////////////////////////////////////////// |
441 // NetworkSelectionView, private: | 441 // NetworkSelectionView, private: |
442 | 442 |
443 void NetworkSelectionView::RecreateNativeControls() { | 443 void NetworkSelectionView::RecreateNativeControls() { |
444 // There is no way to get native button preferred size after the button was | 444 // There is no way to get native button preferred size after the button was |
445 // sized so delete and recreate the button on text update. | 445 // sized so delete and recreate the button on text update. |
446 bool is_continue_enabled = IsContinueEnabled(); | 446 bool is_continue_enabled = IsContinueEnabled(); |
447 delete continue_button_; | 447 delete continue_button_; |
448 continue_button_ = new views::NativeButton( | 448 continue_button_ = new login::WideButton( |
449 delegate_, | 449 delegate_, |
450 l10n_util::GetString(IDS_NETWORK_SELECTION_CONTINUE_BUTTON)); | 450 l10n_util::GetString(IDS_NETWORK_SELECTION_CONTINUE_BUTTON)); |
451 continue_button_->SetEnabled(is_continue_enabled); | 451 continue_button_->SetEnabled(is_continue_enabled); |
452 } | 452 } |
453 | 453 |
454 void NetworkSelectionView::UpdateConnectingNetworkLabel() { | 454 void NetworkSelectionView::UpdateConnectingNetworkLabel() { |
455 connecting_network_label_->SetText(l10n_util::GetStringF( | 455 connecting_network_label_->SetText(l10n_util::GetStringF( |
456 IDS_NETWORK_SELECTION_CONNECTING, UTF16ToWide(network_id_))); | 456 IDS_NETWORK_SELECTION_CONNECTING, UTF16ToWide(network_id_))); |
457 } | 457 } |
458 | 458 |
459 } // namespace chromeos | 459 } // namespace chromeos |
OLD | NEW |