| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "content/common/mouse_lock.h" |
| 15 #include "content/public/browser/navigation_type.h" | 16 #include "content/public/browser/navigation_type.h" |
| 16 #include "content/public/common/page_transition_types.h" | 17 #include "content/public/common/page_transition_types.h" |
| 17 #include "content/public/common/window_container_type.h" | 18 #include "content/public/common/window_container_type.h" |
| 18 #include "third_party/skia/include/core/SkColor.h" | 19 #include "third_party/skia/include/core/SkColor.h" |
| 19 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
| 20 #include "webkit/glue/window_open_disposition.h" | 21 #include "webkit/glue/window_open_disposition.h" |
| 21 | 22 |
| 22 class FilePath; | 23 class FilePath; |
| 23 class GURL; | 24 class GURL; |
| 24 class WebContentsImpl; | 25 class WebContentsImpl; |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 // Notification message from HTML UI. | 386 // Notification message from HTML UI. |
| 386 virtual void WebUISend(WebContents* web_contents, | 387 virtual void WebUISend(WebContents* web_contents, |
| 387 const GURL& source_url, | 388 const GURL& source_url, |
| 388 const std::string& name, | 389 const std::string& name, |
| 389 const base::ListValue& args) {} | 390 const base::ListValue& args) {} |
| 390 | 391 |
| 391 // Requests to lock the mouse. Once the request is approved or rejected, | 392 // Requests to lock the mouse. Once the request is approved or rejected, |
| 392 // GotResponseToLockMouseRequest() will be called on the requesting tab | 393 // GotResponseToLockMouseRequest() will be called on the requesting tab |
| 393 // contents. | 394 // contents. |
| 394 virtual void RequestToLockMouse(WebContents* web_contents, | 395 virtual void RequestToLockMouse(WebContents* web_contents, |
| 395 bool user_gesture) {} | 396 MouseLockSource lock_source, |
| 397 MouseUnlockSource previous_unlock_source) { |
| 398 } |
| 396 | 399 |
| 397 // Notification that the page has lost the mouse lock. | 400 // Notification that the page has lost the mouse lock. |
| 398 virtual void LostMouseLock() {} | 401 virtual void LostMouseLock() {} |
| 399 | 402 |
| 400 protected: | 403 protected: |
| 401 virtual ~WebContentsDelegate(); | 404 virtual ~WebContentsDelegate(); |
| 402 | 405 |
| 403 private: | 406 private: |
| 404 friend class ::WebContentsImpl; | 407 friend class ::WebContentsImpl; |
| 405 | 408 |
| 406 // Called when |this| becomes the WebContentsDelegate for |source|. | 409 // Called when |this| becomes the WebContentsDelegate for |source|. |
| 407 void Attach(WebContents* source); | 410 void Attach(WebContents* source); |
| 408 | 411 |
| 409 // Called when |this| is no longer the WebContentsDelegate for |source|. | 412 // Called when |this| is no longer the WebContentsDelegate for |source|. |
| 410 void Detach(WebContents* source); | 413 void Detach(WebContents* source); |
| 411 | 414 |
| 412 // The WebContents that this is currently a delegate for. | 415 // The WebContents that this is currently a delegate for. |
| 413 std::set<WebContents*> attached_contents_; | 416 std::set<WebContents*> attached_contents_; |
| 414 }; | 417 }; |
| 415 | 418 |
| 416 } // namespace content | 419 } // namespace content |
| 417 | 420 |
| 418 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 421 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| OLD | NEW |