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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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"
(...skipping 14 matching lines...) Expand all
25 #include "chrome/browser/ui/browser_window.h" 25 #include "chrome/browser/ui/browser_window.h"
26 #include "chrome/browser/ui/download/download_tab_helper.h" 26 #include "chrome/browser/ui/download/download_tab_helper.h"
27 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 27 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
28 #include "chrome/browser/ui/views/browser_dialogs.h" 28 #include "chrome/browser/ui/views/browser_dialogs.h"
29 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" 29 #include "chrome/browser/ui/views/infobars/infobar_container_view.h"
30 #include "chrome/browser/ui/views/page_info_bubble_view.h" 30 #include "chrome/browser/ui/views/page_info_bubble_view.h"
31 #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h" 31 #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h"
32 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" 32 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h"
33 #include "chrome/common/automation_messages.h" 33 #include "chrome/common/automation_messages.h"
34 #include "chrome/common/chrome_constants.h" 34 #include "chrome/common/chrome_constants.h"
35 #include "chrome/common/chrome_notification_types.h"
35 #include "chrome/common/render_messages.h" 36 #include "chrome/common/render_messages.h"
36 #include "chrome/common/url_constants.h" 37 #include "chrome/common/url_constants.h"
37 #include "content/browser/debugger/devtools_toggle_action.h" 38 #include "content/browser/debugger/devtools_toggle_action.h"
38 #include "content/browser/debugger/devtools_window.h" 39 #include "content/browser/debugger/devtools_window.h"
39 #include "content/browser/load_notification_details.h" 40 #include "content/browser/load_notification_details.h"
40 #include "content/browser/renderer_host/render_process_host.h" 41 #include "content/browser/renderer_host/render_process_host.h"
41 #include "content/browser/renderer_host/render_view_host.h" 42 #include "content/browser/renderer_host/render_view_host.h"
42 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" 43 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
43 #include "content/browser/tab_contents/navigation_details.h" 44 #include "content/browser/tab_contents/navigation_details.h"
44 #include "content/browser/tab_contents/provisional_load_details.h" 45 #include "content/browser/tab_contents/provisional_load_details.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 registrar_.Add(this, NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR, 183 registrar_.Add(this, NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR,
183 Source<NavigationController>(controller)); 184 Source<NavigationController>(controller));
184 registrar_.Add(this, NotificationType::LOAD_STOP, 185 registrar_.Add(this, NotificationType::LOAD_STOP,
185 Source<NavigationController>(controller)); 186 Source<NavigationController>(controller));
186 registrar_.Add(this, NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB, 187 registrar_.Add(this, NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB,
187 Source<TabContents>(tab_contents_->tab_contents())); 188 Source<TabContents>(tab_contents_->tab_contents()));
188 registrar_.Add(this, NotificationType::RENDER_VIEW_HOST_DELETED, 189 registrar_.Add(this, NotificationType::RENDER_VIEW_HOST_DELETED,
189 NotificationService::AllSources()); 190 NotificationService::AllSources());
190 191
191 NotificationService::current()->Notify( 192 NotificationService::current()->Notify(
192 NotificationType::EXTERNAL_TAB_CREATED, 193 chrome::EXTERNAL_TAB_CREATED,
193 Source<NavigationController>(controller), 194 Source<NavigationController>(controller),
194 NotificationService::NoDetails()); 195 NotificationService::NoDetails());
195 196
196 TabContentsObserver::Observe(tab_contents_->tab_contents()); 197 TabContentsObserver::Observe(tab_contents_->tab_contents());
197 198
198 // Start loading initial URL 199 // Start loading initial URL
199 if (!initial_url.is_empty()) { 200 if (!initial_url.is_empty()) {
200 // Navigate out of context since we don't have a 'tab_handle_' yet. 201 // Navigate out of context since we don't have a 'tab_handle_' yet.
201 MessageLoop::current()->PostTask( 202 MessageLoop::current()->PostTask(
202 FROM_HERE, 203 FROM_HERE,
(...skipping 23 matching lines...) Expand all
226 227
227 void ExternalTabContainer::Uninitialize() { 228 void ExternalTabContainer::Uninitialize() {
228 registrar_.RemoveAll(); 229 registrar_.RemoveAll();
229 if (tab_contents_.get()) { 230 if (tab_contents_.get()) {
230 UnregisterRenderViewHost(tab_contents_->render_view_host()); 231 UnregisterRenderViewHost(tab_contents_->render_view_host());
231 232
232 if (GetWidget()->GetRootView()) 233 if (GetWidget()->GetRootView())
233 GetWidget()->GetRootView()->RemoveAllChildViews(true); 234 GetWidget()->GetRootView()->RemoveAllChildViews(true);
234 235
235 NotificationService::current()->Notify( 236 NotificationService::current()->Notify(
236 NotificationType::EXTERNAL_TAB_CLOSED, 237 chrome::EXTERNAL_TAB_CLOSED,
237 Source<NavigationController>(&tab_contents_->controller()), 238 Source<NavigationController>(&tab_contents_->controller()),
238 Details<ExternalTabContainer>(this)); 239 Details<ExternalTabContainer>(this));
239 240
240 tab_contents_.reset(NULL); 241 tab_contents_.reset(NULL);
241 } 242 }
242 243
243 if (focus_manager_) { 244 if (focus_manager_) {
244 focus_manager_->UnregisterAccelerators(this); 245 focus_manager_->UnregisterAccelerators(this);
245 focus_manager_ = NULL; 246 focus_manager_ = NULL;
246 } 247 }
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 1123
1123 if (disposition == CURRENT_TAB) { 1124 if (disposition == CURRENT_TAB) {
1124 DCHECK(route_all_top_level_navigations_); 1125 DCHECK(route_all_top_level_navigations_);
1125 disposition = NEW_FOREGROUND_TAB; 1126 disposition = NEW_FOREGROUND_TAB;
1126 } 1127 }
1127 ExternalTabContainer::OpenURLFromTab(source, url, referrer, disposition, 1128 ExternalTabContainer::OpenURLFromTab(source, url, referrer, disposition,
1128 transition); 1129 transition);
1129 // support only one navigation for a dummy tab before it is killed. 1130 // support only one navigation for a dummy tab before it is killed.
1130 ::DestroyWindow(GetNativeView()); 1131 ::DestroyWindow(GetNativeView());
1131 } 1132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698