| Index: mojo/examples/media_viewer/media_viewer.cc
|
| diff --git a/mojo/examples/media_viewer/media_viewer.cc b/mojo/examples/media_viewer/media_viewer.cc
|
| index 2ba8a21712ca6ac2611b07a574426d8e603fc651..c5de1c2e8af8887f1ef0d3a172f549c2ca236ead 100644
|
| --- a/mojo/examples/media_viewer/media_viewer.cc
|
| +++ b/mojo/examples/media_viewer/media_viewer.cc
|
| @@ -186,23 +186,6 @@ class ControlPanel : public views::ButtonListener {
|
| DISALLOW_COPY_AND_ASSIGN(ControlPanel);
|
| };
|
|
|
| -class NavigatorImpl : public InterfaceImpl<Navigator> {
|
| - public:
|
| - explicit NavigatorImpl(MediaViewer* viewer) : viewer_(viewer) {}
|
| - virtual ~NavigatorImpl() {}
|
| -
|
| - private:
|
| - // Overridden from Navigator:
|
| - virtual void Navigate(
|
| - uint32_t view_id,
|
| - NavigationDetailsPtr navigation_details,
|
| - ResponseDetailsPtr response_details) OVERRIDE;
|
| -
|
| - MediaViewer* viewer_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(NavigatorImpl);
|
| -};
|
| -
|
| class MediaViewer
|
| : public ApplicationDelegate,
|
| public ViewManagerDelegate,
|
| @@ -210,8 +193,7 @@ class MediaViewer
|
| public ViewObserver {
|
| public:
|
| MediaViewer()
|
| - : navigator_factory_(this),
|
| - app_(NULL),
|
| + : app_(NULL),
|
| view_manager_(NULL),
|
| root_view_(NULL),
|
| control_view_(NULL),
|
| @@ -225,39 +207,6 @@ class MediaViewer
|
| root_view_->RemoveObserver(this);
|
| }
|
|
|
| - void Navigate(
|
| - uint32_t view_id,
|
| - NavigationDetailsPtr navigation_details,
|
| - ResponseDetailsPtr response_details) {
|
| - // TODO(yzshen): This shouldn't be needed once FIFO is ready.
|
| - if (!view_manager_) {
|
| - pending_navigate_request_.reset(new PendingNavigateRequest);
|
| - pending_navigate_request_->view_id = view_id;
|
| - pending_navigate_request_->navigation_details = navigation_details.Pass();
|
| - pending_navigate_request_->response_details = response_details.Pass();
|
| -
|
| - return;
|
| - }
|
| -
|
| - std::string handler = GetHandlerForContentType(
|
| - response_details->response->mime_type);
|
| - if (handler.empty())
|
| - return;
|
| -
|
| - content_view_->Embed(handler);
|
| -
|
| - if (navigation_details) {
|
| - NavigatorPtr navigator;
|
| - app_->ConnectToService(handler, &navigator);
|
| - navigator->Navigate(content_view_->id(), navigation_details.Pass(),
|
| - response_details.Pass());
|
| - }
|
| -
|
| - // TODO(yzshen): determine the set of controls to show based on what
|
| - // interfaces the embedded app provides.
|
| - app_->ConnectToService(handler, &zoomable_media_);
|
| - }
|
| -
|
| private:
|
| typedef std::map<std::string, std::string> HandlerMap;
|
|
|
| @@ -278,7 +227,6 @@ class MediaViewer
|
|
|
| virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
|
| OVERRIDE {
|
| - connection->AddService(&navigator_factory_);
|
| connection->AddService(view_manager_client_factory_.get());
|
| return true;
|
| }
|
| @@ -311,14 +259,9 @@ class MediaViewer
|
| LayoutViews();
|
| root_view_->AddObserver(this);
|
|
|
| - if (pending_navigate_request_) {
|
| - scoped_ptr<PendingNavigateRequest> request(
|
| - pending_navigate_request_.release());
|
| -
|
| - Navigate(request->view_id, request->navigation_details.Pass(),
|
| - request->response_details.Pass());
|
| - }
|
| + content_view_->Embed("TODO");
|
| }
|
| +
|
| virtual void OnViewManagerDisconnected(
|
| ViewManager* view_manager) OVERRIDE {
|
| DCHECK_EQ(view_manager_, view_manager);
|
| @@ -360,8 +303,6 @@ class MediaViewer
|
| return it != handler_map_.end() ? it->second : std::string();
|
| }
|
|
|
| - InterfaceFactoryImplWithContext<NavigatorImpl, MediaViewer>
|
| - navigator_factory_;
|
| scoped_ptr<ViewManagerClientFactory> view_manager_client_factory_;
|
|
|
| ApplicationImpl* app_;
|
| @@ -373,19 +314,10 @@ class MediaViewer
|
| ControlPanel control_panel_;
|
| ZoomableMediaPtr zoomable_media_;
|
| HandlerMap handler_map_;
|
| - scoped_ptr<PendingNavigateRequest> pending_navigate_request_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(MediaViewer);
|
| };
|
|
|
| -void NavigatorImpl::Navigate(
|
| - uint32_t view_id,
|
| - NavigationDetailsPtr navigation_details,
|
| - ResponseDetailsPtr response_details) {
|
| - viewer_->Navigate(view_id, navigation_details.Pass(),
|
| - response_details.Pass());
|
| -}
|
| -
|
| } // namespace examples
|
| } // namespace mojo
|
|
|
|
|