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

Side by Side Diff: chrome/browser/chromeos/options/network_config_view.h

Issue 10392097: Prevent showing multiple network config views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months 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 | Annotate | Revision Log
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 #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 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 24 matching lines...) Expand all
35 // Called when dialog "OK" button is pressed. 35 // Called when dialog "OK" button is pressed.
36 virtual void OnDialogAccepted() = 0; 36 virtual void OnDialogAccepted() = 0;
37 37
38 // Called when dialog "Cancel" button is pressed. 38 // Called when dialog "Cancel" button is pressed.
39 virtual void OnDialogCancelled() = 0; 39 virtual void OnDialogCancelled() = 0;
40 40
41 protected: 41 protected:
42 virtual ~Delegate() {} 42 virtual ~Delegate() {}
43 }; 43 };
44 44
45 // Login dialog for known networks. 45 // Shows a network connection dialog if none is currently visible.
46 explicit NetworkConfigView(Network* network); 46 // Returns false if a dialog is already visible.
47 // Login dialog for new/hidden networks. 47 static bool Show(Network* network, gfx::NativeWindow parent);
48 explicit NetworkConfigView(ConnectionType type); 48 static bool ShowForType(ConnectionType type, gfx::NativeWindow parent);
49 virtual ~NetworkConfigView() {}
50 49
51 // Returns corresponding native window. 50 // Returns corresponding native window.
52 gfx::NativeWindow GetNativeWindow() const; 51 gfx::NativeWindow GetNativeWindow() const;
53 52
54 // views::DialogDelegate methods. 53 // views::DialogDelegate methods.
55 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; 54 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
56 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; 55 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE;
57 virtual bool Cancel() OVERRIDE; 56 virtual bool Cancel() OVERRIDE;
58 virtual bool Accept() OVERRIDE; 57 virtual bool Accept() OVERRIDE;
59 virtual views::View* GetExtraView() OVERRIDE; 58 virtual views::View* GetExtraView() OVERRIDE;
(...skipping 17 matching lines...) Expand all
77 76
78 protected: 77 protected:
79 // views::View overrides: 78 // views::View overrides:
80 virtual void Layout() OVERRIDE; 79 virtual void Layout() OVERRIDE;
81 virtual gfx::Size GetPreferredSize() OVERRIDE; 80 virtual gfx::Size GetPreferredSize() OVERRIDE;
82 virtual void ViewHierarchyChanged(bool is_add, 81 virtual void ViewHierarchyChanged(bool is_add,
83 views::View* parent, 82 views::View* parent,
84 views::View* child) OVERRIDE; 83 views::View* child) OVERRIDE;
85 84
86 private: 85 private:
86 // Login dialog for known networks.
87 explicit NetworkConfigView(Network* network);
88 // Login dialog for new/hidden networks.
89 explicit NetworkConfigView(ConnectionType type);
90 virtual ~NetworkConfigView();
91
87 // Creates an "Advanced" button in the lower-left corner of the dialog. 92 // Creates an "Advanced" button in the lower-left corner of the dialog.
88 void CreateAdvancedButton(); 93 void CreateAdvancedButton();
89 94
90 // Resets the underlying view to show advanced options. 95 // Resets the underlying view to show advanced options.
91 void ShowAdvancedView(); 96 void ShowAdvancedView();
92 97
93 // There's always only one child view, which will get deleted when 98 // There's always only one child view, which will get deleted when
94 // NetworkConfigView gets cleaned up. 99 // NetworkConfigView gets cleaned up.
95 ChildNetworkConfigView* child_config_view_; 100 ChildNetworkConfigView* child_config_view_;
96 101
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 views::ImageView* image_view_; 176 views::ImageView* image_view_;
172 const SkBitmap* gray_image_; 177 const SkBitmap* gray_image_;
173 const SkBitmap* color_image_; 178 const SkBitmap* color_image_;
174 179
175 DISALLOW_COPY_AND_ASSIGN(ControlledSettingIndicatorView); 180 DISALLOW_COPY_AND_ASSIGN(ControlledSettingIndicatorView);
176 }; 181 };
177 182
178 } // namespace chromeos 183 } // namespace chromeos
179 184
180 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ 185 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/network_login_observer.cc ('k') | chrome/browser/chromeos/options/network_config_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698