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

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

Issue 10827045: Removing instances of profile_->GetBookmarkModel() as part of converting BookmarkModel to a PKS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_model_factory.h"
15 #include "chrome/browser/bookmarks/bookmark_node_data.h" 16 #include "chrome/browser/bookmarks/bookmark_node_data.h"
16 #include "chrome/browser/bookmarks/bookmark_utils.h" 17 #include "chrome/browser/bookmarks/bookmark_utils.h"
17 #include "chrome/browser/browser_shutdown.h" 18 #include "chrome/browser/browser_shutdown.h"
18 #include "chrome/browser/extensions/extension_service.h" 19 #include "chrome/browser/extensions/extension_service.h"
19 #include "chrome/browser/ntp_background_util.h" 20 #include "chrome/browser/ntp_background_util.h"
20 #include "chrome/browser/prefs/pref_service.h" 21 #include "chrome/browser/prefs/pref_service.h"
21 #include "chrome/browser/profiles/profile.h" 22 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/ui/browser.h" 23 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/browser_tabstrip.h" 24 #include "chrome/browser/ui/browser_tabstrip.h"
24 #include "chrome/browser/ui/chrome_pages.h" 25 #include "chrome/browser/ui/chrome_pages.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 gtk_widget_set_size_request(event_box_.get(), -1, kBookmarkBarMinimumHeight); 275 gtk_widget_set_size_request(event_box_.get(), -1, kBookmarkBarMinimumHeight);
275 276
276 ViewIDUtil::SetID(other_bookmarks_button_, VIEW_ID_OTHER_BOOKMARKS); 277 ViewIDUtil::SetID(other_bookmarks_button_, VIEW_ID_OTHER_BOOKMARKS);
277 ViewIDUtil::SetID(widget(), VIEW_ID_BOOKMARK_BAR); 278 ViewIDUtil::SetID(widget(), VIEW_ID_BOOKMARK_BAR);
278 279
279 gtk_widget_show_all(widget()); 280 gtk_widget_show_all(widget());
280 gtk_widget_hide(widget()); 281 gtk_widget_hide(widget());
281 282
282 AddCoreButtons(); 283 AddCoreButtons();
283 // TODO(erg): Handle extensions 284 // TODO(erg): Handle extensions
284 model_ = profile->GetBookmarkModel(); 285 model_ = BookmarkModelFactory::GetForProfile(profile);
285 model_->AddObserver(this); 286 model_->AddObserver(this);
286 if (model_->IsLoaded()) 287 if (model_->IsLoaded())
287 Loaded(model_, false); 288 Loaded(model_, false);
288 // else case: we'll receive notification back from the BookmarkModel when done 289 // else case: we'll receive notification back from the BookmarkModel when done
289 // loading, then we'll populate the bar. 290 // loading, then we'll populate the bar.
290 } 291 }
291 292
292 void BookmarkBarGtk::SetBookmarkBarState( 293 void BookmarkBarGtk::SetBookmarkBarState(
293 BookmarkBar::State state, 294 BookmarkBar::State state,
294 BookmarkBar::AnimateChangeType animate_type) { 295 BookmarkBar::AnimateChangeType animate_type) {
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { 1462 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() {
1462 GtkDestDefaults dest_defaults = 1463 GtkDestDefaults dest_defaults =
1463 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : 1464 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL :
1464 GTK_DEST_DEFAULT_DROP; 1465 GTK_DEST_DEFAULT_DROP;
1465 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); 1466 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction);
1466 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, 1467 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults,
1467 NULL, 0, kDragAction); 1468 NULL, 0, kDragAction);
1468 ui::SetDestTargetList(overflow_button_, kDestTargetList); 1469 ui::SetDestTargetList(overflow_button_, kDestTargetList);
1469 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); 1470 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList);
1470 } 1471 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698