OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/gtk/browser_window_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 | 8 |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/base_paths_linux.h" | 10 #include "base/base_paths_linux.h" |
(...skipping 308 matching lines...) Loading... |
319 // The reason is that this area as a whole needs to be grouped in its own | 319 // The reason is that this area as a whole needs to be grouped in its own |
320 // GdkWindow hierarchy so that animations originating inside it (infobar, | 320 // GdkWindow hierarchy so that animations originating inside it (infobar, |
321 // download shelf, find bar) are all clipped to that area. This is why | 321 // download shelf, find bar) are all clipped to that area. This is why |
322 // |render_area_vbox_| is packed in |event_box|. | 322 // |render_area_vbox_| is packed in |event_box|. |
323 render_area_vbox_ = gtk_vbox_new(FALSE, 0); | 323 render_area_vbox_ = gtk_vbox_new(FALSE, 0); |
324 infobar_container_.reset(new InfoBarContainerGtk(this)); | 324 infobar_container_.reset(new InfoBarContainerGtk(this)); |
325 gtk_box_pack_start(GTK_BOX(render_area_vbox_), | 325 gtk_box_pack_start(GTK_BOX(render_area_vbox_), |
326 infobar_container_->widget(), | 326 infobar_container_->widget(), |
327 FALSE, FALSE, 0); | 327 FALSE, FALSE, 0); |
328 | 328 |
329 contents_container_.reset(new TabContentsContainerGtk()); | 329 status_bubble_.reset(new StatusBubbleGtk()); |
| 330 |
| 331 contents_container_.reset(new TabContentsContainerGtk(status_bubble_.get())); |
330 contents_container_->AddContainerToBox(render_area_vbox_); | 332 contents_container_->AddContainerToBox(render_area_vbox_); |
331 | 333 |
332 // Note that calling this the first time is necessary to get the | 334 // Note that calling this the first time is necessary to get the |
333 // proper control layout. | 335 // proper control layout. |
334 // TODO(port): make this a pref. | 336 // TODO(port): make this a pref. |
335 SetCustomFrame(false); | 337 SetCustomFrame(false); |
336 | 338 |
337 status_bubble_.reset(new StatusBubbleGtk(window_)); | |
338 | |
339 GtkWidget* event_box = gtk_event_box_new(); | 339 GtkWidget* event_box = gtk_event_box_new(); |
340 gtk_container_add(GTK_CONTAINER(event_box), render_area_vbox_); | 340 gtk_container_add(GTK_CONTAINER(event_box), render_area_vbox_); |
341 gtk_container_add(GTK_CONTAINER(content_vbox_), event_box); | 341 gtk_container_add(GTK_CONTAINER(content_vbox_), event_box); |
342 gtk_container_add(GTK_CONTAINER(window_vbox_), content_vbox_); | 342 gtk_container_add(GTK_CONTAINER(window_vbox_), content_vbox_); |
343 gtk_container_add(GTK_CONTAINER(window_), window_vbox_); | 343 gtk_container_add(GTK_CONTAINER(window_), window_vbox_); |
344 gtk_widget_show_all(window_vbox_); | 344 gtk_widget_show_all(window_vbox_); |
345 browser_->tabstrip_model()->AddObserver(this); | 345 browser_->tabstrip_model()->AddObserver(this); |
346 | 346 |
347 NotificationService* ns = NotificationService::current(); | 347 NotificationService* ns = NotificationService::current(); |
348 ns->AddObserver(this, NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, | 348 ns->AddObserver(this, NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, |
(...skipping 441 matching lines...) Loading... |
790 int command_id = GetCommandId(keyval, modifier); | 790 int command_id = GetCommandId(keyval, modifier); |
791 browser_window->ExecuteBrowserCommand(command_id); | 791 browser_window->ExecuteBrowserCommand(command_id); |
792 | 792 |
793 return TRUE; | 793 return TRUE; |
794 } | 794 } |
795 | 795 |
796 void BrowserWindowGtk::ExecuteBrowserCommand(int id) { | 796 void BrowserWindowGtk::ExecuteBrowserCommand(int id) { |
797 if (browser_->command_updater()->IsCommandEnabled(id)) | 797 if (browser_->command_updater()->IsCommandEnabled(id)) |
798 browser_->ExecuteCommand(id); | 798 browser_->ExecuteCommand(id); |
799 } | 799 } |
OLD | NEW |