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

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

Issue 7574002: Be able to print items that do window.print(); window.close() (airline tix e.g.) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 9 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 | 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/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "chrome/browser/google/google_url_tracker.h" 50 #include "chrome/browser/google/google_url_tracker.h"
51 #include "chrome/browser/google/google_util.h" 51 #include "chrome/browser/google/google_util.h"
52 #include "chrome/browser/instant/instant_controller.h" 52 #include "chrome/browser/instant/instant_controller.h"
53 #include "chrome/browser/instant/instant_unload_handler.h" 53 #include "chrome/browser/instant/instant_unload_handler.h"
54 #include "chrome/browser/net/browser_url_util.h" 54 #include "chrome/browser/net/browser_url_util.h"
55 #include "chrome/browser/net/url_fixer_upper.h" 55 #include "chrome/browser/net/url_fixer_upper.h"
56 #include "chrome/browser/notifications/notification_ui_manager.h" 56 #include "chrome/browser/notifications/notification_ui_manager.h"
57 #include "chrome/browser/platform_util.h" 57 #include "chrome/browser/platform_util.h"
58 #include "chrome/browser/prefs/incognito_mode_prefs.h" 58 #include "chrome/browser/prefs/incognito_mode_prefs.h"
59 #include "chrome/browser/prefs/pref_service.h" 59 #include "chrome/browser/prefs/pref_service.h"
60 #include "chrome/browser/printing/background_printing_manager.h"
60 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" 61 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h"
62 #include "chrome/browser/printing/print_preview_tab_controller.h"
61 #include "chrome/browser/profiles/profile.h" 63 #include "chrome/browser/profiles/profile.h"
62 #include "chrome/browser/sessions/restore_tab_helper.h" 64 #include "chrome/browser/sessions/restore_tab_helper.h"
63 #include "chrome/browser/sessions/session_service.h" 65 #include "chrome/browser/sessions/session_service.h"
64 #include "chrome/browser/sessions/session_service_factory.h" 66 #include "chrome/browser/sessions/session_service_factory.h"
65 #include "chrome/browser/sessions/session_types.h" 67 #include "chrome/browser/sessions/session_types.h"
66 #include "chrome/browser/sessions/tab_restore_service.h" 68 #include "chrome/browser/sessions/tab_restore_service.h"
67 #include "chrome/browser/sessions/tab_restore_service_factory.h" 69 #include "chrome/browser/sessions/tab_restore_service_factory.h"
68 #include "chrome/browser/sync/profile_sync_service.h" 70 #include "chrome/browser/sync/profile_sync_service.h"
69 #include "chrome/browser/sync/sync_ui_util.h" 71 #include "chrome/browser/sync/sync_ui_util.h"
70 #include "chrome/browser/tab_closeable_state_watcher.h" 72 #include "chrome/browser/tab_closeable_state_watcher.h"
(...skipping 3124 matching lines...) Expand 10 before | Expand all | Expand 10 after
3195 void Browser::CloseContents(TabContents* source) { 3197 void Browser::CloseContents(TabContents* source) {
3196 if (is_attempting_to_close_browser_) { 3198 if (is_attempting_to_close_browser_) {
3197 // If we're trying to close the browser, just clear the state related to 3199 // If we're trying to close the browser, just clear the state related to
3198 // waiting for unload to fire. Don't actually try to close the tab as it 3200 // waiting for unload to fire. Don't actually try to close the tab as it
3199 // will go down the slow shutdown path instead of the fast path of killing 3201 // will go down the slow shutdown path instead of the fast path of killing
3200 // all the renderer processes. 3202 // all the renderer processes.
3201 ClearUnloadState(source, true); 3203 ClearUnloadState(source, true);
3202 return; 3204 return;
3203 } 3205 }
3204 3206
3207 TabContentsWrapper* tab_wrapper =
3208 TabContentsWrapper::GetCurrentWrapperForContents(source);
3209 if (g_browser_process->background_printing_manager()->
3210 OwnInitiatorTabContents(tab_wrapper)) {
3211 return;
3212 }
3213
3205 int index = tab_handler_->GetTabStripModel()->GetWrapperIndex(source); 3214 int index = tab_handler_->GetTabStripModel()->GetWrapperIndex(source);
3206 if (index == TabStripModel::kNoTab) { 3215 if (index == TabStripModel::kNoTab) {
3207 NOTREACHED() << "CloseContents called for tab not in our strip"; 3216 NOTREACHED() << "CloseContents called for tab not in our strip";
3208 return; 3217 return;
3209 } 3218 }
3210 tab_handler_->GetTabStripModel()->CloseTabContentsAt( 3219 tab_handler_->GetTabStripModel()->CloseTabContentsAt(
3211 index, 3220 index,
3212 TabStripModel::CLOSE_CREATE_HISTORICAL_TAB); 3221 TabStripModel::CLOSE_CREATE_HISTORICAL_TAB);
3213 } 3222 }
3214 3223
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after
4840 } 4849 }
4841 4850
4842 void Browser::ShowSyncSetup() { 4851 void Browser::ShowSyncSetup() {
4843 ProfileSyncService* service = 4852 ProfileSyncService* service =
4844 profile()->GetOriginalProfile()->GetProfileSyncService(); 4853 profile()->GetOriginalProfile()->GetProfileSyncService();
4845 if (service->HasSyncSetupCompleted()) 4854 if (service->HasSyncSetupCompleted())
4846 ShowOptionsTab(chrome::kSyncSetupSubPage); 4855 ShowOptionsTab(chrome::kSyncSetupSubPage);
4847 else 4856 else
4848 service->ShowLoginDialog(); 4857 service->ShowLoginDialog();
4849 } 4858 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698