OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Configure dialog for ethernet. | 31 // Configure dialog for ethernet. |
32 explicit NetworkConfigView(EthernetNetwork ethernet); | 32 explicit NetworkConfigView(EthernetNetwork ethernet); |
33 // Configure dialog for wifi. If |login_only|, then only show login tab. | 33 // Configure dialog for wifi. If |login_only|, then only show login tab. |
34 explicit NetworkConfigView(WifiNetwork wifi, bool login_only); | 34 explicit NetworkConfigView(WifiNetwork wifi, bool login_only); |
35 // Configure dialog for cellular. | 35 // Configure dialog for cellular. |
36 explicit NetworkConfigView(CellularNetwork cellular); | 36 explicit NetworkConfigView(CellularNetwork cellular); |
37 // Login dialog for hidden networks. | 37 // Login dialog for hidden networks. |
38 explicit NetworkConfigView(); | 38 explicit NetworkConfigView(); |
39 virtual ~NetworkConfigView() {} | 39 virtual ~NetworkConfigView() {} |
40 | 40 |
| 41 // Returns corresponding native window. |
| 42 gfx::NativeWindow GetNativeWindow() const; |
| 43 |
41 // views::DialogDelegate methods. | 44 // views::DialogDelegate methods. |
42 virtual std::wstring GetDialogButtonLabel( | 45 virtual std::wstring GetDialogButtonLabel( |
43 MessageBoxFlags::DialogButton button) const; | 46 MessageBoxFlags::DialogButton button) const; |
44 virtual bool IsDialogButtonEnabled( | 47 virtual bool IsDialogButtonEnabled( |
45 MessageBoxFlags::DialogButton button) const; | 48 MessageBoxFlags::DialogButton button) const; |
46 virtual bool Cancel(); | 49 virtual bool Cancel(); |
47 virtual bool Accept(); | 50 virtual bool Accept(); |
48 | 51 |
49 // views::WindowDelegate method. | 52 // views::WindowDelegate method. |
50 virtual bool IsModal() const { return true; } | 53 virtual bool IsModal() const { return true; } |
51 virtual views::View* GetContentsView() { return this; } | 54 virtual views::View* GetContentsView() { return this; } |
52 | 55 |
53 // views::View overrides. | 56 // views::View overrides. |
54 virtual std::wstring GetWindowTitle() const; | 57 virtual std::wstring GetWindowTitle() const; |
55 | 58 |
56 // views::TabbedPane::Listener overrides. | 59 // views::TabbedPane::Listener overrides. |
57 virtual void TabSelectedAt(int index); | 60 virtual void TabSelectedAt(int index); |
58 | 61 |
59 // Sets the focus on the login tab's first textfield. | 62 // Sets the focus on the login tab's first textfield. |
60 void SetLoginTextfieldFocus(); | 63 void SetLoginTextfieldFocus(); |
61 | 64 |
| 65 // Getter/setter for browser mode. |
| 66 void set_browser_mode(bool value) { |
| 67 browser_mode_ = value; |
| 68 } |
| 69 bool is_browser_mode() const { |
| 70 return browser_mode_; |
| 71 } |
| 72 |
62 protected: | 73 protected: |
63 // views::View overrides: | 74 // views::View overrides: |
64 virtual void Layout(); | 75 virtual void Layout(); |
65 virtual gfx::Size GetPreferredSize(); | 76 virtual gfx::Size GetPreferredSize(); |
66 virtual void ViewHierarchyChanged(bool is_add, | 77 virtual void ViewHierarchyChanged(bool is_add, |
67 views::View* parent, | 78 views::View* parent, |
68 views::View* child); | 79 views::View* child); |
69 | 80 |
70 private: | 81 private: |
71 enum NetworkConfigFlags { | 82 enum NetworkConfigFlags { |
72 FLAG_ETHERNET = 1 << 0, | 83 FLAG_ETHERNET = 1 << 0, |
73 FLAG_WIFI = 1 << 1, | 84 FLAG_WIFI = 1 << 1, |
74 FLAG_CELLULAR = 1 << 2, | 85 FLAG_CELLULAR = 1 << 2, |
75 FLAG_SHOW_IPCONFIG = 1 << 3, | 86 FLAG_SHOW_IPCONFIG = 1 << 3, |
76 FLAG_LOGIN_ONLY = 1 << 4, | 87 FLAG_LOGIN_ONLY = 1 << 4, |
77 FLAG_OTHER_NETWORK = 1 << 5, | 88 FLAG_OTHER_NETWORK = 1 << 5, |
78 }; | 89 }; |
79 | 90 |
80 // Initializes UI. | 91 // Initializes UI. |
81 void Init(); | 92 void Init(); |
82 | 93 |
| 94 // True when opening in browser, otherwise in OOBE/login mode. |
| 95 bool browser_mode_; |
| 96 |
83 views::TabbedPane* tabs_; | 97 views::TabbedPane* tabs_; |
84 | 98 |
85 // NetworkConfigFlags to specify which UIs to show. | 99 // NetworkConfigFlags to specify which UIs to show. |
86 int flags_; | 100 int flags_; |
87 | 101 |
88 EthernetNetwork ethernet_; | 102 EthernetNetwork ethernet_; |
89 WifiNetwork wifi_; | 103 WifiNetwork wifi_; |
90 CellularNetwork cellular_; | 104 CellularNetwork cellular_; |
91 | 105 |
92 WifiConfigView* wificonfig_view_; | 106 WifiConfigView* wificonfig_view_; |
93 IPConfigView* ipconfig_view_; | 107 IPConfigView* ipconfig_view_; |
94 | 108 |
95 DISALLOW_COPY_AND_ASSIGN(NetworkConfigView); | 109 DISALLOW_COPY_AND_ASSIGN(NetworkConfigView); |
96 }; | 110 }; |
97 | 111 |
98 } // namespace chromeos | 112 } // namespace chromeos |
99 | 113 |
100 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ | 114 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ |
OLD | NEW |