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

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

Issue 7096016: Remove JS dialog dependency from content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: now a tc delegate Created 9 years, 6 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 <shellapi.h> 8 #include <shellapi.h>
9 #include <windows.h> 9 #include <windows.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 #include "chrome/browser/sessions/session_types.h" 66 #include "chrome/browser/sessions/session_types.h"
67 #include "chrome/browser/sessions/tab_restore_service.h" 67 #include "chrome/browser/sessions/tab_restore_service.h"
68 #include "chrome/browser/sessions/tab_restore_service_factory.h" 68 #include "chrome/browser/sessions/tab_restore_service_factory.h"
69 #include "chrome/browser/sync/profile_sync_service.h" 69 #include "chrome/browser/sync/profile_sync_service.h"
70 #include "chrome/browser/sync/sync_ui_util.h" 70 #include "chrome/browser/sync/sync_ui_util.h"
71 #include "chrome/browser/tab_closeable_state_watcher.h" 71 #include "chrome/browser/tab_closeable_state_watcher.h"
72 #include "chrome/browser/tab_contents/background_contents.h" 72 #include "chrome/browser/tab_contents/background_contents.h"
73 #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" 73 #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h"
74 #include "chrome/browser/tabs/tab_finder.h" 74 #include "chrome/browser/tabs/tab_finder.h"
75 #include "chrome/browser/tabs/tab_strip_model.h" 75 #include "chrome/browser/tabs/tab_strip_model.h"
76 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h"
76 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" 77 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h"
77 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" 78 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
78 #include "chrome/browser/ui/browser_dialogs.h" 79 #include "chrome/browser/ui/browser_dialogs.h"
79 #include "chrome/browser/ui/browser_list.h" 80 #include "chrome/browser/ui/browser_list.h"
80 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" 81 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
81 #include "chrome/browser/ui/browser_window.h" 82 #include "chrome/browser/ui/browser_window.h"
82 #include "chrome/browser/ui/download/download_tab_helper.h" 83 #include "chrome/browser/ui/download/download_tab_helper.h"
83 #include "chrome/browser/ui/find_bar/find_bar.h" 84 #include "chrome/browser/ui/find_bar/find_bar.h"
84 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 85 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
85 #include "chrome/browser/ui/find_bar/find_tab_helper.h" 86 #include "chrome/browser/ui/find_bar/find_tab_helper.h"
(...skipping 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after
3415 const MainFrameCommitDetails& details) { 3416 const MainFrameCommitDetails& details) {
3416 bool visible = static_cast<const BrowserMainFrameCommitDetails&>(details). 3417 bool visible = static_cast<const BrowserMainFrameCommitDetails&>(details).
3417 bookmark_bar_visible; 3418 bookmark_bar_visible;
3418 if (tab == GetSelectedTabContents() && visible != 3419 if (tab == GetSelectedTabContents() && visible !=
3419 GetSelectedTabContentsWrapper()->bookmark_tab_helper()-> 3420 GetSelectedTabContentsWrapper()->bookmark_tab_helper()->
3420 ShouldShowBookmarkBar()) { 3421 ShouldShowBookmarkBar()) {
3421 window()->ShelfVisibilityChanged(); 3422 window()->ShelfVisibilityChanged();
3422 } 3423 }
3423 } 3424 }
3424 3425
3426 content::JavaScriptDialogCreator* Browser::GetJavaScriptDialogCreator() {
3427 return GetJavaScriptDialogCreatorInstance();
3428 }
3429
3425 /////////////////////////////////////////////////////////////////////////////// 3430 ///////////////////////////////////////////////////////////////////////////////
3426 // Browser, TabContentsWrapperDelegate implementation: 3431 // Browser, TabContentsWrapperDelegate implementation:
3427 3432
3428 void Browser::OnDidGetApplicationInfo(TabContentsWrapper* source, 3433 void Browser::OnDidGetApplicationInfo(TabContentsWrapper* source,
3429 int32 page_id) { 3434 int32 page_id) {
3430 if (GetSelectedTabContentsWrapper() != source) 3435 if (GetSelectedTabContentsWrapper() != source)
3431 return; 3436 return;
3432 3437
3433 NavigationEntry* entry = source->controller().GetLastCommittedEntry(); 3438 NavigationEntry* entry = source->controller().GetLastCommittedEntry();
3434 if (!entry || (entry->page_id() != page_id)) 3439 if (!entry || (entry->page_id() != page_id))
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after
4681 TabContents* current_tab = GetSelectedTabContents(); 4686 TabContents* current_tab = GetSelectedTabContents();
4682 if (current_tab) { 4687 if (current_tab) {
4683 content_restrictions = current_tab->content_restrictions(); 4688 content_restrictions = current_tab->content_restrictions();
4684 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); 4689 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry();
4685 // See comment in UpdateCommandsForTabState about why we call url(). 4690 // See comment in UpdateCommandsForTabState about why we call url().
4686 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) 4691 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL()))
4687 content_restrictions |= CONTENT_RESTRICTION_SAVE; 4692 content_restrictions |= CONTENT_RESTRICTION_SAVE;
4688 } 4693 }
4689 return content_restrictions; 4694 return content_restrictions;
4690 } 4695 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698