Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: chrome/browser/chromeos/status/network_menu_button.cc

Issue 1142005: Mocks for all libcros elements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/status/network_menu_button.cc
===================================================================
--- chrome/browser/chromeos/status/network_menu_button.cc (revision 42341)
+++ chrome/browser/chromeos/status/network_menu_button.cc (working copy)
@@ -9,8 +9,8 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/string_util.h"
+#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/options/network_config_view.h"
-#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/status/status_area_host.h"
#include "gfx/canvas.h"
#include "gfx/skbitmap_operations.h"
@@ -35,12 +35,12 @@
ALLOW_THIS_IN_INITIALIZER_LIST(animation_connecting_(this)) {
animation_connecting_.SetThrobDuration(kThrobDuration);
animation_connecting_.SetTweenType(SlideAnimation::NONE);
- NetworkChanged(NetworkLibrary::Get());
- NetworkLibrary::Get()->AddObserver(this);
+ NetworkChanged(CrosLibrary::Get()->GetNetworkLibrary());
+ CrosLibrary::Get()->GetNetworkLibrary()->AddObserver(this);
}
NetworkMenuButton::~NetworkMenuButton() {
- NetworkLibrary::Get()->RemoveObserver(this);
+ CrosLibrary::Get()->GetNetworkLibrary()->RemoveObserver(this);
}
////////////////////////////////////////////////////////////////////////////////
@@ -86,7 +86,7 @@
if (refreshing_menu_)
return;
- NetworkLibrary* cros = NetworkLibrary::Get();
+ NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary();
int flags = menu_items_[index].flags;
if (flags & FLAG_OPTIONS) {
host_->OpenButtonOptions(this);
@@ -184,7 +184,7 @@
void NetworkMenuButton::DrawPressed(gfx::Canvas* canvas) {
// If ethernet connected and not current connecting, then show ethernet
// pressed icon. Otherwise, show the bars pressed icon.
- if (NetworkLibrary::Get()->ethernet_connected() &&
+ if (CrosLibrary::Get()->GetNetworkLibrary()->ethernet_connected() &&
!animation_connecting_.IsAnimating())
canvas->DrawBitmapInt(IconForDisplay(
*ResourceBundle::GetSharedInstance().
@@ -212,7 +212,7 @@
canvas->DrawBitmapInt(icon(), 0, 0);
// If wifi, we draw the wifi signal bars.
- NetworkLibrary* cros = NetworkLibrary::Get();
+ NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary();
if (cros->wifi_connecting() ||
(!cros->ethernet_connected() && cros->wifi_connected())) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
@@ -296,7 +296,7 @@
void NetworkMenuButton::NetworkChanged(NetworkLibrary* cros) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- if (CrosLibrary::EnsureLoaded()) {
+ if (CrosLibrary::Get()->EnsureLoaded()) {
if (cros->wifi_connecting() || cros->cellular_connecting()) {
// Start the connecting animation if not running.
if (!animation_connecting_.IsAnimating()) {
@@ -395,7 +395,7 @@
void NetworkMenuButton::RunMenu(views::View* source, const gfx::Point& pt) {
refreshing_menu_ = true;
- NetworkLibrary::Get()->RequestWifiScan();
+ CrosLibrary::Get()->GetNetworkLibrary()->RequestWifiScan();
InitMenuItems();
network_menu_.Rebuild();
network_menu_.UpdateStates();
@@ -406,7 +406,7 @@
void NetworkMenuButton::InitMenuItems() {
menu_items_.clear();
// Populate our MenuItems with the current list of wifi networks.
- NetworkLibrary* cros = NetworkLibrary::Get();
+ NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary();
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
// Ethernet
« no previous file with comments | « chrome/browser/chromeos/status/language_menu_button.cc ('k') | chrome/browser/chromeos/status/power_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698