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_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
7 | 7 |
8 #include "base/process/kill.h" | 8 #include "base/process/kill.h" |
9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 const std::vector<AXEventNotificationDetails>& details) {} | 316 const std::vector<AXEventNotificationDetails>& details) {} |
317 | 317 |
318 // Invoked when theme color is changed to |theme_color|. | 318 // Invoked when theme color is changed to |theme_color|. |
319 virtual void DidChangeThemeColor(SkColor theme_color) {} | 319 virtual void DidChangeThemeColor(SkColor theme_color) {} |
320 | 320 |
321 // Invoked if an IPC message is coming from a specific RenderFrameHost. | 321 // Invoked if an IPC message is coming from a specific RenderFrameHost. |
322 virtual bool OnMessageReceived(const IPC::Message& message, | 322 virtual bool OnMessageReceived(const IPC::Message& message, |
323 RenderFrameHost* render_frame_host); | 323 RenderFrameHost* render_frame_host); |
324 | 324 |
325 // IPC::Listener implementation. | 325 // IPC::Listener implementation. |
326 virtual bool OnMessageReceived(const IPC::Message& message) override; | 326 bool OnMessageReceived(const IPC::Message& message) override; |
327 | 327 |
328 // IPC::Sender implementation. | 328 // IPC::Sender implementation. |
329 virtual bool Send(IPC::Message* message) override; | 329 bool Send(IPC::Message* message) override; |
330 int routing_id() const; | 330 int routing_id() const; |
331 | 331 |
332 WebContents* web_contents() const; | 332 WebContents* web_contents() const; |
333 | 333 |
334 protected: | 334 protected: |
335 // Use this constructor when the object is tied to a single WebContents for | 335 // Use this constructor when the object is tied to a single WebContents for |
336 // its entire lifetime. | 336 // its entire lifetime. |
337 explicit WebContentsObserver(WebContents* web_contents); | 337 explicit WebContentsObserver(WebContents* web_contents); |
338 | 338 |
339 // Use this constructor when the object wants to observe a WebContents for | 339 // Use this constructor when the object wants to observe a WebContents for |
340 // part of its lifetime. It can then call Observe() to start and stop | 340 // part of its lifetime. It can then call Observe() to start and stop |
341 // observing. | 341 // observing. |
342 WebContentsObserver(); | 342 WebContentsObserver(); |
343 | 343 |
344 virtual ~WebContentsObserver(); | 344 ~WebContentsObserver() override; |
345 | 345 |
346 // Start observing a different WebContents; used with the default constructor. | 346 // Start observing a different WebContents; used with the default constructor. |
347 void Observe(WebContents* web_contents); | 347 void Observe(WebContents* web_contents); |
348 | 348 |
349 private: | 349 private: |
350 friend class WebContentsImpl; | 350 friend class WebContentsImpl; |
351 | 351 |
352 void ResetWebContents(); | 352 void ResetWebContents(); |
353 | 353 |
354 WebContentsImpl* web_contents_; | 354 WebContentsImpl* web_contents_; |
355 | 355 |
356 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 356 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
357 }; | 357 }; |
358 | 358 |
359 } // namespace content | 359 } // namespace content |
360 | 360 |
361 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 361 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |