Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Unified Diff: chrome/browser/ui/views/constrained_window_views.h

Issue 11044020: Make Web Intents picker in Views conform to latest mocks (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/constrained_window_views.h
diff --git a/chrome/browser/ui/views/constrained_window_views.h b/chrome/browser/ui/views/constrained_window_views.h
index 97d5b6049c28080bead032b941a0d4f92e7537d6..fdd29117fc2e26374e3eaae8cc8278a527464fbf 100644
--- a/chrome/browser/ui/views/constrained_window_views.h
+++ b/chrome/browser/ui/views/constrained_window_views.h
@@ -7,6 +7,9 @@
#include "base/compiler_specific.h"
#include "chrome/browser/ui/constrained_window.h"
+#include "chrome/browser/ui/views/constrained_window_frame_simple.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/rect.h"
@@ -59,11 +62,19 @@ class NativeConstrainedWindow {
class ConstrainedWindowViews : public views::Widget,
public ConstrainedWindow,
public NativeConstrainedWindowDelegate,
- public content::WebContentsObserver {
+ public content::WebContentsObserver,
+ public content::NotificationObserver {
public:
+ // Types of insets to use with chrome style frame.
+ enum ChromeStyleClientInsets {
+ DEFAULT_INSETS,
+ NO_INSETS,
+ };
+
ConstrainedWindowViews(content::WebContents* web_contents,
views::WidgetDelegate* widget_delegate,
- bool enable_chrome_style);
+ bool enable_chrome_style,
+ ChromeStyleClientInsets chrome_style_client_insets);
virtual ~ConstrainedWindowViews();
// Returns the WebContents that constrains this Constrained Window.
@@ -78,6 +89,14 @@ class ConstrainedWindowViews : public views::Widget,
// Overridden from views::Widget:
void CenterWindow(const gfx::Size& size);
+ // Default insets for the dialog:
+ static gfx::Insets GetDefaultInsets();
+
+ // Returns the type of insets to use with chrome style frame.
+ ChromeStyleClientInsets chrome_style_client_insets() {
Peter Kasting 2012/10/16 17:28:59 Nit: const If the ConstrainedWindowFrameSimple is
please use gerrit instead 2012/10/16 19:12:37 Done.
+ return chrome_style_client_insets_;
+ }
+
private:
void NotifyTabHelperWillClose();
@@ -91,21 +110,31 @@ class ConstrainedWindowViews : public views::Widget,
AsNativeWidgetDelegate() OVERRIDE;
virtual int GetNonClientComponent(const gfx::Point& point) OVERRIDE;
- // Set the top of the window to overlap the browser chrome.
- void PositionChromeStyleWindow();
-
// Overridden from content::WebContentsObserver:
virtual void WebContentsDestroyed(content::WebContents* web_contents)
OVERRIDE;
- content::WebContents* web_contents_;
+ // Overridden from content::NotificationObserver:
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
- NativeConstrainedWindow* native_constrained_window_;
+ // Set the top of the window to overlap the browser chrome.
+ void PositionChromeStyleWindow(const gfx::Size& size);
+
+ content::NotificationRegistrar registrar_;
+ content::WebContents* web_contents_;
// TODO(wittman): remove once all constrained window dialogs are moved
// over to Chrome style.
const bool enable_chrome_style_;
+ // Client insets to use when |enable_chrome_style_| is true.
+ ChromeStyleClientInsets chrome_style_client_insets_;
+
+ NativeConstrainedWindow* native_constrained_window_;
+ ConstrainedWindowFrameSimple* chrome_style_frame_;
Peter Kasting 2012/10/16 17:28:59 Where is this used?
please use gerrit instead 2012/10/16 19:12:37 Removed unused member. Done.
+
DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowViews);
};

Powered by Google App Engine
This is Rietveld 408576698