summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-08 17:47:43 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-08 17:47:43 +0000
commit68c477df6917633a7a9c64f8624446ca0bd895d5 (patch)
treea270354aa75de9516ba5b150568bb1d142b24b1c /chrome/browser/ui
parent8a9c6c3401524c0a4b5d37d65335e9124885305a (diff)
downloadchromium_src-68c477df6917633a7a9c64f8624446ca0bd895d5.zip
chromium_src-68c477df6917633a7a9c64f8624446ca0bd895d5.tar.gz
chromium_src-68c477df6917633a7a9c64f8624446ca0bd895d5.tar.bz2
Move more from Window onto Widget.
BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7054052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88356 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/panels/panel_browser_view.cc2
-rw-r--r--chrome/browser/ui/touch/tabs/touch_tab_strip.cc2
-rw-r--r--chrome/browser/ui/views/accessibility_event_router_views.cc7
-rw-r--r--chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc2
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc8
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc4
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h2
-rw-r--r--chrome/browser/ui/views/browser_actions_container.cc4
-rw-r--r--chrome/browser/ui/views/browser_bubble_gtk.cc2
-rw-r--r--chrome/browser/ui/views/browser_dialogs.h3
-rw-r--r--chrome/browser/ui/views/bubble/bubble.cc2
-rw-r--r--chrome/browser/ui/views/first_run_search_engine_view.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_frame.cc4
-rw-r--r--chrome/browser/ui/views/frame/browser_frame.h2
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc36
-rw-r--r--chrome/browser/ui/views/frame/browser_view.h2
-rw-r--r--chrome/browser/ui/views/hung_renderer_view.cc2
-rw-r--r--chrome/browser/ui/views/infobars/after_translate_infobar.cc2
-rw-r--r--chrome/browser/ui/views/infobars/before_translate_infobar.cc2
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.cc2
-rw-r--r--chrome/browser/ui/views/menu_item_view_test.cc2
-rw-r--r--chrome/browser/ui/views/profile_menu_button.cc2
-rw-r--r--chrome/browser/ui/views/tabs/base_tab_strip.cc4
-rw-r--r--chrome/browser/ui/views/tabs/dragged_tab_controller.cc8
-rw-r--r--chrome/browser/ui/views/tabs/tab_strip.cc2
-rw-r--r--chrome/browser/ui/views/task_manager_view.cc4
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc12
-rw-r--r--chrome/browser/ui/views/wrench_menu.cc2
28 files changed, 60 insertions, 68 deletions
diff --git a/chrome/browser/ui/panels/panel_browser_view.cc b/chrome/browser/ui/panels/panel_browser_view.cc
index 6834ff4..840f39f 100644
--- a/chrome/browser/ui/panels/panel_browser_view.cc
+++ b/chrome/browser/ui/panels/panel_browser_view.cc
@@ -40,7 +40,7 @@ void PanelBrowserView::Init() {
BrowserView::Init();
GetWidget()->SetAlwaysOnTop(true);
- GetWindow()->non_client_view()->SetAccessibleName(
+ GetWidget()->non_client_view()->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
}
diff --git a/chrome/browser/ui/touch/tabs/touch_tab_strip.cc b/chrome/browser/ui/touch/tabs/touch_tab_strip.cc
index f914ef9..e2cc8bc 100644
--- a/chrome/browser/ui/touch/tabs/touch_tab_strip.cc
+++ b/chrome/browser/ui/touch/tabs/touch_tab_strip.cc
@@ -304,7 +304,7 @@ void TouchTabStrip::PaintChildren(gfx::Canvas* canvas) {
}
}
- if (GetWindow()->ShouldUseNativeFrame()) {
+ if (GetWidget()->ShouldUseNativeFrame()) {
// Make sure unselected tabs are somewhat transparent.
SkPaint paint;
paint.setColor(SkColorSetARGB(200, 255, 255, 255));
diff --git a/chrome/browser/ui/views/accessibility_event_router_views.cc b/chrome/browser/ui/views/accessibility_event_router_views.cc
index 34fb85e..84ecf45 100644
--- a/chrome/browser/ui/views/accessibility_event_router_views.cc
+++ b/chrome/browser/ui/views/accessibility_event_router_views.cc
@@ -126,11 +126,10 @@ void AccessibilityEventRouterViews::DispatchAccessibilityNotification(
// the most recent profile where accessibility events were sent, or
// the default profile.
Profile* profile = NULL;
- views::Window* window = view->GetWindow();
- if (window) {
+ views::Widget* widget = view->GetWidget();
+ if (widget) {
profile = reinterpret_cast<Profile*>(
- window->AsWidget()->native_widget()->GetNativeWindowProperty(
- Profile::kProfileKey));
+ widget->native_widget()->GetNativeWindowProperty(Profile::kProfileKey));
}
if (!profile)
profile = most_recent_profile_;
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
index 9a411b7..510faf2 100644
--- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
+++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
@@ -704,7 +704,7 @@ void AutocompletePopupContentsView::UserPressedOptIn(bool opt_in) {
counter->Hide();
if (opt_in) {
browser::ShowInstantConfirmDialogIfNecessary(
- location_bar_->GetWindow()->GetNativeWindow(), model_->profile());
+ location_bar_->GetWidget()->GetNativeWindow(), model_->profile());
}
UpdatePopupAppearance();
}
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index d62e0a9..7f1ca1d 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -1061,7 +1061,7 @@ void BookmarkBarView::RunMenu(views::View* view, const gfx::Point& pt) {
}
bookmark_menu_ = new BookmarkMenuController(
- profile_, page_navigator_, GetWindow()->GetNativeWindow(), node,
+ profile_, page_navigator_, GetWidget()->GetNativeWindow(), node,
start_index);
bookmark_menu_->set_observer(this);
bookmark_menu_->RunMenuAt(this, false);
@@ -1095,7 +1095,7 @@ void BookmarkBarView::ButtonPressed(views::Button* sender,
page_navigator_->OpenURL(node->GetURL(), GURL(),
disposition_from_event_flags, PageTransition::AUTO_BOOKMARK);
} else {
- bookmark_utils::OpenAll(GetWindow()->GetNativeWindow(), profile_,
+ bookmark_utils::OpenAll(GetWidget()->GetNativeWindow(), profile_,
page_navigator_, node, disposition_from_event_flags);
}
UserMetrics::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton"));
@@ -1136,7 +1136,7 @@ void BookmarkBarView::ShowContextMenuForView(View* source,
bool close_on_remove =
(parent == profile_->GetBookmarkModel()->other_node() &&
parent->child_count() == 1);
- BookmarkContextMenu controller(GetWindow()->GetNativeWindow(), profile_,
+ BookmarkContextMenu controller(GetWidget()->GetNativeWindow(), profile_,
navigator, parent, nodes, close_on_remove);
controller.RunMenuAt(p);
}
@@ -1398,7 +1398,7 @@ void BookmarkBarView::ShowDropFolderForNode(const BookmarkNode* node) {
drop_info_->is_menu_showing = true;
bookmark_drop_menu_ = new BookmarkMenuController(
- profile_, page_navigator_, GetWindow()->GetNativeWindow(), node,
+ profile_, page_navigator_, GetWidget()->GetNativeWindow(), node,
start_index);
bookmark_drop_menu_->set_observer(this);
bookmark_drop_menu_->RunMenuAt(this, true);
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
index b1cc21b..736a2f1 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
@@ -54,7 +54,7 @@ static SkBitmap* kCloseImage = NULL;
namespace browser {
-void ShowBookmarkBubbleView(views::Window* parent,
+void ShowBookmarkBubbleView(views::Widget* parent,
const gfx::Rect& bounds,
BubbleDelegate* delegate,
Profile* profile,
@@ -79,7 +79,7 @@ bool IsBookmarkBubbleViewShowing() {
BookmarkBubbleView* BookmarkBubbleView::bookmark_bubble_ = NULL;
// static
-void BookmarkBubbleView::Show(views::Window* parent,
+void BookmarkBubbleView::Show(views::Widget* parent,
const gfx::Rect& bounds,
BubbleDelegate* delegate,
Profile* profile,
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
index 433b198..45417b2 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
@@ -36,7 +36,7 @@ class BookmarkBubbleView : public views::View,
public views::Combobox::Listener,
public BubbleDelegate {
public:
- static void Show(views::Window* window,
+ static void Show(views::Widget* widget,
const gfx::Rect& bounds,
BubbleDelegate* delegate,
Profile* profile,
diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc
index ebec34e..6be1732 100644
--- a/chrome/browser/ui/views/browser_actions_container.cc
+++ b/chrome/browser/ui/views/browser_actions_container.cc
@@ -710,7 +710,7 @@ void BrowserActionsContainer::RunMenu(View* source, const gfx::Point& pt) {
overflow_menu_ = new BrowserActionOverflowMenuController(
this, chevron_, browser_action_views_, VisibleBrowserActions());
overflow_menu_->set_observer(this);
- overflow_menu_->RunMenu(GetWindow()->GetNativeWindow(), false);
+ overflow_menu_->RunMenu(GetWidget()->GetNativeWindow(), false);
}
}
@@ -1023,7 +1023,7 @@ void BrowserActionsContainer::ShowDropFolder() {
overflow_menu_ = new BrowserActionOverflowMenuController(
this, chevron_, browser_action_views_, VisibleBrowserActions());
overflow_menu_->set_observer(this);
- overflow_menu_->RunMenu(GetWindow()->GetNativeWindow(), true);
+ overflow_menu_->RunMenu(GetWidget()->GetNativeWindow(), true);
}
void BrowserActionsContainer::SetDropIndicator(int x_pos) {
diff --git a/chrome/browser/ui/views/browser_bubble_gtk.cc b/chrome/browser/ui/views/browser_bubble_gtk.cc
index 37d7c9d..090eb99 100644
--- a/chrome/browser/ui/views/browser_bubble_gtk.cc
+++ b/chrome/browser/ui/views/browser_bubble_gtk.cc
@@ -95,7 +95,7 @@ void BrowserBubble::InitPopup(const gfx::Insets& content_margins) {
// TODO(port)
BubbleWidget* bubble_widget = new BubbleWidget(this, content_margins);
popup_ = bubble_widget->GetWidget();
- views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
+ views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
params.transparent = true;
params.parent = frame_->GetNativeView();
params.native_widget = bubble_widget;
diff --git a/chrome/browser/ui/views/browser_dialogs.h b/chrome/browser/ui/views/browser_dialogs.h
index fb6ae34..21dda5c 100644
--- a/chrome/browser/ui/views/browser_dialogs.h
+++ b/chrome/browser/ui/views/browser_dialogs.h
@@ -34,13 +34,14 @@ class Size;
}
namespace views {
+class Widget;
class Window;
}
namespace browser {
// Shows or hides the global bookmark bubble for the star button.
-void ShowBookmarkBubbleView(views::Window* parent,
+void ShowBookmarkBubbleView(views::Widget* parent,
const gfx::Rect& bounds,
BubbleDelegate* delegate,
Profile* profile,
diff --git a/chrome/browser/ui/views/bubble/bubble.cc b/chrome/browser/ui/views/bubble/bubble.cc
index df1a022..91d077b 100644
--- a/chrome/browser/ui/views/bubble/bubble.cc
+++ b/chrome/browser/ui/views/bubble/bubble.cc
@@ -134,7 +134,7 @@ Bubble::Bubble()
show_status_(kOpen),
fade_away_on_close_(false),
#if defined(TOOLKIT_USES_GTK)
- type_(views::Widget::InitParams::TYPE_WINDOW),
+ type_(views::Widget::InitParams::TYPE_POPUP),
#endif
#if defined(OS_CHROMEOS)
show_while_screen_is_locked_(false),
diff --git a/chrome/browser/ui/views/first_run_search_engine_view.cc b/chrome/browser/ui/views/first_run_search_engine_view.cc
index 56238b2..f554420 100644
--- a/chrome/browser/ui/views/first_run_search_engine_view.cc
+++ b/chrome/browser/ui/views/first_run_search_engine_view.cc
@@ -349,7 +349,7 @@ void FirstRunSearchEngineView::SetupControls() {
void FirstRunSearchEngineView::Layout() {
// Disable the close button.
- GetWindow()->EnableClose(false);
+ GetWidget()->EnableClose(false);
gfx::Size pref_size = background_image_->GetPreferredSize();
background_image_->SetBounds(0, 0, GetPreferredSize().width(),
diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc
index f50b539..1302436 100644
--- a/chrome/browser/ui/views/frame/browser_frame.cc
+++ b/chrome/browser/ui/views/frame/browser_frame.cc
@@ -124,7 +124,7 @@ ThemeProvider* BrowserFrame::GetThemeProvider() const {
browser_view_->browser()->profile());
}
-void BrowserFrame::OnNativeWindowActivationChanged(bool active) {
+void BrowserFrame::OnNativeWidgetActivationChanged(bool active) {
if (active) {
// When running under remote desktop, if the remote desktop client is not
// active on the users desktop, then none of the windows contained in the
@@ -134,6 +134,6 @@ void BrowserFrame::OnNativeWindowActivationChanged(bool active) {
// treated as such by the rest of Chrome.
BrowserList::SetLastActive(browser_view_->browser());
}
- Window::OnNativeWindowActivationChanged(active);
+ Window::OnNativeWidgetActivationChanged(active);
}
diff --git a/chrome/browser/ui/views/frame/browser_frame.h b/chrome/browser/ui/views/frame/browser_frame.h
index 5f661f4..2c5dc35 100644
--- a/chrome/browser/ui/views/frame/browser_frame.h
+++ b/chrome/browser/ui/views/frame/browser_frame.h
@@ -75,7 +75,7 @@ class BrowserFrame : public views::Window {
virtual bool GetAccelerator(int command_id,
ui::Accelerator* accelerator) OVERRIDE;
virtual ui::ThemeProvider* GetThemeProvider() const OVERRIDE;
- virtual void OnNativeWindowActivationChanged(bool active) OVERRIDE;
+ virtual void OnNativeWidgetActivationChanged(bool active) OVERRIDE;
private:
NativeBrowserFrame* native_browser_frame_;
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 260b954..55b9fca 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -254,8 +254,8 @@ class ResizeCorner : public views::View {
}
virtual void OnPaint(gfx::Canvas* canvas) {
- views::Window* window = GetWindow();
- if (!window || (window->IsMaximized() || window->IsFullscreen()))
+ views::Widget* widget = GetWidget();
+ if (!widget || (widget->IsMaximized() || widget->IsFullscreen()))
return;
SkBitmap* bitmap = ResourceBundle::GetSharedInstance().GetBitmapNamed(
@@ -274,8 +274,8 @@ class ResizeCorner : public views::View {
}
virtual gfx::Size GetPreferredSize() {
- views::Window* window = GetWindow();
- return (!window || window->IsMaximized() || window->IsFullscreen()) ?
+ views::Widget* widget = GetWidget();
+ return (!widget || widget->IsMaximized() || widget->IsFullscreen()) ?
gfx::Size() : GetSize();
}
@@ -291,13 +291,6 @@ class ResizeCorner : public views::View {
}
private:
- // Returns the NativeWindowWin we're displayed in. Returns NULL if we're not
- // currently in a window.
- views::Window* GetWindow() {
- views::Widget* widget = GetWidget();
- return widget ? widget->GetContainingWindow() : NULL;
- }
-
DISALLOW_COPY_AND_ASSIGN(ResizeCorner);
};
@@ -748,11 +741,11 @@ void BrowserView::SetStarredState(bool is_starred) {
}
gfx::Rect BrowserView::GetRestoredBounds() const {
- return frame_->GetNormalBounds();
+ return frame_->GetRestoredBounds();
}
gfx::Rect BrowserView::GetBounds() const {
- return frame_->GetBounds();
+ return frame_->GetWindowScreenBounds();
}
bool BrowserView::IsMaximized() const {
@@ -1001,7 +994,7 @@ void BrowserView::ConfirmSetDefaultSearchProvider(
void BrowserView::ConfirmAddSearchProvider(const TemplateURL* template_url,
Profile* profile) {
- browser::EditSearchEngine(GetWindow()->GetNativeWindow(), template_url, NULL,
+ browser::EditSearchEngine(GetWidget()->GetNativeWindow(), template_url, NULL,
profile);
}
@@ -1014,12 +1007,12 @@ void BrowserView::ShowAboutChromeDialog() {
}
views::Window* BrowserView::DoShowAboutChromeDialog() {
- return browser::ShowAboutChromeView(GetWindow()->GetNativeWindow(),
+ return browser::ShowAboutChromeView(GetWidget()->GetNativeWindow(),
browser_->profile());
}
void BrowserView::ShowUpdateChromeDialog() {
- UpdateRecommendedMessageBox::ShowMessageBox(GetWindow()->GetNativeWindow());
+ UpdateRecommendedMessageBox::ShowMessageBox(GetWidget()->GetNativeWindow());
}
void BrowserView::ShowCompactLocationBarUnderSelectedTab() {
@@ -1133,7 +1126,7 @@ void BrowserView::ShowPageInfo(Profile* profile,
const GURL& url,
const NavigationEntry::SSLStatus& ssl,
bool show_history) {
- gfx::NativeWindow parent = GetWindow()->GetNativeWindow();
+ gfx::NativeWindow parent = GetWidget()->GetNativeWindow();
browser::ShowPageInfoBubble(parent, profile, url, ssl, show_history);
}
@@ -1561,7 +1554,7 @@ bool BrowserView::ExecuteWindowsCommand(int command_id) {
// This function handles WM_SYSCOMMAND, WM_APPCOMMAND, and WM_COMMAND.
#if defined(OS_WIN)
if (command_id == IDC_DEBUG_FRAME_TOGGLE)
- GetWindow()->DebugToggleFrameType();
+ GetWidget()->DebugToggleFrameType();
#endif
// Translate WM_APPCOMMAND command ids into a command id that the browser
// knows how to handle.
@@ -1635,8 +1628,7 @@ views::View* BrowserView::GetContentsView() {
return contents_container_;
}
-views::ClientView* BrowserView::CreateClientView(views::Window* window) {
- set_window(window);
+views::ClientView* BrowserView::CreateClientView(views::Widget* widget) {
return this;
}
@@ -2568,7 +2560,7 @@ void BrowserView::ProcessTabSelected(TabContentsWrapper* new_contents,
// etc not result in sad tab.
new_contents->tab_contents()->DidBecomeSelected();
if (BrowserList::GetLastActive() == browser_ &&
- !browser_->tabstrip_model()->closing_all() && GetWindow()->IsVisible()) {
+ !browser_->tabstrip_model()->closing_all() && GetWidget()->IsVisible()) {
// We only restore focus if our window is visible, to avoid invoking blur
// handlers when we are eventually shown.
new_contents->view()->RestoreFocus();
@@ -2603,7 +2595,7 @@ BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
// so we don't need to do anything with the pointer.
BrowserView* view = new BrowserView(browser);
(new BrowserFrame(view))->InitBrowserFrame();
- view->GetWindow()->non_client_view()->SetAccessibleName(
+ view->GetWidget()->non_client_view()->SetAccessibleName(
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
return view;
}
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index 24b585e..f45afeb 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -394,7 +394,7 @@ class BrowserView : public BrowserBubbleHost,
virtual bool GetSavedWindowBounds(gfx::Rect* bounds) const OVERRIDE;
virtual bool GetSavedMaximizedState(bool* maximized) const OVERRIDE;
virtual views::View* GetContentsView() OVERRIDE;
- virtual views::ClientView* CreateClientView(views::Window* window) OVERRIDE;
+ virtual views::ClientView* CreateClientView(views::Widget* widget) OVERRIDE;
virtual void OnWindowActivationChanged(bool active) OVERRIDE;
virtual void OnWindowBeginUserBoundsChange() OVERRIDE;
virtual void OnWidgetMove() OVERRIDE;
diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc
index f1edc4e..652ec2b 100644
--- a/chrome/browser/ui/views/hung_renderer_view.cc
+++ b/chrome/browser/ui/views/hung_renderer_view.cc
@@ -447,7 +447,7 @@ gfx::Rect HungRendererDialogView::GetDisplayBounds(
RECT contents_bounds_rect;
GetWindowRect(contents_hwnd, &contents_bounds_rect);
gfx::Rect contents_bounds(contents_bounds_rect);
- gfx::Rect window_bounds = window()->GetBounds();
+ gfx::Rect window_bounds = window()->GetWindowScreenBounds();
int window_x = contents_bounds.x() +
(contents_bounds.width() - window_bounds.width()) / 2;
diff --git a/chrome/browser/ui/views/infobars/after_translate_infobar.cc b/chrome/browser/ui/views/infobars/after_translate_infobar.cc
index 5039615..2355093 100644
--- a/chrome/browser/ui/views/infobars/after_translate_infobar.cc
+++ b/chrome/browser/ui/views/infobars/after_translate_infobar.cc
@@ -178,6 +178,6 @@ void AfterTranslateInfoBar::RunMenu(View* source, const gfx::Point& pt) {
views::MenuModelAdapter menu_model_adapter(menu_model);
views::MenuItemView menu(&menu_model_adapter);
menu_model_adapter.BuildMenu(&menu);
- menu.RunMenuAt(source->GetWindow()->GetNativeWindow(), NULL,
+ menu.RunMenuAt(source->GetWidget()->GetNativeWindow(), NULL,
gfx::Rect(pt, gfx::Size()), views::MenuItemView::TOPRIGHT, true);
}
diff --git a/chrome/browser/ui/views/infobars/before_translate_infobar.cc b/chrome/browser/ui/views/infobars/before_translate_infobar.cc
index 88ca05d..4e89da5 100644
--- a/chrome/browser/ui/views/infobars/before_translate_infobar.cc
+++ b/chrome/browser/ui/views/infobars/before_translate_infobar.cc
@@ -199,6 +199,6 @@ void BeforeTranslateInfoBar::RunMenu(View* source, const gfx::Point& pt) {
views::MenuModelAdapter menu_model_adapter(menu_model);
views::MenuItemView menu(&menu_model_adapter);
menu_model_adapter.BuildMenu(&menu);
- menu.RunMenuAt(source->GetWindow()->GetNativeWindow(), NULL,
+ menu.RunMenuAt(source->GetWidget()->GetNativeWindow(), NULL,
gfx::Rect(pt, gfx::Size()), views::MenuItemView::TOPRIGHT, true);
}
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 8a29a25..d882873 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -394,7 +394,7 @@ void LocationBarView::ShowStarBubble(const GURL& url, bool newly_bookmarked) {
gfx::Point origin(screen_bounds.origin());
views::View::ConvertPointToScreen(star_view_, &origin);
screen_bounds.set_origin(origin);
- browser::ShowBookmarkBubbleView(GetWindow(), screen_bounds, star_view_,
+ browser::ShowBookmarkBubbleView(GetWidget(), screen_bounds, star_view_,
profile_, url, newly_bookmarked);
}
diff --git a/chrome/browser/ui/views/menu_item_view_test.cc b/chrome/browser/ui/views/menu_item_view_test.cc
index 33ce6b6..c3f27d3 100644
--- a/chrome/browser/ui/views/menu_item_view_test.cc
+++ b/chrome/browser/ui/views/menu_item_view_test.cc
@@ -68,7 +68,7 @@ class MenuItemViewTestBase : public ViewEventTestBase,
views::View::ConvertPointToScreen(source, &screen_location);
gfx::Rect bounds(screen_location, source->size());
menu_->RunMenuAt(
- source->GetWindow()->GetNativeWindow(),
+ source->GetWidget()->GetNativeWindow(),
button_,
bounds,
views::MenuItemView::TOPLEFT,
diff --git a/chrome/browser/ui/views/profile_menu_button.cc b/chrome/browser/ui/views/profile_menu_button.cc
index ae7a123..684226f 100644
--- a/chrome/browser/ui/views/profile_menu_button.cc
+++ b/chrome/browser/ui/views/profile_menu_button.cc
@@ -55,7 +55,7 @@ void ProfileMenuButton::RunMenu(views::View* source, const gfx::Point &pt) {
menu_model_adapter.BuildMenu(&menu);
gfx::Point menu_point(pt.x(), pt.y() + kMenuDisplayOffset);
- menu.RunMenuAt(source->GetWindow()->GetNativeWindow(), NULL,
+ menu.RunMenuAt(source->GetWidget()->GetNativeWindow(), NULL,
gfx::Rect(pt, gfx::Size(0, 0)),
views::MenuItemView::TOPRIGHT,
true);
diff --git a/chrome/browser/ui/views/tabs/base_tab_strip.cc b/chrome/browser/ui/views/tabs/base_tab_strip.cc
index 7b5c683..a6de3a9 100644
--- a/chrome/browser/ui/views/tabs/base_tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/base_tab_strip.cc
@@ -136,7 +136,7 @@ void BaseTabStrip::AddTabAt(int model_index, const TabRendererData& data) {
// Don't animate the first tab, it looks weird, and don't animate anything
// if the containing window isn't visible yet.
- if (tab_count() > 1 && GetWindow() && GetWindow()->IsVisible())
+ if (tab_count() > 1 && GetWidget() && GetWidget()->IsVisible())
StartInsertTabAnimation(model_index);
else
DoLayout();
@@ -160,7 +160,7 @@ void BaseTabStrip::SetTabData(int model_index, const TabRendererData& data) {
tab->SetData(data);
if (mini_state_changed) {
- if (GetWindow() && GetWindow()->IsVisible())
+ if (GetWidget() && GetWidget()->IsVisible())
StartMiniTabAnimation();
else
DoLayout();
diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc
index 88c5086..e42f8e8 100644
--- a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc
@@ -926,7 +926,7 @@ void DraggedTabController::Attach(BaseTabStrip* attached_tabstrip,
}
// Move the corresponding window to the front.
- attached_tabstrip_->GetWindow()->Activate();
+ attached_tabstrip_->GetWidget()->Activate();
}
void DraggedTabController::Detach() {
@@ -1275,8 +1275,8 @@ void DraggedTabController::CompleteDrag() {
}
}
// Compel the model to construct a new window for the detached TabContents.
- views::Window* window = source_tabstrip_->GetWindow();
- gfx::Rect window_bounds(window->GetNormalBounds());
+ views::Widget* widget = source_tabstrip_->GetWidget();
+ gfx::Rect window_bounds(widget->GetRestoredBounds());
window_bounds.set_origin(GetWindowCreatePoint());
// When modifying the following if statement, please make sure not to
// introduce issue listed in http://crbug.com/6223 comment #11.
@@ -1290,7 +1290,7 @@ void DraggedTabController::CompleteDrag() {
Browser* new_browser =
GetModel(source_tabstrip_)->delegate()->CreateNewStripWithContents(
drag_data_[0].contents, window_bounds, dock_info_,
- window->IsMaximized());
+ widget->IsMaximized());
TabStripModel* new_model = new_browser->tabstrip_model();
new_model->SetTabPinned(
new_model->GetIndexOfTabContents(drag_data_[0].contents),
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 990bcec..04f7362 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -299,7 +299,7 @@ void TabStrip::PaintChildren(gfx::Canvas* canvas) {
}
}
- if (GetWindow()->ShouldUseNativeFrame()) {
+ if (GetWidget()->ShouldUseNativeFrame()) {
bool multiple_tabs_selected = (!selected_tabs.empty() ||
tabs_dragging.size() > 1);
// Make sure non-active tabs are somewhat transparent.
diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc
index 91ab0ad..df8cbaf 100644
--- a/chrome/browser/ui/views/task_manager_view.cc
+++ b/chrome/browser/ui/views/task_manager_view.cc
@@ -613,7 +613,7 @@ bool TaskManagerView::ExecuteWindowsCommand(int command_id) {
is_always_on_top_ = !is_always_on_top_;
// Change the menu check state.
- HMENU system_menu = GetSystemMenu(GetWindow()->GetNativeWindow(), FALSE);
+ HMENU system_menu = GetSystemMenu(GetWidget()->GetNativeWindow(), FALSE);
MENUITEMINFO menu_info;
memset(&menu_info, 0, sizeof(MENUITEMINFO));
menu_info.cbSize = sizeof(MENUITEMINFO);
@@ -738,7 +738,7 @@ void TaskManagerView::AddAlwaysOnTopSystemMenuItem() {
UTF16ToWide(l10n_util::GetStringUTF16(IDS_ALWAYS_ON_TOP));
// Let's insert a menu to the window.
- HMENU system_menu = ::GetSystemMenu(GetWindow()->GetNativeWindow(), FALSE);
+ HMENU system_menu = ::GetSystemMenu(GetWidget()->GetNativeWindow(), FALSE);
int index = ::GetMenuItemCount(system_menu) - 1;
if (index < 0) {
// Paranoia check.
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 281993e..9721b0b 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -462,7 +462,7 @@ gfx::Size ToolbarView::GetPreferredSize() {
}
int vertical_spacing = PopupTopSpacing() +
- (GetWindow()->ShouldUseNativeFrame() ?
+ (GetWidget()->ShouldUseNativeFrame() ?
kPopupBottomSpacingGlass : kPopupBottomSpacingNonGlass);
return gfx::Size(0, location_bar_->GetPreferredSize().height() +
vertical_spacing);
@@ -562,7 +562,7 @@ void ToolbarView::OnPaint(gfx::Canvas* canvas) {
// it from the content area. For non-glass, the NonClientView draws the
// toolbar background below the location bar for us.
// NOTE: Keep this in sync with BrowserView::GetInfoBarSeparatorColor()!
- if (GetWindow()->ShouldUseNativeFrame())
+ if (GetWidget()->ShouldUseNativeFrame())
canvas->FillRectInt(SK_ColorBLACK, 0, height() - 1, width(), 1);
}
@@ -633,16 +633,16 @@ bool ToolbarView::ShouldShowIncompatibilityWarning() {
}
int ToolbarView::PopupTopSpacing() const {
- // TODO(beng): For some reason GetWindow() returns NULL here in some
+ // TODO(beng): For some reason GetWidget() returns NULL here in some
// unidentified circumstances on ChromeOS. This means GetWidget()
// succeeded but we were (probably) unable to locate a
// NativeWidgetGtk* on it using
// NativeWidget::GetNativeWidgetForNativeView.
// I am throwing in a NULL check for now to stop the hurt, but
// it's possible the crash may just show up somewhere else.
- const views::Window* window = GetWindow();
- DCHECK(window) << "If you hit this please talk to beng";
- return window && window->ShouldUseNativeFrame() ?
+ const views::Widget* widget = GetWidget();
+ DCHECK(widget) << "If you hit this please talk to beng";
+ return widget && widget->ShouldUseNativeFrame() ?
0 : kPopupTopSpacingNonGlass;
}
diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc
index 7af0292..7e7023a 100644
--- a/chrome/browser/ui/views/wrench_menu.cc
+++ b/chrome/browser/ui/views/wrench_menu.cc
@@ -602,7 +602,7 @@ void WrenchMenu::RunMenu(views::MenuButton* host) {
views::View::ConvertPointToScreen(host, &screen_loc);
gfx::Rect bounds(screen_loc, host->size());
UserMetrics::RecordAction(UserMetricsAction("ShowAppMenu"));
- root_->RunMenuAt(host->GetWindow()->GetNativeWindow(), host, bounds,
+ root_->RunMenuAt(host->GetWidget()->GetNativeWindow(), host, bounds,
MenuItemView::TOPRIGHT, true);
if (bookmark_menu_delegate_.get()) {
BookmarkModel* model = browser_->profile()->GetBookmarkModel();