OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/gtk/constrained_window_gtk.h" | 5 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // until this tab is refocused. | 112 // until this tab is refocused. |
113 if (gtk_util::IsWidgetAncestryVisible(focus_widget)) | 113 if (gtk_util::IsWidgetAncestryVisible(focus_widget)) |
114 gtk_widget_grab_focus(focus_widget); | 114 gtk_widget_grab_focus(focus_widget); |
115 else | 115 else |
116 ContainingView()->focus_store()->SetWidget(focus_widget); | 116 ContainingView()->focus_store()->SetWidget(focus_widget); |
117 } | 117 } |
118 | 118 |
119 void ConstrainedWindowGtk::PulseWebContentsModalDialog() { | 119 void ConstrainedWindowGtk::PulseWebContentsModalDialog() { |
120 } | 120 } |
121 | 121 |
122 gfx::NativeWindow ConstrainedWindowGtk::GetNativeWindow() { | 122 gfx::NativeView ConstrainedWindowGtk::GetNativeView() { |
123 return GTK_WINDOW(gtk_widget_get_toplevel(widget())); | 123 return widget(); |
124 } | 124 } |
125 | 125 |
126 void ConstrainedWindowGtk::BackgroundColorChanged() { | 126 void ConstrainedWindowGtk::BackgroundColorChanged() { |
127 GdkColor background; | 127 GdkColor background; |
128 if (delegate_->GetBackgroundColor(&background)) { | 128 if (delegate_->GetBackgroundColor(&background)) { |
129 gtk_widget_modify_base(border_.get(), GTK_STATE_NORMAL, &background); | 129 gtk_widget_modify_base(border_.get(), GTK_STATE_NORMAL, &background); |
130 gtk_widget_modify_fg(border_.get(), GTK_STATE_NORMAL, &background); | 130 gtk_widget_modify_fg(border_.get(), GTK_STATE_NORMAL, &background); |
131 gtk_widget_modify_bg(border_.get(), GTK_STATE_NORMAL, &background); | 131 gtk_widget_modify_bg(border_.get(), GTK_STATE_NORMAL, &background); |
132 } | 132 } |
133 } | 133 } |
(...skipping 19 matching lines...) Expand all Loading... |
153 } | 153 } |
154 | 154 |
155 void ConstrainedWindowGtk::OnHierarchyChanged(GtkWidget* sender, | 155 void ConstrainedWindowGtk::OnHierarchyChanged(GtkWidget* sender, |
156 GtkWidget* previous_toplevel) { | 156 GtkWidget* previous_toplevel) { |
157 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 157 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
158 if (!gtk_widget_is_toplevel(gtk_widget_get_toplevel(widget()))) | 158 if (!gtk_widget_is_toplevel(gtk_widget_get_toplevel(widget()))) |
159 return; | 159 return; |
160 | 160 |
161 FocusWebContentsModalDialog(); | 161 FocusWebContentsModalDialog(); |
162 } | 162 } |
OLD | NEW |