Chromium Code Reviews| Index: ios/web_view/internal/criwv_web_client.h |
| diff --git a/ios/web_view/internal/criwv_web_client.h b/ios/web_view/internal/criwv_web_client.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..55b35aa27df3bdc4f52162e3c8695a5565a2d795 |
| --- /dev/null |
| +++ b/ios/web_view/internal/criwv_web_client.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef IOS_WEB_VIEW_INTERNAL_CRIWV_WEB_CLIENT_H_ |
| +#define IOS_WEB_VIEW_INTERNAL_CRIWV_WEB_CLIENT_H_ |
| + |
| +#include <memory> |
| +#include "base/compiler_specific.h" |
| +#import "ios/web/public/web_client.h" |
| + |
| +@protocol CRIWVDelegate; |
| + |
| +namespace ios_web_view { |
| +class CRIWVBrowserState; |
| +class CRIWVWebMainParts; |
| + |
| +// CRIWV-specific implementation of WebClient. Delegates some functionality to |
| +// CRIWVDelegate. |
| +class CRIWVWebClient : public web::WebClient { |
| + public: |
| + explicit CRIWVWebClient(id<CRIWVDelegate> delegate); |
| + ~CRIWVWebClient() override; |
| + |
| + // WebClient implementation. |
| + web::WebMainParts* CreateWebMainParts() override; |
| + std::string GetProduct() const override; |
| + std::string GetUserAgent(bool desktop_user_agent) const override; |
| + |
| + // TODO(crbug.com/679895): Find a better way to get a BrowserState object to |
| + // AppDelegate. |
| + CRIWVBrowserState* browser_state() const; |
| + |
| + private: |
| + // This object's delegate. |
| + id<CRIWVDelegate> delegate_; |
| + |
| + // The WebMainParts created by |CreateWebMainParts()|. |
| + CRIWVWebMainParts* web_main_parts_; // weak |
|
sdefresne
2017/01/24 14:54:30
nit: remove "// weak" as it is (IMO) redundant. Al
michaeldo
2017/01/24 22:35:26
Done in dep CL.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(CRIWVWebClient); |
| +}; |
| + |
| +} // namespace ios_web_view |
| + |
| +#endif // IOS_WEB_VIEW_INTERNAL_CRIWV_WEB_CLIENT_H_ |