 Chromium Code Reviews
 Chromium Code Reviews Issue 14651029:
  content: Remove usage of NOTIFICATION_WEB_CONTENTS_DESTROYED from content  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 14651029:
  content: Remove usage of NOTIFICATION_WEB_CONTENTS_DESTROYED from content  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| 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 #ifndef CONTENT_SHELL_SHELL_H_ | 4 #ifndef CONTENT_SHELL_SHELL_H_ | 
| 5 #define CONTENT_SHELL_SHELL_H_ | 5 #define CONTENT_SHELL_SHELL_H_ | 
| 6 | 6 | 
| 7 | 7 | 
| 8 #include <vector> | 8 #include <vector> | 
| 9 | 9 | 
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" | 
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" | 
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" | 
| 13 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" | 
| 14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" | 
| 15 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" | 
| 16 #include "content/public/browser/web_contents_delegate.h" | 16 #include "content/public/browser/web_contents_delegate.h" | 
| 17 #include "content/public/browser/web_contents_observer.h" | |
| 17 #include "ipc/ipc_channel.h" | 18 #include "ipc/ipc_channel.h" | 
| 18 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" | 
| 19 #include "ui/gfx/size.h" | 20 #include "ui/gfx/size.h" | 
| 20 | 21 | 
| 21 #if defined(TOOLKIT_GTK) | 22 #if defined(TOOLKIT_GTK) | 
| 22 #include <gtk/gtk.h> | 23 #include <gtk/gtk.h> | 
| 23 #include "ui/base/gtk/gtk_signal.h" | 24 #include "ui/base/gtk/gtk_signal.h" | 
| 24 | 25 | 
| 25 typedef struct _GtkToolItem GtkToolItem; | 26 typedef struct _GtkToolItem GtkToolItem; | 
| 26 #elif defined(OS_ANDROID) | 27 #elif defined(OS_ANDROID) | 
| (...skipping 15 matching lines...) Expand all Loading... | |
| 42 | 43 | 
| 43 class BrowserContext; | 44 class BrowserContext; | 
| 44 class ShellDevToolsFrontend; | 45 class ShellDevToolsFrontend; | 
| 45 class ShellJavaScriptDialogManager; | 46 class ShellJavaScriptDialogManager; | 
| 46 class SiteInstance; | 47 class SiteInstance; | 
| 47 class WebContents; | 48 class WebContents; | 
| 48 | 49 | 
| 49 // This represents one window of the Content Shell, i.e. all the UI including | 50 // This represents one window of the Content Shell, i.e. all the UI including | 
| 50 // buttons and url bar, as well as the web content area. | 51 // buttons and url bar, as well as the web content area. | 
| 51 class Shell : public WebContentsDelegate, | 52 class Shell : public WebContentsDelegate, | 
| 53 public WebContentsObserver, | |
| 
jochen (gone - plz use gerrit)
2013/05/10 19:53:33
Shell shouldn't be a WebContentsObserver. Can you
 
Avi (use Gerrit)
2013/05/10 20:26:44
What's your reasoning here?
 
Paweł Hajdan Jr.
2013/05/13 20:15:31
Done.
 
Avi (use Gerrit)
2013/05/15 19:22:19
Jochen: I will again ask why. Shell needs to obser
 
jochen (gone - plz use gerrit)
2013/05/21 12:09:44
As I said, I don't remember the discussion we had
 | |
| 52 public NotificationObserver { | 54 public NotificationObserver { | 
| 53 public: | 55 public: | 
| 54 virtual ~Shell(); | 56 virtual ~Shell(); | 
| 55 | 57 | 
| 56 void LoadURL(const GURL& url); | 58 void LoadURL(const GURL& url); | 
| 57 void LoadURLForFrame(const GURL& url, const std::string& frame_name); | 59 void LoadURLForFrame(const GURL& url, const std::string& frame_name); | 
| 58 void GoBackOrForward(int offset); | 60 void GoBackOrForward(int offset); | 
| 59 void Reload(); | 61 void Reload(); | 
| 60 void Stop(); | 62 void Stop(); | 
| 61 void UpdateNavigationControls(); | 63 void UpdateNavigationControls(); | 
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 #endif | 138 #endif | 
| 137 virtual bool AddMessageToConsole(WebContents* source, | 139 virtual bool AddMessageToConsole(WebContents* source, | 
| 138 int32 level, | 140 int32 level, | 
| 139 const string16& message, | 141 const string16& message, | 
| 140 int32 line_no, | 142 int32 line_no, | 
| 141 const string16& source_id) OVERRIDE; | 143 const string16& source_id) OVERRIDE; | 
| 142 virtual void RendererUnresponsive(WebContents* source) OVERRIDE; | 144 virtual void RendererUnresponsive(WebContents* source) OVERRIDE; | 
| 143 virtual void ActivateContents(WebContents* contents) OVERRIDE; | 145 virtual void ActivateContents(WebContents* contents) OVERRIDE; | 
| 144 virtual void DeactivateContents(WebContents* contents) OVERRIDE; | 146 virtual void DeactivateContents(WebContents* contents) OVERRIDE; | 
| 145 | 147 | 
| 148 // WebContentsObserver | |
| 149 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; | |
| 150 | |
| 146 private: | 151 private: | 
| 147 enum UIControl { | 152 enum UIControl { | 
| 148 BACK_BUTTON, | 153 BACK_BUTTON, | 
| 149 FORWARD_BUTTON, | 154 FORWARD_BUTTON, | 
| 150 STOP_BUTTON | 155 STOP_BUTTON | 
| 151 }; | 156 }; | 
| 152 | 157 | 
| 153 explicit Shell(WebContents* web_contents); | 158 explicit Shell(WebContents* web_contents); | 
| 154 | 159 | 
| 155 // Helper to create a new Shell given a newly created WebContents. | 160 // Helper to create a new Shell given a newly created WebContents. | 
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 static base::Callback<void(Shell*)> shell_created_callback_; | 266 static base::Callback<void(Shell*)> shell_created_callback_; | 
| 262 | 267 | 
| 263 // True if the destructur of Shell should post a quit closure on the current | 268 // True if the destructur of Shell should post a quit closure on the current | 
| 264 // message loop if the destructed Shell object was the last one. | 269 // message loop if the destructed Shell object was the last one. | 
| 265 static bool quit_message_loop_; | 270 static bool quit_message_loop_; | 
| 266 }; | 271 }; | 
| 267 | 272 | 
| 268 } // namespace content | 273 } // namespace content | 
| 269 | 274 | 
| 270 #endif // CONTENT_SHELL_SHELL_H_ | 275 #endif // CONTENT_SHELL_SHELL_H_ | 
| OLD | NEW |