| OLD | NEW |
| 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/snapshot_tab_helper.h" | 5 #include "chrome/browser/ui/snapshot_tab_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 7 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 8 #include "chrome/common/chrome_notification_types.h" | 8 #include "chrome/common/chrome_notification_types.h" |
| 9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
| 10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
| 11 | 11 |
| 12 SnapshotTabHelper::SnapshotTabHelper(TabContentsWrapper* wrapper) | 12 SnapshotTabHelper::SnapshotTabHelper(TabContentsWrapper* wrapper) |
| 13 : TabContentsObserver(wrapper->tab_contents()) { | 13 : TabContentsObserver(wrapper->tab_contents()), |
| 14 wrapper_(wrapper) { |
| 14 } | 15 } |
| 15 | 16 |
| 16 SnapshotTabHelper::~SnapshotTabHelper() { | 17 SnapshotTabHelper::~SnapshotTabHelper() { |
| 17 } | 18 } |
| 18 | 19 |
| 19 void SnapshotTabHelper::CaptureSnapshot() { | 20 void SnapshotTabHelper::CaptureSnapshot() { |
| 20 Send(new ChromeViewMsg_CaptureSnapshot(routing_id())); | 21 Send(new ChromeViewMsg_CaptureSnapshot(routing_id())); |
| 21 } | 22 } |
| 22 | 23 |
| 23 //////////////////////////////////////////////////////////////////////////////// | 24 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 10 matching lines...) Expand all Loading... |
| 34 | 35 |
| 35 //////////////////////////////////////////////////////////////////////////////// | 36 //////////////////////////////////////////////////////////////////////////////// |
| 36 // Internal helpers | 37 // Internal helpers |
| 37 | 38 |
| 38 void SnapshotTabHelper::OnSnapshot(const SkBitmap& bitmap) { | 39 void SnapshotTabHelper::OnSnapshot(const SkBitmap& bitmap) { |
| 39 content::NotificationService::current()->Notify( | 40 content::NotificationService::current()->Notify( |
| 40 chrome::NOTIFICATION_TAB_SNAPSHOT_TAKEN, | 41 chrome::NOTIFICATION_TAB_SNAPSHOT_TAKEN, |
| 41 content::Source<TabContentsWrapper>(wrapper_), | 42 content::Source<TabContentsWrapper>(wrapper_), |
| 42 content::Details<const SkBitmap>(&bitmap)); | 43 content::Details<const SkBitmap>(&bitmap)); |
| 43 } | 44 } |
| OLD | NEW |