diff options
author | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-20 18:15:48 +0000 |
---|---|---|
committer | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-20 18:15:48 +0000 |
commit | 6023b52167fe519768cc69f39a676891adfbf8e5 (patch) | |
tree | 88a1d56f456e7f1e3caff47bc602aaaad937c3b6 /chrome/browser/tab_contents | |
parent | 1c08ee793d6c5fcd0a912faa40e04f2e60de1698 (diff) | |
download | chromium_src-6023b52167fe519768cc69f39a676891adfbf8e5.zip chromium_src-6023b52167fe519768cc69f39a676891adfbf8e5.tar.gz chromium_src-6023b52167fe519768cc69f39a676891adfbf8e5.tar.bz2 |
[Mac]Implement ViewID support. (third approach)
This CL adds several extension methods to NSView class for ViewID
support, and uses a map to store ViewIDs of views.
Each view requiring ViewID support can set its ViewID upon
initialization and unset it before destruction.
When looking up a view with a specific ViewID, just search all sub views
recursively from the root view of a window.
BUG=44692 need ViewIds on mac
TEST=none
Review URL: http://codereview.chromium.org/2878037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53067 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_view_mac.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm index 9de79b9..8587dec 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm @@ -17,6 +17,7 @@ #include "chrome/browser/cocoa/sad_tab_controller.h" #import "chrome/browser/cocoa/web_drag_source.h" #import "chrome/browser/cocoa/web_drop_target.h" +#import "chrome/browser/cocoa/view_id_util.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/render_view_host_factory.h" #include "chrome/browser/renderer_host/render_widget_host.h" @@ -330,11 +331,17 @@ void TabContentsViewMac::Observe(NotificationType type, dropTarget_.reset( [[WebDropTarget alloc] initWithTabContents:[self tabContents]]); [self registerDragTypes]; + // TabContentsViewCocoa's ViewID may be changed to VIEW_ID_DEV_TOOLS_DOCKED + // by TabContentsController, so we can't just override -viewID method to + // return it. + view_id_util::SetID(self, VIEW_ID_TAB_CONTAINER); } return self; } - (void)dealloc { + view_id_util::UnsetID(self); + // Cancel any deferred tab closes, just in case. [self cancelDeferredClose]; |