diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-05 21:04:46 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-05 21:04:46 +0000 |
commit | 7d886d12386ee44f2afd10ec47304135d0c4192b (patch) | |
tree | d06e04d969e3c148058c257522f7360ae26d056b | |
parent | 1ed7e00c6e9d9b757117ca51c652a5460b5b8d66 (diff) | |
download | chromium_src-7d886d12386ee44f2afd10ec47304135d0c4192b.zip chromium_src-7d886d12386ee44f2afd10ec47304135d0c4192b.tar.gz chromium_src-7d886d12386ee44f2afd10ec47304135d0c4192b.tar.bz2 |
Hook up tab close menu item and plumb tab closing scaffolding through UI layer on Mac. Fix several unregistered prefs issues from other checkins.
Review URL: http://codereview.chromium.org/21092
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9250 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/nibs/English.lproj/MainMenu.xib | 51 | ||||
-rw-r--r-- | chrome/browser/browser_prefs.cc | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 5 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.cc | 27 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.h | 43 |
5 files changed, 100 insertions, 28 deletions
diff --git a/chrome/app/nibs/English.lproj/MainMenu.xib b/chrome/app/nibs/English.lproj/MainMenu.xib index 53e0eb1..e191c9a 100644 --- a/chrome/app/nibs/English.lproj/MainMenu.xib +++ b/chrome/app/nibs/English.lproj/MainMenu.xib @@ -8,7 +8,7 @@ <string key="IBDocument.HIToolboxVersion">353.00</string> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="449"/> + <integer value="450"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -294,8 +294,7 @@ <object class="NSMenuItem" id="776162233"> <reference key="NSMenu" ref="720053764"/> <string key="NSTitle">Close Window</string> - <string key="NSKeyEquiv">w</string> - <int key="NSKeyEquivModMask">1048576</int> + <string key="NSKeyEquiv"/> <int key="NSMnemonicLoc">2147483647</int> <reference key="NSOnImage" ref="353210768"/> <reference key="NSMixedImage" ref="549394948"/> @@ -303,10 +302,12 @@ <object class="NSMenuItem" id="1059729334"> <reference key="NSMenu" ref="720053764"/> <string key="NSTitle">Close Tab</string> - <string key="NSKeyEquiv"/> + <string key="NSKeyEquiv">w</string> + <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> <reference key="NSOnImage" ref="353210768"/> <reference key="NSMixedImage" ref="549394948"/> + <int key="NSTag">34015</int> </object> <object class="NSMenuItem" id="117038363"> <reference key="NSMenu" ref="720053764"/> @@ -968,23 +969,25 @@ <reference key="NSOnImage" ref="353210768"/> <reference key="NSMixedImage" ref="549394948"/> </object> - <object class="NSMenuItem" id="567028653"> + <object class="NSMenuItem" id="1051826322"> <reference key="NSMenu" ref="835318025"/> - <string key="NSTitle">Previous Tab</string> - <string type="base64-UTF8" key="NSKeyEquiv">75yCA</string> + <string key="NSTitle">Next Tab</string> + <string type="base64-UTF8" key="NSKeyEquiv">75yDA</string> <int key="NSKeyEquivModMask">1572864</int> <int key="NSMnemonicLoc">2147483647</int> <reference key="NSOnImage" ref="353210768"/> <reference key="NSMixedImage" ref="549394948"/> + <int key="NSTag">34016</int> </object> - <object class="NSMenuItem" id="1051826322"> + <object class="NSMenuItem" id="567028653"> <reference key="NSMenu" ref="835318025"/> - <string key="NSTitle">Next Tab</string> - <string type="base64-UTF8" key="NSKeyEquiv">75yDA</string> + <string key="NSTitle">Previous Tab</string> + <string type="base64-UTF8" key="NSKeyEquiv">75yCA</string> <int key="NSKeyEquivModMask">1572864</int> <int key="NSMnemonicLoc">2147483647</int> <reference key="NSOnImage" ref="353210768"/> <reference key="NSMixedImage" ref="549394948"/> + <int key="NSTag">34017</int> </object> <object class="NSMenuItem" id="299356726"> <reference key="NSMenu" ref="835318025"/> @@ -1372,6 +1375,30 @@ </object> <int key="connectionID">527</int> </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">commandDispatch:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="1059729334"/> + </object> + <int key="connectionID">528</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">commandDispatch:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="1051826322"/> + </object> + <int key="connectionID">529</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">commandDispatch:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="567028653"/> + </object> + <int key="connectionID">530</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -1811,8 +1838,8 @@ <reference ref="1011231497"/> <reference ref="672237550"/> <reference ref="567028653"/> - <reference ref="1051826322"/> <reference ref="134665466"/> + <reference ref="1051826322"/> </object> <reference key="parent" ref="713487014"/> </object> @@ -2687,7 +2714,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">527</int> + <int key="maxID">530</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> diff --git a/chrome/browser/browser_prefs.cc b/chrome/browser/browser_prefs.cc index 4d0ee04..445130c 100644 --- a/chrome/browser/browser_prefs.cc +++ b/chrome/browser/browser_prefs.cc @@ -39,6 +39,7 @@ void RegisterAllPrefs(PrefService* user_prefs, PrefService* local_state) { Browser::RegisterPrefs(local_state); BrowserRenderProcessHost::RegisterPrefs(local_state); CacheManagerHost::RegisterPrefs(local_state); + SafeBrowsingService::RegisterPrefs(local_state); #if defined(OS_WIN) // TODO(port): whittle this down as we port BookmarkManagerView::RegisterPrefs(local_state); BrowserView::RegisterBrowserViewPrefs(local_state); @@ -49,7 +50,6 @@ void RegisterAllPrefs(PrefService* user_prefs, PrefService* local_state) { PageInfoWindow::RegisterPrefs(local_state); TaskManager::RegisterPrefs(local_state); ExternalProtocolHandler::RegisterPrefs(local_state); - SafeBrowsingService::RegisterPrefs(local_state); #endif // User prefs diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index cc491ff..e7d88c4 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -257,9 +257,11 @@ void TabStripBridge::TabInsertedAt(TabContents* contents, } void TabStripBridge::TabClosingAt(TabContents* contents, int index) { + NOTIMPLEMENTED(); } void TabStripBridge::TabDetachedAt(TabContents* contents, int index) { + NOTIMPLEMENTED(); } void TabStripBridge::TabSelectedAt(TabContents* old_contents, @@ -275,10 +277,13 @@ void TabStripBridge::TabSelectedAt(TabContents* old_contents, void TabStripBridge::TabMoved(TabContents* contents, int from_index, int to_index) { + NOTIMPLEMENTED(); } void TabStripBridge::TabChangedAt(TabContents* contents, int index) { + NOTIMPLEMENTED(); } void TabStripBridge::TabStripEmpty() { + NOTIMPLEMENTED(); } diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc index d652dee..d050cb7 100644 --- a/chrome/common/temp_scaffolding_stubs.cc +++ b/chrome/common/temp_scaffolding_stubs.cc @@ -184,6 +184,33 @@ Profile* TabContents::profile() const { return controller_ ? controller_->profile() : NULL; } +void TabContents::CloseContents() { + // Destroy our NavigationController, which will Destroy all tabs it owns. + controller_->Destroy(); + // Note that the controller may have deleted us at this point, + // so don't touch any member variables here. +} + +void TabContents::Destroy() { + // TODO(pinkerton): this isn't the real version of Destroy(), just enough to + // get the scaffolding working. + + // Notify any observer that have a reference on this tab contents. + NotificationService::current()->Notify( + NotificationType::TAB_CONTENTS_DESTROYED, + Source<TabContents>(this), + NotificationService::NoDetails()); + + // Notify our NavigationController. Make sure we are deleted first, so + // that the controller is the last to die. + NavigationController* controller = controller_; + TabContentsType type = this->type(); + + delete this; + + controller->TabContentsWasDestroyed(type); +} + //-------------------------------------------------------------------------- class RenderWidgetHostViewStub : public RenderWidgetHostView { diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index 657b2b7..ca0fbf6 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -570,20 +570,33 @@ class ConfirmInfoBarDelegate : public InfoBarDelegate { class RenderWidgetHostView { public: - virtual void DidBecomeSelected() { NOTIMPLEMENTED(); } - virtual void WasHidden() { NOTIMPLEMENTED(); } - virtual gfx::NativeView GetPluginNativeView() { - NOTIMPLEMENTED(); + virtual RenderWidgetHost* GetRenderWidgetHost() const { + NOTIMPLEMENTED(); return NULL; } - virtual void Hide() { NOTIMPLEMENTED(); } - virtual void Show() { NOTIMPLEMENTED(); } - virtual bool HasFocus() { NOTIMPLEMENTED(); return false; } + virtual void DidBecomeSelected() { NOTIMPLEMENTED(); } + virtual void WasHidden() { NOTIMPLEMENTED(); } + virtual void SetSize(const gfx::Size&) { NOTIMPLEMENTED(); } + virtual gfx::NativeView GetPluginNativeView() + { NOTIMPLEMENTED(); return NULL; }; + virtual void MovePluginWindows(const std::vector<WebPluginGeometry>&) + { NOTIMPLEMENTED(); } virtual void Focus() { NOTIMPLEMENTED(); } + virtual void Blur() { NOTIMPLEMENTED(); } + virtual bool HasFocus() { NOTIMPLEMENTED(); return false; } + virtual void Show() { NOTIMPLEMENTED(); } + virtual void Hide() { NOTIMPLEMENTED(); } + virtual gfx::Rect GetViewBounds() const + { NOTIMPLEMENTED(); return gfx::Rect(); } + virtual void UpdateCursor(const WebCursor&) { NOTIMPLEMENTED(); } virtual void UpdateCursorIfOverSelf() { NOTIMPLEMENTED(); } - virtual void SetTooltipText(const std::wstring& tooltip_text) - { NOTIMPLEMENTED(); } - virtual void SetSize(gfx::Size) { NOTIMPLEMENTED(); } + virtual void SetIsLoading(bool) { NOTIMPLEMENTED(); } + virtual void IMEUpdateStatus(int, const gfx::Rect&) { NOTIMPLEMENTED(); } + virtual void DidPaintRect(const gfx::Rect&) { NOTIMPLEMENTED(); } + virtual void DidScrollRect(const gfx::Rect&, int, int) { NOTIMPLEMENTED(); } + virtual void RendererGone() { NOTIMPLEMENTED(); } + virtual void Destroy() { NOTIMPLEMENTED(); } + virtual void SetTooltipText(const std::wstring&) { NOTIMPLEMENTED(); } }; class LoadNotificationDetails { @@ -632,13 +645,13 @@ class TabContents : public NotificationObserver { return false; } Profile* profile() const; - void CloseContents() { NOTIMPLEMENTED(); }; - void SetupController(Profile* profile); + virtual void CloseContents(); + virtual void SetupController(Profile* profile); bool WasHidden() { NOTIMPLEMENTED(); return false; } - void RestoreFocus() { NOTIMPLEMENTED(); } + virtual void RestoreFocus() { NOTIMPLEMENTED(); } static TabContentsType TypeForURL(GURL* url) { NOTIMPLEMENTED(); return TAB_CONTENTS_WEB; @@ -651,7 +664,7 @@ class TabContents : public NotificationObserver { const NotificationDetails& details) { NOTIMPLEMENTED(); } virtual void DidBecomeSelected() { NOTIMPLEMENTED(); } virtual void SetDownloadShelfVisible(bool) { NOTIMPLEMENTED(); } - void Destroy() { NOTIMPLEMENTED(); } + virtual void Destroy(); virtual void SetIsLoading(bool, LoadNotificationDetails*) { NOTIMPLEMENTED(); } @@ -673,7 +686,7 @@ class TabContents : public NotificationObserver { return NULL; } void AddInfoBar(InfoBarDelegate*) { NOTIMPLEMENTED(); } - void OpenURL(const GURL&, const GURL&, WindowOpenDisposition, + virtual void OpenURL(const GURL&, const GURL&, WindowOpenDisposition, PageTransition::Type) { NOTIMPLEMENTED(); } virtual void Activate() { NOTIMPLEMENTED(); } virtual bool SupportsURL(GURL*) { NOTIMPLEMENTED(); return false; } |