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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_INTERNET_OPTIONS_HANDLER2_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_INTERNET_OPTIONS_HANDLER2_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_INTERNET_OPTIONS_HANDLER2_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_INTERNET_OPTIONS_HANDLER2_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "chrome/browser/chromeos/cros/network_library.h" | 11 #include "chrome/browser/chromeos/cros/network_library.h" |
12 #include "chrome/browser/chromeos/cros/network_ui_data.h" | 12 #include "chrome/browser/chromeos/cros/network_ui_data.h" |
13 #include "chrome/browser/ui/webui/options2/options_ui2.h" | 13 #include "chrome/browser/ui/webui/options2/options_ui2.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
16 | 16 |
| 17 class Browser; |
17 class SkBitmap; | 18 class SkBitmap; |
| 19 |
18 namespace views { | 20 namespace views { |
19 class WidgetDelegate; | 21 class WidgetDelegate; |
20 } | 22 } |
21 | 23 |
22 namespace options2 { | 24 namespace options2 { |
23 | 25 |
24 // ChromeOS internet options page UI handler. | 26 // ChromeOS internet options page UI handler. |
25 class InternetOptionsHandler | 27 class InternetOptionsHandler |
26 : public OptionsPageUIHandler, | 28 : public OptionsPageUIHandler, |
27 public chromeos::NetworkLibrary::NetworkManagerObserver, | 29 public chromeos::NetworkLibrary::NetworkManagerObserver, |
(...skipping 24 matching lines...) Expand all Loading... |
52 // content::NotificationObserver implementation. | 54 // content::NotificationObserver implementation. |
53 virtual void Observe(int type, | 55 virtual void Observe(int type, |
54 const content::NotificationSource& source, | 56 const content::NotificationSource& source, |
55 const content::NotificationDetails& details) OVERRIDE; | 57 const content::NotificationDetails& details) OVERRIDE; |
56 | 58 |
57 private: | 59 private: |
58 // Opens a modal popup dialog. | 60 // Opens a modal popup dialog. |
59 void CreateModalPopup(views::WidgetDelegate* view); | 61 void CreateModalPopup(views::WidgetDelegate* view); |
60 gfx::NativeWindow GetNativeWindow() const; | 62 gfx::NativeWindow GetNativeWindow() const; |
61 | 63 |
| 64 // Returns the last active browser. If there is no such browser, creates a new |
| 65 // browser window with an empty tab and returns it. |
| 66 Browser* GetAppropriateBrowser(); |
| 67 |
62 // Passes data needed to show details overlay for network. | 68 // Passes data needed to show details overlay for network. |
63 // |args| will be [ network_type, service_path, command ] | 69 // |args| will be [ network_type, service_path, command ] |
64 // And command is one of 'options', 'connect', disconnect', 'activate' or | 70 // And command is one of 'options', 'connect', disconnect', 'activate' or |
65 // 'forget' | 71 // 'forget' |
66 // Handle{Wifi,Cellular}ButtonClick handles button click on a wireless | 72 // Handle{Wifi,Cellular}ButtonClick handles button click on a wireless |
67 // network item and a cellular network item respectively. | 73 // network item and a cellular network item respectively. |
68 void ButtonClickCallback(const base::ListValue* args); | 74 void ButtonClickCallback(const base::ListValue* args); |
69 void HandleWifiButtonClick(const std::string& service_path, | 75 void HandleWifiButtonClick(const std::string& service_path, |
70 const std::string& command); | 76 const std::string& command); |
71 void HandleCellularButtonClick(const std::string& service_path, | 77 void HandleCellularButtonClick(const std::string& service_path, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 chromeos::NetworkLibrary* cros_; | 159 chromeos::NetworkLibrary* cros_; |
154 | 160 |
155 content::NotificationRegistrar registrar_; | 161 content::NotificationRegistrar registrar_; |
156 | 162 |
157 DISALLOW_COPY_AND_ASSIGN(InternetOptionsHandler); | 163 DISALLOW_COPY_AND_ASSIGN(InternetOptionsHandler); |
158 }; | 164 }; |
159 | 165 |
160 } // namespace options2 | 166 } // namespace options2 |
161 | 167 |
162 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_INTERNET_OPTIONS_HANDLER2_H
_ | 168 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_INTERNET_OPTIONS_HANDLER2_H
_ |
OLD | NEW |