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

Side by Side Diff: chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 (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/bookmarks/bookmark_bar_gtk.h" 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/pickle.h" 12 #include "base/pickle.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "chrome/browser/bookmarks/bookmark_model.h" 14 #include "chrome/browser/bookmarks/bookmark_model.h"
15 #include "chrome/browser/bookmarks/bookmark_node_data.h" 15 #include "chrome/browser/bookmarks/bookmark_node_data.h"
16 #include "chrome/browser/bookmarks/bookmark_utils.h" 16 #include "chrome/browser/bookmarks/bookmark_utils.h"
17 #include "chrome/browser/browser_shutdown.h" 17 #include "chrome/browser/browser_shutdown.h"
18 #include "chrome/browser/extensions/extension_service.h" 18 #include "chrome/browser/extensions/extension_service.h"
19 #include "chrome/browser/ntp_background_util.h" 19 #include "chrome/browser/ntp_background_util.h"
20 #include "chrome/browser/prefs/pref_service.h" 20 #include "chrome/browser/prefs/pref_service.h"
21 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/ui/browser.h" 22 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/browser_tabstrip.h"
23 #include "chrome/browser/ui/chrome_pages.h" 24 #include "chrome/browser/ui/chrome_pages.h"
24 #include "chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h" 25 #include "chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h"
25 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" 26 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h"
26 #include "chrome/browser/ui/gtk/browser_window_gtk.h" 27 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
27 #include "chrome/browser/ui/gtk/custom_button.h" 28 #include "chrome/browser/ui/gtk/custom_button.h"
28 #include "chrome/browser/ui/gtk/event_utils.h" 29 #include "chrome/browser/ui/gtk/event_utils.h"
29 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" 30 #include "chrome/browser/ui/gtk/gtk_chrome_button.h"
30 #include "chrome/browser/ui/gtk/gtk_theme_service.h" 31 #include "chrome/browser/ui/gtk/gtk_theme_service.h"
31 #include "chrome/browser/ui/gtk/gtk_util.h" 32 #include "chrome/browser/ui/gtk/gtk_util.h"
32 #include "chrome/browser/ui/gtk/hover_controller_gtk.h" 33 #include "chrome/browser/ui/gtk/hover_controller_gtk.h"
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 gtk_widget_queue_draw(event_box_.get()); 686 gtk_widget_queue_draw(event_box_.get());
686 } 687 }
687 } 688 }
688 689
689 bool BookmarkBarGtk::GetTabContentsSize(gfx::Size* size) { 690 bool BookmarkBarGtk::GetTabContentsSize(gfx::Size* size) {
690 Browser* browser = browser_; 691 Browser* browser = browser_;
691 if (!browser) { 692 if (!browser) {
692 NOTREACHED(); 693 NOTREACHED();
693 return false; 694 return false;
694 } 695 }
695 WebContents* web_contents = browser->GetActiveWebContents(); 696 WebContents* web_contents = chrome::GetActiveWebContents(browser);
696 if (!web_contents) { 697 if (!web_contents) {
697 // It is possible to have a browser but no WebContents while under testing, 698 // It is possible to have a browser but no WebContents while under testing,
698 // so don't NOTREACHED() and error the program. 699 // so don't NOTREACHED() and error the program.
699 return false; 700 return false;
700 } 701 }
701 if (!web_contents->GetView()) { 702 if (!web_contents->GetView()) {
702 NOTREACHED(); 703 NOTREACHED();
703 return false; 704 return false;
704 } 705 }
705 *size = web_contents->GetView()->GetContainerSize(); 706 *size = web_contents->GetView()->GetContainerSize();
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { 1460 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() {
1460 GtkDestDefaults dest_defaults = 1461 GtkDestDefaults dest_defaults =
1461 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : 1462 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL :
1462 GTK_DEST_DEFAULT_DROP; 1463 GTK_DEST_DEFAULT_DROP;
1463 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); 1464 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction);
1464 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, 1465 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults,
1465 NULL, 0, kDragAction); 1466 NULL, 0, kDragAction);
1466 ui::SetDestTargetList(overflow_button_, kDestTargetList); 1467 ui::SetDestTargetList(overflow_button_, kDestTargetList);
1467 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); 1468 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList);
1468 } 1469 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698