| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/ui/browser_list_observer.h" | 9 #include "chrome/browser/ui/browser_list_observer.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class WebContents; | 14 class WebContents; |
| 15 } | 15 } |
| 16 | 16 |
| 17 class Browser; | 17 class Browser; |
| 18 class HandoffActiveURLObserverDelegate; | 18 class HandoffActiveURLObserverDelegate; |
| 19 class TabStripModel; | |
| 20 | 19 |
| 21 // This class observes changes to the "active URL". This is defined as the | 20 // This class observes changes to the "active URL". This is defined as the |
| 22 // visible URL of the WebContents of the selected tab of the most recently | 21 // visible URL of the WebContents of the selected tab of the most recently |
| 23 // focused browser window. | 22 // focused browser window. |
| 24 class HandoffActiveURLObserver : public chrome::BrowserListObserver, | 23 class HandoffActiveURLObserver : public chrome::BrowserListObserver, |
| 25 public TabStripModelObserver, | 24 public TabStripModelObserver, |
| 26 public content::WebContentsObserver { | 25 public content::WebContentsObserver { |
| 27 public: | 26 public: |
| 28 explicit HandoffActiveURLObserver(HandoffActiveURLObserverDelegate* delegate); | 27 explicit HandoffActiveURLObserver(HandoffActiveURLObserverDelegate* delegate); |
| 29 ~HandoffActiveURLObserver() override; | 28 ~HandoffActiveURLObserver() override; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 HandoffActiveURLObserverDelegate* delegate_; | 60 HandoffActiveURLObserverDelegate* delegate_; |
| 62 | 61 |
| 63 // This pointer is always up to date, and points to the most recently | 62 // This pointer is always up to date, and points to the most recently |
| 64 // activated browser, or nullptr if no browsers exist. | 63 // activated browser, or nullptr if no browsers exist. |
| 65 Browser* active_browser_; | 64 Browser* active_browser_; |
| 66 | 65 |
| 67 DISALLOW_COPY_AND_ASSIGN(HandoffActiveURLObserver); | 66 DISALLOW_COPY_AND_ASSIGN(HandoffActiveURLObserver); |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 #endif // CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_H_ | 69 #endif // CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_H_ |
| OLD | NEW |