| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 //////////////////////////////////////////////////////////////////////////////// | 507 //////////////////////////////////////////////////////////////////////////////// |
| 508 // NetworkMenuModel, private methods: | 508 // NetworkMenuModel, private methods: |
| 509 | 509 |
| 510 // TODO(stevenjb): deprecate this once we've committed to tabbed settings | 510 // TODO(stevenjb): deprecate this once we've committed to tabbed settings |
| 511 // and the embedded menu UI (and fully deprecated NetworkConfigView). | 511 // and the embedded menu UI (and fully deprecated NetworkConfigView). |
| 512 // Meanwhile, if MenuUI::IsEnabled() is true, always show the settings UI, | 512 // Meanwhile, if MenuUI::IsEnabled() is true, always show the settings UI, |
| 513 // otherwise show NetworkConfigView only to get passwords when not connected. | 513 // otherwise show NetworkConfigView only to get passwords when not connected. |
| 514 void NetworkMenuModel::ShowNetworkConfigView(NetworkConfigView* view) const { | 514 void NetworkMenuModel::ShowNetworkConfigView(NetworkConfigView* view) const { |
| 515 views::Window* window = browser::CreateViewsWindow( | 515 views::Window* window = browser::CreateViewsWindow( |
| 516 owner_->GetNativeWindow(), gfx::Rect(), view); | 516 owner_->GetNativeWindow(), gfx::Rect(), view); |
| 517 window->SetAlwaysOnTop(true); | 517 window->SetIsAlwaysOnTop(true); |
| 518 window->Show(); | 518 window->Show(); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void NetworkMenuModel::ActivateCellular(const CellularNetwork* cellular) const { | 521 void NetworkMenuModel::ActivateCellular(const CellularNetwork* cellular) const { |
| 522 DCHECK(cellular); | 522 DCHECK(cellular); |
| 523 Browser* browser = BrowserList::GetLastActive(); | 523 Browser* browser = BrowserList::GetLastActive(); |
| 524 if (!browser) | 524 if (!browser) |
| 525 return; | 525 return; |
| 526 browser->OpenMobilePlanTabAndActivate(); | 526 browser->OpenMobilePlanTabAndActivate(); |
| 527 } | 527 } |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 | 1433 |
| 1434 gfx::Point screen_loc; | 1434 gfx::Point screen_loc; |
| 1435 views::View::ConvertPointToScreen(source, &screen_loc); | 1435 views::View::ConvertPointToScreen(source, &screen_loc); |
| 1436 gfx::Rect bounds(screen_loc, source->size()); | 1436 gfx::Rect bounds(screen_loc, source->size()); |
| 1437 network_menu_->GetSubmenu()->set_minimum_preferred_width(min_width_); | 1437 network_menu_->GetSubmenu()->set_minimum_preferred_width(min_width_); |
| 1438 network_menu_->RunMenuAt(window, GetMenuButton(), bounds, | 1438 network_menu_->RunMenuAt(window, GetMenuButton(), bounds, |
| 1439 views::MenuItemView::TOPRIGHT, true); | 1439 views::MenuItemView::TOPRIGHT, true); |
| 1440 } | 1440 } |
| 1441 | 1441 |
| 1442 } // namespace chromeos | 1442 } // namespace chromeos |
| OLD | NEW |