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

Unified Diff: ui/views/widget/widget_delegate.cc

Issue 1159033008: Refactor ViewsDelegate singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 5 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
Index: ui/views/widget/widget_delegate.cc
diff --git a/ui/views/widget/widget_delegate.cc b/ui/views/widget/widget_delegate.cc
index f37c4368a765e7e4c12bcaaa10669aca1fa05f74..e62aa92847e67feb742e9451dda687b6fd920ac3 100644
--- a/ui/views/widget/widget_delegate.cc
+++ b/ui/views/widget/widget_delegate.cc
@@ -116,11 +116,11 @@ std::string WidgetDelegate::GetWindowName() const {
void WidgetDelegate::SaveWindowPlacement(const gfx::Rect& bounds,
ui::WindowShowState show_state) {
std::string window_name = GetWindowName();
- if (!ViewsDelegate::views_delegate || window_name.empty())
+ if (!ViewsDelegate::GetInstance() || window_name.empty())
return;
- ViewsDelegate::views_delegate->SaveWindowPlacement(
- GetWidget(), window_name, bounds, show_state);
+ ViewsDelegate::GetInstance()->SaveWindowPlacement(GetWidget(), window_name,
+ bounds, show_state);
}
bool WidgetDelegate::GetSavedWindowPlacement(
@@ -128,10 +128,10 @@ bool WidgetDelegate::GetSavedWindowPlacement(
gfx::Rect* bounds,
ui::WindowShowState* show_state) const {
std::string window_name = GetWindowName();
- if (!ViewsDelegate::views_delegate || window_name.empty())
+ if (!ViewsDelegate::GetInstance() || window_name.empty())
return false;
- return ViewsDelegate::views_delegate->GetSavedWindowPlacement(
+ return ViewsDelegate::GetInstance()->GetSavedWindowPlacement(
widget, window_name, bounds, show_state);
}

Powered by Google App Engine
This is Rietveld 408576698