| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/status/network_menu.h" | 5 #include "chrome/browser/chromeos/status/network_menu.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1477 return canvas.ExtractBitmap(); | 1477 return canvas.ExtractBitmap(); |
| 1478 } | 1478 } |
| 1479 | 1479 |
| 1480 void NetworkMenu::ShowTabbedNetworkSettings(const Network* network) const { | 1480 void NetworkMenu::ShowTabbedNetworkSettings(const Network* network) const { |
| 1481 DCHECK(network); | 1481 DCHECK(network); |
| 1482 Browser* browser = BrowserList::GetLastActive(); | 1482 Browser* browser = BrowserList::GetLastActive(); |
| 1483 if (!browser) | 1483 if (!browser) |
| 1484 return; | 1484 return; |
| 1485 std::string page = StringPrintf("%s?servicePath=%s&networkType=%d", | 1485 std::string page = StringPrintf("%s?servicePath=%s&networkType=%d", |
| 1486 chrome::kInternetOptionsSubPage, | 1486 chrome::kInternetOptionsSubPage, |
| 1487 EscapeUrlEncodedData(network->service_path()).c_str(), | 1487 EscapeUrlEncodedData(network->service_path(), true).c_str(), |
| 1488 network->type()); | 1488 network->type()); |
| 1489 browser->ShowOptionsTab(page); | 1489 browser->ShowOptionsTab(page); |
| 1490 } | 1490 } |
| 1491 | 1491 |
| 1492 //////////////////////////////////////////////////////////////////////////////// | 1492 //////////////////////////////////////////////////////////////////////////////// |
| 1493 // NetworkMenu, views::ViewMenuDelegate implementation: | 1493 // NetworkMenu, views::ViewMenuDelegate implementation: |
| 1494 | 1494 |
| 1495 void NetworkMenu::RunMenu(views::View* source, const gfx::Point& pt) { | 1495 void NetworkMenu::RunMenu(views::View* source, const gfx::Point& pt) { |
| 1496 NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary(); | 1496 NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary(); |
| 1497 cros->RequestNetworkScan(); | 1497 cros->RequestNetworkScan(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1509 | 1509 |
| 1510 gfx::Point screen_loc; | 1510 gfx::Point screen_loc; |
| 1511 views::View::ConvertPointToScreen(source, &screen_loc); | 1511 views::View::ConvertPointToScreen(source, &screen_loc); |
| 1512 gfx::Rect bounds(screen_loc, source->size()); | 1512 gfx::Rect bounds(screen_loc, source->size()); |
| 1513 network_menu_->GetSubmenu()->set_minimum_preferred_width(min_width_); | 1513 network_menu_->GetSubmenu()->set_minimum_preferred_width(min_width_); |
| 1514 network_menu_->RunMenuAt(window, GetMenuButton(), bounds, | 1514 network_menu_->RunMenuAt(window, GetMenuButton(), bounds, |
| 1515 views::MenuItemView::TOPRIGHT, true); | 1515 views::MenuItemView::TOPRIGHT, true); |
| 1516 } | 1516 } |
| 1517 | 1517 |
| 1518 } // namespace chromeos | 1518 } // namespace chromeos |
| OLD | NEW |