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

Side by Side Diff: chrome/browser/external_tab_container_win.cc

Issue 7810002: Move infobar handling to a tab helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 9 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) 2011 The Chromium Authors. All rights reserved. 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 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/external_tab_container_win.h" 5 #include "chrome/browser/external_tab_container_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "base/win/win_util.h" 13 #include "base/win/win_util.h"
14 #include "chrome/app/chrome_command_ids.h" 14 #include "chrome/app/chrome_command_ids.h"
15 #include "chrome/app/chrome_dll_resource.h" 15 #include "chrome/app/chrome_dll_resource.h"
16 #include "chrome/browser/automation/automation_provider.h" 16 #include "chrome/browser/automation/automation_provider.h"
17 #include "chrome/browser/debugger/devtools_toggle_action.h" 17 #include "chrome/browser/debugger/devtools_toggle_action.h"
18 #include "chrome/browser/debugger/devtools_window.h" 18 #include "chrome/browser/debugger/devtools_window.h"
19 #include "chrome/browser/google/google_util.h" 19 #include "chrome/browser/google/google_util.h"
20 #include "chrome/browser/history/history_types.h" 20 #include "chrome/browser/history/history_types.h"
21 #include "chrome/browser/history/history_tab_helper.h" 21 #include "chrome/browser/history/history_tab_helper.h"
22 #include "chrome/browser/infobars/infobar_tab_helper.h"
22 #include "chrome/browser/page_info_window.h" 23 #include "chrome/browser/page_info_window.h"
23 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" 25 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h"
25 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" 26 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h"
26 #include "chrome/browser/ui/browser.h" 27 #include "chrome/browser/ui/browser.h"
27 #include "chrome/browser/ui/browser_window.h" 28 #include "chrome/browser/ui/browser_window.h"
28 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 29 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
29 #include "chrome/browser/ui/views/browser_dialogs.h" 30 #include "chrome/browser/ui/views/browser_dialogs.h"
30 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" 31 #include "chrome/browser/ui/views/infobars/infobar_container_view.h"
31 #include "chrome/browser/ui/views/page_info_bubble_view.h" 32 #include "chrome/browser/ui/views/page_info_bubble_view.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 if (existing_contents) { 187 if (existing_contents) {
187 tab_contents_.reset(existing_contents); 188 tab_contents_.reset(existing_contents);
188 tab_contents_->controller().set_browser_context(profile); 189 tab_contents_->controller().set_browser_context(profile);
189 } else { 190 } else {
190 TabContents* new_contents = new TabContents(profile, NULL, MSG_ROUTING_NONE, 191 TabContents* new_contents = new TabContents(profile, NULL, MSG_ROUTING_NONE,
191 NULL, NULL); 192 NULL, NULL);
192 tab_contents_.reset(new TabContentsWrapper(new_contents)); 193 tab_contents_.reset(new TabContentsWrapper(new_contents));
193 } 194 }
194 195
195 if (!infobars_enabled) 196 if (!infobars_enabled)
196 tab_contents_->set_infobars_enabled(false); 197 tab_contents_->infobar_tab_helper()->set_infobars_enabled(false);
197 198
198 tab_contents_->tab_contents()->set_delegate(this); 199 tab_contents_->tab_contents()->set_delegate(this);
199 200
200 tab_contents_->tab_contents()-> 201 tab_contents_->tab_contents()->
201 GetMutableRendererPrefs()->browser_handles_top_level_requests = 202 GetMutableRendererPrefs()->browser_handles_top_level_requests =
202 handle_top_level_requests; 203 handle_top_level_requests;
203 204
204 if (!existing_contents) { 205 if (!existing_contents) {
205 tab_contents_->render_view_host()->AllowBindings( 206 tab_contents_->render_view_host()->AllowBindings(
206 BindingsPolicy::EXTERNAL_HOST); 207 BindingsPolicy::EXTERNAL_HOST);
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 if (params.disposition == CURRENT_TAB) { 1197 if (params.disposition == CURRENT_TAB) {
1197 DCHECK(route_all_top_level_navigations_); 1198 DCHECK(route_all_top_level_navigations_);
1198 forward_params.disposition = NEW_FOREGROUND_TAB; 1199 forward_params.disposition = NEW_FOREGROUND_TAB;
1199 } 1200 }
1200 TabContents* new_contents = 1201 TabContents* new_contents =
1201 ExternalTabContainer::OpenURLFromTab(source, forward_params); 1202 ExternalTabContainer::OpenURLFromTab(source, forward_params);
1202 // support only one navigation for a dummy tab before it is killed. 1203 // support only one navigation for a dummy tab before it is killed.
1203 ::DestroyWindow(GetNativeView()); 1204 ::DestroyWindow(GetNativeView());
1204 return new_contents; 1205 return new_contents;
1205 } 1206 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698