| 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 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 | 1195 |
| 1196 // TODO(rhashimoto): Remove this workaround when WebUI provides a | 1196 // TODO(rhashimoto): Remove this workaround when WebUI provides a |
| 1197 // top-level widget on the ChromeOS login screen that is a window. | 1197 // top-level widget on the ChromeOS login screen that is a window. |
| 1198 // The current BackgroundView class for the ChromeOS login screen | 1198 // The current BackgroundView class for the ChromeOS login screen |
| 1199 // creates a owning Widget that has a native GtkWindow but is not a | 1199 // creates a owning Widget that has a native GtkWindow but is not a |
| 1200 // Window. This makes it impossible to get the NativeWindow via | 1200 // Window. This makes it impossible to get the NativeWindow via |
| 1201 // the views API. This workaround casts the top-level NativeWidget | 1201 // the views API. This workaround casts the top-level NativeWidget |
| 1202 // to a NativeWindow that we can pass to MenuItemView::RunMenuAt(). | 1202 // to a NativeWindow that we can pass to MenuItemView::RunMenuAt(). |
| 1203 gfx::NativeWindow window = GTK_WINDOW(source->GetWidget()->GetNativeView()); | 1203 gfx::NativeWindow window = GTK_WINDOW(source->GetWidget()->GetNativeView()); |
| 1204 | 1204 |
| 1205 gfx::Point screen_loc; | 1205 gfx::Point screen_location; |
| 1206 views::View::ConvertPointToScreen(source, &screen_loc); | 1206 views::View::ConvertPointToScreen(source, &screen_location); |
| 1207 gfx::Rect bounds(screen_loc, source->size()); | 1207 gfx::Rect bounds(screen_location, source->size()); |
| 1208 menu_item_view_->GetSubmenu()->set_minimum_preferred_width(min_width_); | 1208 menu_item_view_->GetSubmenu()->set_minimum_preferred_width(min_width_); |
| 1209 menu_item_view_->RunMenuAt(window, delegate_->GetMenuButton(), bounds, | 1209 menu_item_view_->RunMenuAt(window, delegate_->GetMenuButton(), bounds, |
| 1210 views::MenuItemView::TOPRIGHT, true); | 1210 views::MenuItemView::TOPRIGHT, true); |
| 1211 } | 1211 } |
| 1212 | 1212 |
| 1213 void NetworkMenu::ShowTabbedNetworkSettings(const Network* network) const { | 1213 void NetworkMenu::ShowTabbedNetworkSettings(const Network* network) const { |
| 1214 DCHECK(network); | 1214 DCHECK(network); |
| 1215 Browser* browser = BrowserList::GetLastActive(); | 1215 Browser* browser = BrowserList::GetLastActive(); |
| 1216 if (!browser) | 1216 if (!browser) |
| 1217 return; | 1217 return; |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1495 | 1495 |
| 1496 // This way if both wifi and cell are connecting we'll use wifi. | 1496 // This way if both wifi and cell are connecting we'll use wifi. |
| 1497 if (cros->wifi_connecting()) | 1497 if (cros->wifi_connecting()) |
| 1498 return TYPE_WIFI; | 1498 return TYPE_WIFI; |
| 1499 if (cros->cellular_connecting()) | 1499 if (cros->cellular_connecting()) |
| 1500 return TYPE_CELLULAR; | 1500 return TYPE_CELLULAR; |
| 1501 return TYPE_WIFI; | 1501 return TYPE_WIFI; |
| 1502 } | 1502 } |
| 1503 | 1503 |
| 1504 } // namespace chromeos | 1504 } // namespace chromeos |
| OLD | NEW |