Home | History | Annotate | Download | only in browser
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_DISPATCHER_HOST_H_
      6 #define CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_DISPATCHER_HOST_H_
      7 
      8 #include "content/common/content_export.h"
      9 #include "third_party/WebKit/public/platform/WebLockOrientationError.h"
     10 
     11 namespace content {
     12 
     13 // ScreenOrientationDispatcherHost receives lock and unlock requests from the
     14 // RenderFrames and dispatch them to the ScreenOrientationProvider. It also
     15 // make sure that the right RenderFrame get replied for each lock request.
     16 class CONTENT_EXPORT ScreenOrientationDispatcherHost {
     17  public:
     18   virtual ~ScreenOrientationDispatcherHost() {}
     19 
     20   // Notifies that the lock with the given |request_id| has succeeded.
     21   // The renderer process will be notified that the lock succeeded only if
     22   // |request_id| matches the current lock information.
     23   virtual void NotifyLockSuccess(int request_id) = 0;
     24 
     25   // Notifies that the lock with the given |request_id| has failed.
     26   // The renderer process will be notified that the lock succeeded only if
     27   // |request_id| matches the current lock information.
     28   virtual void NotifyLockError(int request_id,
     29                                blink::WebLockOrientationError error) = 0;
     30 
     31   virtual void OnOrientationChange() = 0;
     32 };
     33 
     34 }  // namespace content
     35 
     36 #endif // CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_DISPATCHER_HOST_H_
     37