| 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 "base/base_paths_linux.h" | 9 #include "base/base_paths_linux.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 toolbar_->AddToolbarToBox(content_vbox_); | 253 toolbar_->AddToolbarToBox(content_vbox_); |
| 254 | 254 |
| 255 bookmark_bar_.reset(new BookmarkBarGtk(browser_->profile(), browser_.get())); | 255 bookmark_bar_.reset(new BookmarkBarGtk(browser_->profile(), browser_.get())); |
| 256 bookmark_bar_->AddBookmarkbarToBox(content_vbox_); | 256 bookmark_bar_->AddBookmarkbarToBox(content_vbox_); |
| 257 | 257 |
| 258 infobar_container_.reset(new InfoBarContainerGtk(this)); | 258 infobar_container_.reset(new InfoBarContainerGtk(this)); |
| 259 gtk_box_pack_start(GTK_BOX(content_vbox_), | 259 gtk_box_pack_start(GTK_BOX(content_vbox_), |
| 260 infobar_container_->widget(), | 260 infobar_container_->widget(), |
| 261 FALSE, FALSE, 0); | 261 FALSE, FALSE, 0); |
| 262 | 262 |
| 263 // Insert a border between the toolbar and the web contents. | |
| 264 GtkWidget* border = gtk_event_box_new(); | |
| 265 gtk_widget_set_size_request(border, -1, 1); | |
| 266 gtk_widget_modify_bg(border, GTK_STATE_NORMAL, &kBorderColor); | |
| 267 gtk_box_pack_start(GTK_BOX(content_vbox_), border, FALSE, FALSE, 0); | |
| 268 gtk_widget_show(border); | |
| 269 | |
| 270 contents_container_.reset(new TabContentsContainerGtk()); | 263 contents_container_.reset(new TabContentsContainerGtk()); |
| 271 contents_container_->AddContainerToBox(content_vbox_); | 264 contents_container_->AddContainerToBox(content_vbox_); |
| 272 | 265 |
| 273 // Note that calling this the first time is necessary to get the | 266 // Note that calling this the first time is necessary to get the |
| 274 // proper control layout. | 267 // proper control layout. |
| 275 // TODO(port): make this a pref. | 268 // TODO(port): make this a pref. |
| 276 SetCustomFrame(false); | 269 SetCustomFrame(false); |
| 277 | 270 |
| 278 status_bubble_.reset(new StatusBubbleGtk(window_)); | 271 status_bubble_.reset(new StatusBubbleGtk(window_)); |
| 279 | 272 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 NotificationType::WINDOW_CLOSED, | 636 NotificationType::WINDOW_CLOSED, |
| 644 Source<GtkWindow>(window_), | 637 Source<GtkWindow>(window_), |
| 645 NotificationService::NoDetails()); | 638 NotificationService::NoDetails()); |
| 646 return true; | 639 return true; |
| 647 } | 640 } |
| 648 | 641 |
| 649 bool BrowserWindowGtk::ShouldShowWindowIcon() const { | 642 bool BrowserWindowGtk::ShouldShowWindowIcon() const { |
| 650 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); | 643 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); |
| 651 } | 644 } |
| 652 | 645 |
| 653 void BrowserWindowGtk::AddFindBar(GtkWidget* findbar) { | 646 void BrowserWindowGtk::AddFindBar(FindBarGtk* findbar) { |
| 654 contents_container_->AddFindBar(findbar); | 647 contents_container_->set_find_bar(findbar); |
| 648 gtk_box_pack_start(GTK_BOX(content_vbox_), findbar->widget(), |
| 649 FALSE, FALSE, 0); |
| 650 gtk_box_reorder_child(GTK_BOX(content_vbox_), findbar->widget(), 2); |
| 655 } | 651 } |
| 656 | 652 |
| 657 void BrowserWindowGtk::ConnectAccelerators() { | 653 void BrowserWindowGtk::ConnectAccelerators() { |
| 658 GtkAccelGroup* accel_group = gtk_accel_group_new(); | 654 GtkAccelGroup* accel_group = gtk_accel_group_new(); |
| 659 gtk_window_add_accel_group(window_, accel_group); | 655 gtk_window_add_accel_group(window_, accel_group); |
| 660 // Drop the initial ref on |accel_group| so |window_| will own it. | 656 // Drop the initial ref on |accel_group| so |window_| will own it. |
| 661 g_object_unref(accel_group); | 657 g_object_unref(accel_group); |
| 662 | 658 |
| 663 for (size_t i = 0; i < arraysize(kAcceleratorMap); ++i) { | 659 for (size_t i = 0; i < arraysize(kAcceleratorMap); ++i) { |
| 664 gtk_accel_group_connect( | 660 gtk_accel_group_connect( |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 } else { | 696 } else { |
| 701 browser_window->ExecuteBrowserCommand(command_id); | 697 browser_window->ExecuteBrowserCommand(command_id); |
| 702 } | 698 } |
| 703 | 699 |
| 704 return TRUE; | 700 return TRUE; |
| 705 } | 701 } |
| 706 | 702 |
| 707 void BrowserWindowGtk::ExecuteBrowserCommand(int id) { | 703 void BrowserWindowGtk::ExecuteBrowserCommand(int id) { |
| 708 browser_->ExecuteCommand(id); | 704 browser_->ExecuteCommand(id); |
| 709 } | 705 } |
| OLD | NEW |