| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/browser/metrics/metric_event_duration_details.h" | 31 #include "chrome/browser/metrics/metric_event_duration_details.h" |
| 32 #include "chrome/browser/notifications/balloon.h" | 32 #include "chrome/browser/notifications/balloon.h" |
| 33 #include "chrome/browser/notifications/balloon_collection.h" | 33 #include "chrome/browser/notifications/balloon_collection.h" |
| 34 #include "chrome/browser/printing/print_job.h" | 34 #include "chrome/browser/printing/print_job.h" |
| 35 #include "chrome/browser/profile.h" | 35 #include "chrome/browser/profile.h" |
| 36 #include "chrome/browser/renderer_host/render_view_host.h" | 36 #include "chrome/browser/renderer_host/render_view_host.h" |
| 37 #include "chrome/browser/search_engines/template_url_model.h" | 37 #include "chrome/browser/search_engines/template_url_model.h" |
| 38 #include "chrome/browser/tab_contents/navigation_controller.h" | 38 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 39 #include "chrome/browser/tab_contents/tab_contents.h" | 39 #include "chrome/browser/tab_contents/tab_contents.h" |
| 40 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 40 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
| 41 #include "chrome/browser/tab_contents_wrapper.h" |
| 41 #include "chrome/browser/translate/page_translated_details.h" | 42 #include "chrome/browser/translate/page_translated_details.h" |
| 42 #include "chrome/browser/translate/translate_infobar_delegate.h" | 43 #include "chrome/browser/translate/translate_infobar_delegate.h" |
| 43 #include "chrome/browser/ui/browser.h" | 44 #include "chrome/browser/ui/browser.h" |
| 44 #include "chrome/common/automation_constants.h" | 45 #include "chrome/common/automation_constants.h" |
| 45 #include "chrome/common/extensions/extension.h" | 46 #include "chrome/common/extensions/extension.h" |
| 46 #include "chrome/common/notification_service.h" | 47 #include "chrome/common/notification_service.h" |
| 47 #include "gfx/codec/png_codec.h" | 48 #include "gfx/codec/png_codec.h" |
| 48 #include "gfx/rect.h" | 49 #include "gfx/rect.h" |
| 49 | 50 |
| 50 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 tab_strip_model_(browser->tabstrip_model()), | 368 tab_strip_model_(browser->tabstrip_model()), |
| 368 target_tab_count_(target_tab_count) { | 369 target_tab_count_(target_tab_count) { |
| 369 tab_strip_model_->AddObserver(this); | 370 tab_strip_model_->AddObserver(this); |
| 370 CheckTabCount(); | 371 CheckTabCount(); |
| 371 } | 372 } |
| 372 | 373 |
| 373 TabCountChangeObserver::~TabCountChangeObserver() { | 374 TabCountChangeObserver::~TabCountChangeObserver() { |
| 374 tab_strip_model_->RemoveObserver(this); | 375 tab_strip_model_->RemoveObserver(this); |
| 375 } | 376 } |
| 376 | 377 |
| 377 void TabCountChangeObserver::TabInsertedAt(TabContents* contents, | 378 void TabCountChangeObserver::TabInsertedAt(TabContentsWrapper* contents, |
| 378 int index, | 379 int index, |
| 379 bool foreground) { | 380 bool foreground) { |
| 380 CheckTabCount(); | 381 CheckTabCount(); |
| 381 } | 382 } |
| 382 | 383 |
| 383 void TabCountChangeObserver::TabDetachedAt(TabContents* contents, int index) { | 384 void TabCountChangeObserver::TabDetachedAt(TabContentsWrapper* contents, |
| 385 int index) { |
| 384 CheckTabCount(); | 386 CheckTabCount(); |
| 385 } | 387 } |
| 386 | 388 |
| 387 void TabCountChangeObserver::TabStripModelDeleted() { | 389 void TabCountChangeObserver::TabStripModelDeleted() { |
| 388 AutomationMsg_WaitForTabCountToBecome::WriteReplyParams(reply_message_, | 390 AutomationMsg_WaitForTabCountToBecome::WriteReplyParams(reply_message_, |
| 389 false); | 391 false); |
| 390 automation_->Send(reply_message_); | 392 automation_->Send(reply_message_); |
| 391 delete this; | 393 delete this; |
| 392 } | 394 } |
| 393 | 395 |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1437 this, &OnNotificationBalloonCountObserver::OnBalloonCollectionChanged)); | 1439 this, &OnNotificationBalloonCountObserver::OnBalloonCollectionChanged)); |
| 1438 } | 1440 } |
| 1439 | 1441 |
| 1440 void OnNotificationBalloonCountObserver::OnBalloonCollectionChanged() { | 1442 void OnNotificationBalloonCountObserver::OnBalloonCollectionChanged() { |
| 1441 if (static_cast<int>(collection_->GetActiveBalloons().size()) == count_) { | 1443 if (static_cast<int>(collection_->GetActiveBalloons().size()) == count_) { |
| 1442 collection_->set_on_collection_changed_callback(NULL); | 1444 collection_->set_on_collection_changed_callback(NULL); |
| 1443 reply_.SendSuccess(NULL); | 1445 reply_.SendSuccess(NULL); |
| 1444 delete this; | 1446 delete this; |
| 1445 } | 1447 } |
| 1446 } | 1448 } |
| OLD | NEW |