diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 17:15:22 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 17:15:22 +0000 |
commit | 5275c3dbc87f48da96a2880c2ac12e956c18784c (patch) | |
tree | 1c1a15bba4f850e55fcc444ba5f53a488082a97d /views | |
parent | c6f26b5d3fb527d4731b08553fd2ba8272df550f (diff) | |
download | chromium_src-5275c3dbc87f48da96a2880c2ac12e956c18784c.zip chromium_src-5275c3dbc87f48da96a2880c2ac12e956c18784c.tar.gz chromium_src-5275c3dbc87f48da96a2880c2ac12e956c18784c.tar.bz2 |
Do work necessary to make Views About panel work on Chrome OS. This is to be used for forcing Chrome OS updates.
There were many things that needed to be fixed for this to work.
Make skia's canvas return height of font for size of strings, instead of the actual height of the characters to bring it in line with Windows.
Make average character widths use pango metrics and windows dialog units. Make this lazy, to avoid most calls.
Fix bug in About panel that failed to adjust the embedded links to allow for the padding that Link adds so they can be focused.
Support gtk about panel in regular build, views in chrome os only.
Fix WindowGtk to call WindowClosing()
Fix canvas_linux::SetupPangoLayout() to wrap correctly, if passed a width
Fix Label::ComputeMultiLineFlags() to turn off eliding. With eliding the pango routines always return 1 line.
Enable focus manager in dialogs.
Version loader crashed in debug.
Review URL: http://codereview.chromium.org/282002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29414 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/label.cc | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | views/window/dialog_client_view.cc | 8 | ||||
-rw-r--r-- | views/window/window_gtk.cc | 5 | ||||
-rw-r--r-- | views/window/window_gtk.h | 2 |
4 files changed, 15 insertions, 8 deletions
diff --git a/views/controls/label.cc b/views/controls/label.cc index 6e9a360..6da6c48 100644 --- a/views/controls/label.cc +++ b/views/controls/label.cc @@ -100,6 +100,14 @@ gfx::Size Label::GetPreferredSize() { int Label::ComputeMultiLineFlags() { int flags = gfx::Canvas::MULTI_LINE; + #if !defined(OS_WIN) + // Don't ellide multiline labels on Linux. + // Todo(davemoore): Do we depend on elliding multiline text? + // Pango insists on limiting the number of lines to one if text is + // ellided. You can get around this if you can pass a maximum height + // but we don't currently have that data when we call the pango code. + flags |= gfx::Canvas::NO_ELLIPSIS; + #endif if (allow_character_break_) flags |= gfx::Canvas::CHARACTER_BREAK; switch (horiz_alignment_) { diff --git a/views/window/dialog_client_view.cc b/views/window/dialog_client_view.cc index 40355d4..64c4677 100644..100755 --- a/views/window/dialog_client_view.cc +++ b/views/window/dialog_client_view.cc @@ -251,14 +251,10 @@ bool DialogClientView::CanClose() const { } void DialogClientView::WindowClosing() { -#if defined(OS_WIN) FocusManager* focus_manager = GetFocusManager(); DCHECK(focus_manager); if (focus_manager) focus_manager->RemoveFocusChangeListener(this); -#else - NOTIMPLEMENTED(); -#endif ClientView::WindowClosing(); } @@ -306,16 +302,12 @@ void DialogClientView::ViewHierarchyChanged(bool is_add, View* parent, ShowDialogButtons(); ClientView::ViewHierarchyChanged(is_add, parent, child); -#if defined(OS_WIN) FocusManager* focus_manager = GetFocusManager(); // Listen for focus change events so we can update the default button. DCHECK(focus_manager); // bug #1291225: crash reports seem to indicate it // can be NULL. if (focus_manager) focus_manager->AddFocusChangeListener(this); -#else - NOTIMPLEMENTED(); -#endif // The "extra view" must be created and installed after the contents view // has been inserted into the view hierarchy. diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc index a3a3192..c17df87 100644 --- a/views/window/window_gtk.cc +++ b/views/window/window_gtk.cc @@ -451,4 +451,9 @@ void WindowGtk::SizeWindowToDefault(GtkWindow* parent) { SetBounds(bounds, NULL); } +void WindowGtk::OnDestroy() { + non_client_view_->WindowClosing(); + WidgetGtk::OnDestroy(); +} + } // namespace views diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h index f7fffc7..7829e28 100644 --- a/views/window/window_gtk.h +++ b/views/window/window_gtk.h @@ -78,6 +78,8 @@ class WindowGtk : public WidgetGtk, public Window { // Initializes the window to the passed in bounds. void Init(GtkWindow* parent, const gfx::Rect& bounds); + virtual void OnDestroy(); + private: static gboolean CallConfigureEvent(GtkWidget* widget, GdkEventConfigure* event, |