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

Side by Side Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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) 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/automation/automation_provider_observers.h" 5 #include "chrome/browser/automation/automation_provider_observers.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "chrome/browser/sessions/restore_tab_helper.h" 50 #include "chrome/browser/sessions/restore_tab_helper.h"
51 #include "chrome/browser/sessions/tab_restore_service.h" 51 #include "chrome/browser/sessions/tab_restore_service.h"
52 #include "chrome/browser/sessions/tab_restore_service_factory.h" 52 #include "chrome/browser/sessions/tab_restore_service_factory.h"
53 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" 53 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
54 #include "chrome/browser/tab_contents/thumbnail_generator.h" 54 #include "chrome/browser/tab_contents/thumbnail_generator.h"
55 #include "chrome/browser/translate/page_translated_details.h" 55 #include "chrome/browser/translate/page_translated_details.h"
56 #include "chrome/browser/translate/translate_infobar_delegate.h" 56 #include "chrome/browser/translate/translate_infobar_delegate.h"
57 #include "chrome/browser/translate/translate_tab_helper.h" 57 #include "chrome/browser/translate/translate_tab_helper.h"
58 #include "chrome/browser/ui/browser.h" 58 #include "chrome/browser/ui/browser.h"
59 #include "chrome/browser/ui/browser_list.h" 59 #include "chrome/browser/ui/browser_list.h"
60 #include "chrome/browser/ui/browser_tabstrip.h"
60 #include "chrome/browser/ui/browser_window.h" 61 #include "chrome/browser/ui/browser_window.h"
61 #include "chrome/browser/ui/find_bar/find_notification_details.h" 62 #include "chrome/browser/ui/find_bar/find_notification_details.h"
62 #include "chrome/browser/ui/login/login_prompt.h" 63 #include "chrome/browser/ui/login/login_prompt.h"
63 #include "chrome/browser/ui/tab_contents/tab_contents.h" 64 #include "chrome/browser/ui/tab_contents/tab_contents.h"
64 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" 65 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
65 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h" 66 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h"
66 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 67 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
67 #include "chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h" 68 #include "chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h"
68 #include "chrome/common/automation_constants.h" 69 #include "chrome/common/automation_constants.h"
69 #include "chrome/common/automation_messages.h" 70 #include "chrome/common/automation_messages.h"
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 case IDC_CLOSE_TAB: { 964 case IDC_CLOSE_TAB: {
964 TabClosedNotificationObserver* observer = 965 TabClosedNotificationObserver* observer =
965 new TabClosedNotificationObserver(automation, true, reply_message); 966 new TabClosedNotificationObserver(automation, true, reply_message);
966 observer->set_for_browser_command(true); 967 observer->set_for_browser_command(true);
967 break; 968 break;
968 } 969 }
969 case IDC_BACK: 970 case IDC_BACK:
970 case IDC_FORWARD: 971 case IDC_FORWARD:
971 case IDC_RELOAD: { 972 case IDC_RELOAD: {
972 new NavigationNotificationObserver( 973 new NavigationNotificationObserver(
973 &browser->GetActiveWebContents()->GetController(), 974 &chrome::GetActiveWebContents(browser)->GetController(),
974 automation, reply_message, 1, false, false); 975 automation, reply_message, 1, false, false);
975 break; 976 break;
976 } 977 }
977 default: { 978 default: {
978 ExecuteBrowserCommandObserver* observer = 979 ExecuteBrowserCommandObserver* observer =
979 new ExecuteBrowserCommandObserver(automation, reply_message); 980 new ExecuteBrowserCommandObserver(automation, reply_message);
980 if (!observer->Register(command)) { 981 if (!observer->Register(command)) {
981 delete observer; 982 delete observer;
982 result = false; 983 result = false;
983 } 984 }
(...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after
2576 chrome::NOTIFICATION_APP_MODAL_DIALOG_SHOWN, 2577 chrome::NOTIFICATION_APP_MODAL_DIALOG_SHOWN,
2577 content::NotificationService::AllSources()); 2578 content::NotificationService::AllSources());
2578 registrar_.Add(this, 2579 registrar_.Add(this,
2579 content::NOTIFICATION_LOAD_STOP, 2580 content::NOTIFICATION_LOAD_STOP,
2580 content::NotificationService::AllSources()); 2581 content::NotificationService::AllSources());
2581 for (BrowserList::const_iterator iter = BrowserList::begin(); 2582 for (BrowserList::const_iterator iter = BrowserList::begin();
2582 iter != BrowserList::end(); 2583 iter != BrowserList::end();
2583 ++iter) { 2584 ++iter) {
2584 Browser* browser = *iter; 2585 Browser* browser = *iter;
2585 for (int i = 0; i < browser->tab_count(); ++i) { 2586 for (int i = 0; i < browser->tab_count(); ++i) {
2586 TabContents* tab_contents = browser->GetTabContentsAt(i); 2587 TabContents* tab_contents = chrome::GetTabContentsAt(browser, i);
2587 StartObserving(tab_contents->automation_tab_helper()); 2588 StartObserving(tab_contents->automation_tab_helper());
2588 if (tab_contents->automation_tab_helper()->has_pending_loads()) 2589 if (tab_contents->automation_tab_helper()->has_pending_loads())
2589 pending_tabs_.insert(tab_contents->web_contents()); 2590 pending_tabs_.insert(tab_contents->web_contents());
2590 } 2591 }
2591 } 2592 }
2592 CheckIfNoMorePendingLoads(); 2593 CheckIfNoMorePendingLoads();
2593 } 2594 }
2594 2595
2595 AllViewsStoppedLoadingObserver::~AllViewsStoppedLoadingObserver() { 2596 AllViewsStoppedLoadingObserver::~AllViewsStoppedLoadingObserver() {
2596 } 2597 }
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
3093 AutomationJSONReply(automation_, reply_message_.release()) 3094 AutomationJSONReply(automation_, reply_message_.release())
3094 .SendSuccess(NULL); 3095 .SendSuccess(NULL);
3095 } 3096 }
3096 delete this; 3097 delete this;
3097 } 3098 }
3098 } else { 3099 } else {
3099 NOTREACHED(); 3100 NOTREACHED();
3100 } 3101 }
3101 } 3102 }
3102 3103
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider.cc ('k') | chrome/browser/automation/automation_tab_helper_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698