Chromium Code Reviews| Index: chrome/browser/ui/android/tab_model/android_live_tab_context.h |
| diff --git a/chrome/browser/ui/browser_live_tab_context.h b/chrome/browser/ui/android/tab_model/android_live_tab_context.h |
| similarity index 57% |
| copy from chrome/browser/ui/browser_live_tab_context.h |
| copy to chrome/browser/ui/android/tab_model/android_live_tab_context.h |
| index c92b4e0d3a96c96becb986ecdfd9ba911b7d21bb..85e3402da055c61e01ee7741bd9cfdcff31edbdc 100644 |
| --- a/chrome/browser/ui/browser_live_tab_context.h |
| +++ b/chrome/browser/ui/android/tab_model/android_live_tab_context.h |
| @@ -1,9 +1,9 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
|
sky
2016/06/28 19:13:37
nit: no (c) (see style guide).
|
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_BROWSER_UI_BROWSER_LIVE_TAB_CONTEXT_H_ |
| -#define CHROME_BROWSER_UI_BROWSER_LIVE_TAB_CONTEXT_H_ |
| +#ifndef CHROME_BROWSER_UI_ANDROID_TAB_MODEL_ANDROID_LIVE_TAB_CONTEXT_H_ |
| +#define CHROME_BROWSER_UI_ANDROID_TAB_MODEL_ANDROID_LIVE_TAB_CONTEXT_H_ |
| #include <string> |
| #include <vector> |
| @@ -12,19 +12,20 @@ |
| #include "base/macros.h" |
| #include "components/sessions/core/live_tab_context.h" |
| -class Browser; |
| -class Profile; |
| - |
| namespace content { |
| class WebContents; |
| } |
| -// Implementation of LiveTabContext which uses an instance of |
| -// Browser in order to fulfil its duties. |
| -class BrowserLiveTabContext : public sessions::LiveTabContext { |
| +class TabModel; |
| + |
| +// Implementation of LiveTabContext which used by android. |
| +// Serve as adapter to LiveTabContext. |
| +class AndroidLiveTabContext : public sessions::LiveTabContext { |
| public: |
| - explicit BrowserLiveTabContext(Browser* browser) : browser_(browser) {} |
| - ~BrowserLiveTabContext() override {} |
| + explicit AndroidLiveTabContext(TabModel* tab_model) |
| + : tab_model_(tab_model) { |
|
sky
2016/06/28 19:13:37
Don't inline constructor/destructor (see style gui
|
| + } |
| + ~AndroidLiveTabContext() override {} |
| // Overridden from LiveTabContext: |
| void ShowBrowserWindow() override; |
| @@ -54,25 +55,12 @@ class BrowserLiveTabContext : public sessions::LiveTabContext { |
| const std::string& user_agent_override) override; |
| void CloseTab() override; |
| - // see Browser::Create |
| - static sessions::LiveTabContext* Create( |
| - Profile* profile, |
| - const std::string& app_name); |
| - |
| - // see browser::FindBrowserForWebContents |
| - static sessions::LiveTabContext* FindContextForWebContents( |
| - const content::WebContents* contents); |
| - |
| - // see chrome::FindBrowserWithID |
| - // Returns the LiveTabContext of the Browser with |desired_id| if |
| - // such a Browser exists. |
| - static sessions::LiveTabContext* FindContextWithID( |
| - SessionID::id_type desired_id); |
| - |
| + static LiveTabContext* FindContextForWebContents(const |
| + content::WebContents* contents); |
| private: |
| - Browser* browser_; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(BrowserLiveTabContext); |
| + TabModel* tab_model_; |
| + DISALLOW_COPY_AND_ASSIGN(AndroidLiveTabContext); |
| }; |
| -#endif // CHROME_BROWSER_UI_BROWSER_LIVE_TAB_CONTEXT_H_ |
| + |
| +#endif // CHROME_BROWSER_UI_ANDROID_TAB_MODEL_ANDROID_LIVE_TAB_CONTEXT_H_ |