| 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_button.h" | 5 #include "chrome/browser/chromeos/status/network_menu_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 OnNetworkManagerChanged(cros); | 104 OnNetworkManagerChanged(cros); |
| 105 } | 105 } |
| 106 | 106 |
| 107 //////////////////////////////////////////////////////////////////////////////// | 107 //////////////////////////////////////////////////////////////////////////////// |
| 108 // NetworkMenuButton, NetworkMenu implementation: | 108 // NetworkMenuButton, NetworkMenu implementation: |
| 109 | 109 |
| 110 bool NetworkMenuButton::IsBrowserMode() const { | 110 bool NetworkMenuButton::IsBrowserMode() const { |
| 111 return host_->GetScreenMode() == StatusAreaHost::kBrowserMode; | 111 return host_->GetScreenMode() == StatusAreaHost::kBrowserMode; |
| 112 } | 112 } |
| 113 | 113 |
| 114 views::MenuButton* NetworkMenuButton::GetMenuButton() { |
| 115 return this; |
| 116 } |
| 117 |
| 114 gfx::NativeWindow NetworkMenuButton::GetNativeWindow() const { | 118 gfx::NativeWindow NetworkMenuButton::GetNativeWindow() const { |
| 115 return host_->GetNativeWindow(); | 119 return host_->GetNativeWindow(); |
| 116 } | 120 } |
| 117 | 121 |
| 118 void NetworkMenuButton::OpenButtonOptions() { | 122 void NetworkMenuButton::OpenButtonOptions() { |
| 119 host_->OpenButtonOptions(this); | 123 host_->OpenButtonOptions(this); |
| 120 } | 124 } |
| 121 | 125 |
| 122 bool NetworkMenuButton::ShouldOpenButtonOptions() const { | 126 bool NetworkMenuButton::ShouldOpenButtonOptions() const { |
| 123 return host_->ShouldOpenButtonOptions(this); | 127 return host_->ShouldOpenButtonOptions(this); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 cros->RemoveNetworkObserver(active_network_, this); | 250 cros->RemoveNetworkObserver(active_network_, this); |
| 247 } | 251 } |
| 248 if (!new_network.empty()) { | 252 if (!new_network.empty()) { |
| 249 cros->AddNetworkObserver(new_network, this); | 253 cros->AddNetworkObserver(new_network, this); |
| 250 } | 254 } |
| 251 active_network_ = new_network; | 255 active_network_ = new_network; |
| 252 } | 256 } |
| 253 } | 257 } |
| 254 | 258 |
| 255 } // namespace chromeos | 259 } // namespace chromeos |
| OLD | NEW |