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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 7054052: Move more from Window onto Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/hung_renderer_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_view.cc
===================================================================
--- chrome/browser/ui/views/frame/browser_view.cc (revision 88218)
+++ chrome/browser/ui/views/frame/browser_view.cc (working copy)
@@ -254,8 +254,8 @@
}
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 @@
}
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 @@
}
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 @@
}
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 {
@@ -999,7 +992,7 @@
void BrowserView::ConfirmAddSearchProvider(const TemplateURL* template_url,
Profile* profile) {
- browser::EditSearchEngine(GetWindow()->GetNativeWindow(), template_url, NULL,
+ browser::EditSearchEngine(GetWidget()->GetNativeWindow(), template_url, NULL,
profile);
}
@@ -1012,12 +1005,12 @@
}
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() {
@@ -1131,7 +1124,7 @@
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);
}
@@ -1559,7 +1552,7 @@
// 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.
@@ -1633,8 +1626,7 @@
return contents_container_;
}
-views::ClientView* BrowserView::CreateClientView(views::Window* window) {
- set_window(window);
+views::ClientView* BrowserView::CreateClientView(views::Widget* widget) {
return this;
}
@@ -2566,7 +2558,7 @@
// 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();
@@ -2601,7 +2593,7 @@
// 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;
}
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/hung_renderer_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698