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

Side by Side Diff: chrome/browser/tab_contents/tab_contents_delegate.h

Issue 3174030: Making window.focus()/blur() work only when there is a user gesture. (Closed) Base URL: git://codf21.jail/chromium.git
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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_
6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // initial position. 61 // initial position.
62 virtual void AddNewContents(TabContents* source, 62 virtual void AddNewContents(TabContents* source,
63 TabContents* new_contents, 63 TabContents* new_contents,
64 WindowOpenDisposition disposition, 64 WindowOpenDisposition disposition,
65 const gfx::Rect& initial_pos, 65 const gfx::Rect& initial_pos,
66 bool user_gesture) = 0; 66 bool user_gesture) = 0;
67 67
68 // Selects the specified contents, bringing its container to the front. 68 // Selects the specified contents, bringing its container to the front.
69 virtual void ActivateContents(TabContents* contents) = 0; 69 virtual void ActivateContents(TabContents* contents) = 0;
70 70
71 // Deactivates the specified contents by deactivating its container and
72 // potentialy moving it to the back of the Z order.
73 virtual void DeactivateContents(TabContents* contents) = 0;
74
71 // Notifies the delegate that this contents is starting or is done loading 75 // Notifies the delegate that this contents is starting or is done loading
72 // some resource. The delegate should use this notification to represent 76 // some resource. The delegate should use this notification to represent
73 // loading feedback. See TabContents::is_loading() 77 // loading feedback. See TabContents::is_loading()
74 virtual void LoadingStateChanged(TabContents* source) = 0; 78 virtual void LoadingStateChanged(TabContents* source) = 0;
75 79
76 // Request the delegate to close this tab contents, and do whatever cleanup 80 // Request the delegate to close this tab contents, and do whatever cleanup
77 // it needs to do. 81 // it needs to do.
78 virtual void CloseContents(TabContents* source) = 0; 82 virtual void CloseContents(TabContents* source) = 0;
79 83
80 // Request the delegate to move this tab contents to the specified position 84 // Request the delegate to move this tab contents to the specified position
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // api calls through to the Browser process. 176 // api calls through to the Browser process.
173 virtual ExtensionFunctionDispatcher* CreateExtensionFunctionDispatcher( 177 virtual ExtensionFunctionDispatcher* CreateExtensionFunctionDispatcher(
174 RenderViewHost* render_view_host, 178 RenderViewHost* render_view_host,
175 const std::string& extension_id); 179 const std::string& extension_id);
176 180
177 // This is called when WebKit tells us that it is done tabbing through 181 // This is called when WebKit tells us that it is done tabbing through
178 // controls on the page. Provides a way for TabContentsDelegates to handle 182 // controls on the page. Provides a way for TabContentsDelegates to handle
179 // this. Returns true if the delegate successfully handled it. 183 // this. Returns true if the delegate successfully handled it.
180 virtual bool TakeFocus(bool reverse); 184 virtual bool TakeFocus(bool reverse);
181 185
182 // Called by WebKit to notify that the page requested the tab hosting window
183 // to be activated/deactivated (by calling window.focus()/blur()).
184 virtual void Activate();
185 virtual void Deactivate();
186
187 // Changes the blocked state of the tab at |index|. TabContents are 186 // Changes the blocked state of the tab at |index|. TabContents are
188 // considered blocked while displaying a tab modal dialog. During that time 187 // considered blocked while displaying a tab modal dialog. During that time
189 // renderer host will ignore any UI interaction within TabContent outside of 188 // renderer host will ignore any UI interaction within TabContent outside of
190 // the currently displaying dialog. 189 // the currently displaying dialog.
191 virtual void SetTabContentBlocked(TabContents* contents, bool blocked); 190 virtual void SetTabContentBlocked(TabContents* contents, bool blocked);
192 191
193 // Notification that |tab_contents| has gained focus. 192 // Notification that |tab_contents| has gained focus.
194 virtual void TabContentsFocused(TabContents* tab_content); 193 virtual void TabContentsFocused(TabContents* tab_content);
195 194
196 // Return much extra vertical space should be allotted to the 195 // Return much extra vertical space should be allotted to the
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // Sent when the user does a gesture that results in committing the match 280 // Sent when the user does a gesture that results in committing the match
282 // preview. The delegate should replace |source| with the |source|'s match 281 // preview. The delegate should replace |source| with the |source|'s match
283 // preview TabContents. 282 // preview TabContents.
284 virtual void CommitMatchPreview(TabContents* source); 283 virtual void CommitMatchPreview(TabContents* source);
285 284
286 protected: 285 protected:
287 virtual ~TabContentsDelegate(); 286 virtual ~TabContentsDelegate();
288 }; 287 };
289 288
290 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ 289 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.cc ('k') | chrome/browser/tab_contents/tab_contents_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698