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

Side by Side Diff: ash/accelerators/exit_warning_handler.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/accelerators/exit_warning_handler.h" 5 #include "ash/accelerators/exit_warning_handler.h"
6 6
7 #include "ash/metrics/user_metrics_recorder.h" 7 #include "ash/metrics/user_metrics_recorder.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_delegate.h" 9 #include "ash/shell_delegate.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 label->SetText(text_); 75 label->SetText(text_);
76 label->SetHorizontalAlignment(gfx::ALIGN_CENTER); 76 label->SetHorizontalAlignment(gfx::ALIGN_CENTER);
77 label->SetFontList(font_list); 77 label->SetFontList(font_list);
78 label->SetEnabledColor(kTextColor); 78 label->SetEnabledColor(kTextColor);
79 label->SetDisabledColor(kTextColor); 79 label->SetDisabledColor(kTextColor);
80 label->SetAutoColorReadabilityEnabled(false); 80 label->SetAutoColorReadabilityEnabled(false);
81 AddChildView(label); 81 AddChildView(label);
82 SetLayoutManager(new views::FillLayout); 82 SetLayoutManager(new views::FillLayout);
83 } 83 }
84 84
85 virtual gfx::Size GetPreferredSize() OVERRIDE { 85 virtual gfx::Size GetPreferredSize() const OVERRIDE {
86 return gfx::Size(width_, height_); 86 return gfx::Size(width_, height_);
87 } 87 }
88 88
89 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { 89 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
90 SkPaint paint; 90 SkPaint paint;
91 paint.setStyle(SkPaint::kFill_Style); 91 paint.setStyle(SkPaint::kFill_Style);
92 paint.setColor(kWindowBackgroundColor); 92 paint.setColor(kWindowBackgroundColor);
93 canvas->DrawRoundRect(GetLocalBounds(), kWindowCornerRadius, paint); 93 canvas->DrawRoundRect(GetLocalBounds(), kWindowCornerRadius, paint);
94 views::WidgetDelegateView::OnPaint(canvas); 94 views::WidgetDelegateView::OnPaint(canvas);
95 } 95 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 widget_->Show(); 195 widget_->Show();
196 196
197 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 197 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
198 } 198 }
199 199
200 void ExitWarningHandler::Hide() { 200 void ExitWarningHandler::Hide() {
201 widget_.reset(); 201 widget_.reset();
202 } 202 }
203 203
204 } // namespace ash 204 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698