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

Side by Side Diff: chrome/browser/notifications/balloon_host.cc

Issue 10868116: Pass result of blockage across content API when new tab blocked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/notifications/balloon_host.h" 5 #include "chrome/browser/notifications/balloon_host.h"
6 6
7 #include "chrome/browser/notifications/balloon.h" 7 #include "chrome/browser/notifications/balloon.h"
8 #include "chrome/browser/notifications/balloon_collection_impl.h" 8 #include "chrome/browser/notifications/balloon_collection_impl.h"
9 #include "chrome/browser/notifications/notification.h" 9 #include "chrome/browser/notifications/notification.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 void BalloonHost::ResizeDueToAutoResize(WebContents* source, 75 void BalloonHost::ResizeDueToAutoResize(WebContents* source,
76 const gfx::Size& pref_size) { 76 const gfx::Size& pref_size) {
77 balloon_->ResizeDueToAutoResize(pref_size); 77 balloon_->ResizeDueToAutoResize(pref_size);
78 } 78 }
79 79
80 void BalloonHost::AddNewContents(WebContents* source, 80 void BalloonHost::AddNewContents(WebContents* source,
81 WebContents* new_contents, 81 WebContents* new_contents,
82 WindowOpenDisposition disposition, 82 WindowOpenDisposition disposition,
83 const gfx::Rect& initial_pos, 83 const gfx::Rect& initial_pos,
84 bool user_gesture) { 84 bool user_gesture,
85 bool* was_blocked) {
85 Browser* browser = browser::FindLastActiveWithProfile( 86 Browser* browser = browser::FindLastActiveWithProfile(
86 Profile::FromBrowserContext(new_contents->GetBrowserContext())); 87 Profile::FromBrowserContext(new_contents->GetBrowserContext()));
87 if (browser) { 88 if (browser) {
88 chrome::AddWebContents(browser, NULL, new_contents, disposition, 89 chrome::AddWebContents(browser, NULL, new_contents, disposition,
89 initial_pos, user_gesture); 90 initial_pos, user_gesture, was_blocked);
90 } 91 }
91 } 92 }
92 93
93 void BalloonHost::RenderViewCreated(content::RenderViewHost* render_view_host) { 94 void BalloonHost::RenderViewCreated(content::RenderViewHost* render_view_host) {
94 gfx::Size min_size(BalloonCollectionImpl::min_balloon_width(), 95 gfx::Size min_size(BalloonCollectionImpl::min_balloon_width(),
95 BalloonCollectionImpl::min_balloon_height()); 96 BalloonCollectionImpl::min_balloon_height());
96 gfx::Size max_size(BalloonCollectionImpl::max_balloon_width(), 97 gfx::Size max_size(BalloonCollectionImpl::max_balloon_width(),
97 BalloonCollectionImpl::max_balloon_height()); 98 BalloonCollectionImpl::max_balloon_height());
98 render_view_host->EnableAutoResize(min_size, max_size); 99 render_view_host->EnableAutoResize(min_size, max_size);
99 100
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 bool BalloonHost::CanLoadDataURLsInWebUI() const { 176 bool BalloonHost::CanLoadDataURLsInWebUI() const {
176 #if defined(OS_CHROMEOS) 177 #if defined(OS_CHROMEOS)
177 // Chrome OS uses data URLs in WebUI BalloonHosts. We normally do not allow 178 // Chrome OS uses data URLs in WebUI BalloonHosts. We normally do not allow
178 // data URLs in WebUI renderers, but normal pages cannot target BalloonHosts, 179 // data URLs in WebUI renderers, but normal pages cannot target BalloonHosts,
179 // so this should be safe. 180 // so this should be safe.
180 return true; 181 return true;
181 #else 182 #else
182 return false; 183 return false;
183 #endif 184 #endif
184 } 185 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698