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/dom_ui/internet_options_handler.h" | 5 #include "chrome/browser/chromeos/dom_ui/internet_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 DictionaryValue dictionary; | 86 DictionaryValue dictionary; |
87 dictionary.Set(L"wiredList", GetWiredList()); | 87 dictionary.Set(L"wiredList", GetWiredList()); |
88 dictionary.Set(L"wirelessList", GetWirelessList()); | 88 dictionary.Set(L"wirelessList", GetWirelessList()); |
89 dictionary.Set(L"rememberedList", GetRememberedList()); | 89 dictionary.Set(L"rememberedList", GetRememberedList()); |
90 dom_ui_->CallJavascriptFunction( | 90 dom_ui_->CallJavascriptFunction( |
91 L"options.InternetOptions.refreshNetworkData", dictionary); | 91 L"options.InternetOptions.refreshNetworkData", dictionary); |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 void InternetOptionsHandler::CreateModalPopup(views::WindowDelegate* view) { | 95 void InternetOptionsHandler::CreateModalPopup(views::WindowDelegate* view) { |
96 Browser* browser = NULL; | 96 // TODO(beng): This is an improper direct dependency on Browser. Route this |
97 TabContentsDelegate* delegate = dom_ui_->tab_contents()->delegate(); | 97 // through some sort of delegate. |
98 if (delegate) | 98 Browser* browser = BrowserList::FindBrowserWithProfile(dom_ui_->GetProfile()); |
99 browser = delegate->GetBrowser(); | |
100 DCHECK(browser); | |
101 views::Window* window = views::Window::CreateChromeWindow( | 99 views::Window* window = views::Window::CreateChromeWindow( |
102 browser->window()->GetNativeHandle(), gfx::Rect(), view); | 100 browser->window()->GetNativeHandle(), gfx::Rect(), view); |
103 window->SetIsAlwaysOnTop(true); | 101 window->SetIsAlwaysOnTop(true); |
104 window->Show(); | 102 window->Show(); |
105 } | 103 } |
106 | 104 |
107 void InternetOptionsHandler::ButtonClickCallback(const Value* value) { | 105 void InternetOptionsHandler::ButtonClickCallback(const Value* value) { |
108 if (!value || !value->IsType(Value::TYPE_LIST)) { | 106 if (!value || !value->IsType(Value::TYPE_LIST)) { |
109 NOTREACHED(); | 107 NOTREACHED(); |
110 return; | 108 return; |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 icon, | 333 icon, |
336 it->name(), | 334 it->name(), |
337 it->connecting(), | 335 it->connecting(), |
338 it->connected(), | 336 it->connected(), |
339 chromeos::TYPE_CELLULAR, | 337 chromeos::TYPE_CELLULAR, |
340 true)); | 338 true)); |
341 } | 339 } |
342 | 340 |
343 return list; | 341 return list; |
344 } | 342 } |
OLD | NEW |