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

Side by Side Diff: chrome/browser/ui/content_settings/content_settings_tab_helper.h

Issue 6854035: Move blocked content from TabContents to TabContentsWrapper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTINGS_TAB_HELPER_H_
6 #define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTINGS_TAB_HELPER_H_
7 #pragma once
8
9 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
10 #include "chrome/browser/ui/find_bar/find_notification_details.h"
11 #include "content/browser/tab_contents/tab_contents_observer.h"
12 #include "content/common/notification_registrar.h"
13 #include "webkit/glue/window_open_disposition.h"
14
15 class BlockedContentContainer;
16 class ContentSettingsTabHelperDelegate;
17 class TabContentsWrapper;
18
19 // Per-tab class to manage various allowed and disallowed content.
jochen (gone - plz use gerrit) 2011/04/14 23:11:04 so, there seems to be an misunderstanding. there
Avi (use Gerrit) 2011/04/15 00:20:12 Gah. The reason I did this in the first place was
20 class ContentSettingsTabHelper : public NotificationObserver,
21 public TabContentsObserver {
22 public:
23 explicit ContentSettingsTabHelper(TabContentsWrapper* tab_contents);
24 virtual ~ContentSettingsTabHelper();
25
26 ContentSettingsTabHelperDelegate* delegate() const { return delegate_; }
27 void set_delegate(ContentSettingsTabHelperDelegate* d) { delegate_ = d; }
28
29 // Sets whether all TabContents added by way of |AddNewContents| should be
30 // blocked. Transitioning from all blocked to not all blocked results in
31 // reevaluating any blocked TabContents, which may result in unblocking some
32 // of the blocked TabContents.
33 void SetAllContentsBlocked(bool value);
34
35 bool all_contents_blocked() const { return all_contents_blocked_; }
36
37 // Adds the incoming |new_contents| to the |blocked_contents_| container.
38 void AddTabContents(TabContentsWrapper* new_contents,
39 WindowOpenDisposition disposition,
40 const gfx::Rect& initial_pos,
41 bool user_gesture);
42
43 // Adds the incoming |new_contents| to the |blocked_contents_| container.
44 void AddPopup(TabContentsWrapper* new_contents,
45 const gfx::Rect& initial_pos);
46
47 // Shows the blocked TabContents |tab_contents|.
48 void LaunchForContents(TabContentsWrapper* tab_contents);
49
50 // Returns the number of blocked contents.
51 size_t GetBlockedContentsCount() const;
52
53 // Returns the blocked TabContentsWrappers. |blocked_contents| must
54 // be non-NULL.
55 void GetBlockedContents(
56 std::vector<TabContentsWrapper*>* blocked_contents) const;
57
58 // TabContentsObserver overrides:
59 virtual void DidNavigateMainFramePostCommit(
60 const NavigationController::LoadCommittedDetails& details,
61 const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE;
62
63 // NotificationObserver overrides:
64 virtual void Observe(NotificationType type,
65 const NotificationSource& source,
66 const NotificationDetails& details) OVERRIDE;
67
68 private:
69 // Called when the blocked popup notification is shown or hidden.
70 void PopupNotificationVisibilityChanged(bool visible);
71
72 // Object that holds any blocked TabContents spawned from this TabContents.
73 scoped_ptr<BlockedContentContainer> blocked_contents_;
74
75 // Should we block all child TabContents this attempts to spawn.
76 bool all_contents_blocked_;
77
78 // TODO(pkasting): Hack to try and fix Linux browser tests.
79 bool dont_notify_render_view_;
80
81 // Owning TabContentsWrapper.
82 TabContentsWrapper* tab_contents_wrapper_;
83
84 // Delegate for notifying our owner about stuff. Not owned by us.
85 ContentSettingsTabHelperDelegate* delegate_;
86
87 // Registers and unregisters us for notifications.
88 NotificationRegistrar registrar_;
89
90 DISALLOW_COPY_AND_ASSIGN(ContentSettingsTabHelper);
91 };
92
93 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTINGS_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698