summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 15:15:39 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 15:15:39 +0000
commit5f57fd97af66ab068969a7d3fe4c7cb9f446f2ec (patch)
treece44b53e48068c1319a25fd36286f6a997e35b53
parent6ec2be2818899e442ff23571930ebb9afb6cf699 (diff)
downloadchromium_src-5f57fd97af66ab068969a7d3fe4c7cb9f446f2ec.zip
chromium_src-5f57fd97af66ab068969a7d3fe4c7cb9f446f2ec.tar.gz
chromium_src-5f57fd97af66ab068969a7d3fe4c7cb9f446f2ec.tar.bz2
Lands http://codereview.chromium.org/276054 for sosa:
Remove dependency to browser_window TEST=none BUG=none Review URL: http://codereview.chromium.org/274074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29276 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/network_menu_button.cc11
-rw-r--r--chrome/browser/chromeos/network_menu_button.h6
-rwxr-xr-xchrome/browser/chromeos/status_area_view.cc2
3 files changed, 8 insertions, 11 deletions
diff --git a/chrome/browser/chromeos/network_menu_button.cc b/chrome/browser/chromeos/network_menu_button.cc
index 242a9d9..03746e4 100644
--- a/chrome/browser/chromeos/network_menu_button.cc
+++ b/chrome/browser/chromeos/network_menu_button.cc
@@ -9,8 +9,6 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/string_util.h"
-#include "chrome/browser/browser.h"
-#include "chrome/browser/browser_window.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "views/widget/widget.h"
@@ -23,11 +21,11 @@
const int NetworkMenuButton::kNumWifiImages = 8;
const int NetworkMenuButton::kThrobDuration = 1000;
-NetworkMenuButton::NetworkMenuButton(Browser* browser)
+NetworkMenuButton::NetworkMenuButton(gfx::NativeWindow browser_window)
: MenuButton(NULL, std::wstring(), this, false),
refreshing_menu_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(network_menu_(this)),
- browser_(browser),
+ browser_window_(browser_window),
ALLOW_THIS_IN_INITIALIZER_LIST(animation_(this)) {
SetShowHighlighted(false);
animation_.SetThrobDuration(kThrobDuration);
@@ -89,17 +87,16 @@ void NetworkMenuButton::ActivatedAt(int index) {
if (!wifi_networks_[index].encrypted) {
cros->ConnectToWifiNetwork(wifi_networks_[index], string16());
} else {
- gfx::NativeWindow parent = browser_->window()->GetNativeHandle();
PasswordDialogView* dialog = new PasswordDialogView(this,
wifi_networks_[index].ssid);
views::Window* window = views::Window::CreateChromeWindow(
- parent, gfx::Rect(), dialog);
+ browser_window_, gfx::Rect(), dialog);
// Draw the password dialog right below this button and right aligned.
gfx::Size size = dialog->GetPreferredSize();
gfx::Rect rect = bounds();
gfx::Point point = gfx::Point(rect.width() - size.width(), rect.height());
ConvertPointToScreen(this, &point);
- window->SetBounds(gfx::Rect(point, size), parent);
+ window->SetBounds(gfx::Rect(point, size), browser_window_);
window->Show();
}
}
diff --git a/chrome/browser/chromeos/network_menu_button.h b/chrome/browser/chromeos/network_menu_button.h
index d0925a25..8a97348 100644
--- a/chrome/browser/chromeos/network_menu_button.h
+++ b/chrome/browser/chromeos/network_menu_button.h
@@ -28,7 +28,7 @@ class NetworkMenuButton : public views::MenuButton,
public PasswordDialogDelegate,
public CrosNetworkLibrary::Observer {
public:
- explicit NetworkMenuButton(Browser* browser);
+ explicit NetworkMenuButton(gfx::NativeWindow browser_window);
virtual ~NetworkMenuButton();
// views::Menu2Model implementation.
@@ -82,8 +82,8 @@ class NetworkMenuButton : public views::MenuButton,
// The network menu.
views::Menu2 network_menu_;
- // The browser window that owns us.
- Browser* browser_;
+ // Our parent window
+ gfx::NativeWindow browser_window_;
// The throb animation that does the wifi connecting animation.
ThrobAnimation animation_;
diff --git a/chrome/browser/chromeos/status_area_view.cc b/chrome/browser/chromeos/status_area_view.cc
index 14ed8ac..4a1ac70 100755
--- a/chrome/browser/chromeos/status_area_view.cc
+++ b/chrome/browser/chromeos/status_area_view.cc
@@ -130,7 +130,7 @@ void StatusAreaView::Init() {
AddChildView(clock_view_);
// Network.
- network_view_ = new NetworkMenuButton(browser_);
+ network_view_ = new NetworkMenuButton(browser_->window()->GetNativeHandle());
AddChildView(network_view_);
// Battery.