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

Unified Diff: chrome/browser/cocoa/browser_window_cocoa.mm

Issue 3228003: Sidebar view, implementation for Mac. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/browser_window_cocoa.h ('k') | chrome/browser/cocoa/browser_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_cocoa.mm
===================================================================
--- chrome/browser/cocoa/browser_window_cocoa.mm (revision 57723)
+++ chrome/browser/cocoa/browser_window_cocoa.mm (working copy)
@@ -37,6 +37,8 @@
#include "chrome/browser/global_keyboard_shortcuts_mac.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/sidebar/sidebar_container.h"
+#include "chrome/browser/sidebar/sidebar_manager.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/native_web_keyboard_event.h"
@@ -55,6 +57,8 @@
// This pref applies to all windows, so all must watch for it.
registrar_.Add(this, NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
NotificationService::AllSources());
+ registrar_.Add(this, NotificationType::SIDEBAR_CHANGED,
+ NotificationService::AllSources());
}
BrowserWindowCocoa::~BrowserWindowCocoa() {
@@ -569,6 +573,10 @@
case NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED:
[controller_ updateBookmarkBarVisibilityWithAnimation:YES];
break;
+ case NotificationType::SIDEBAR_CHANGED:
+ UpdateSidebarForContents(
+ Details<SidebarContainer>(details)->tab_contents());
+ break;
default:
NOTREACHED(); // we don't ask for anything else!
break;
@@ -585,3 +593,9 @@
NSWindow* BrowserWindowCocoa::window() const {
return [controller_ window];
}
+
+void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) {
+ if (tab_contents == browser_->tabstrip_model()->GetSelectedTabContents()) {
+ [controller_ updateSidebarForContents:tab_contents];
+ }
+}
« no previous file with comments | « chrome/browser/cocoa/browser_window_cocoa.h ('k') | chrome/browser/cocoa/browser_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698