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

Side by Side Diff: chrome/browser/ui/views/screen_capture_notification_ui_views.cc

Issue 2595163002: Add origin() method on View and use it to simplify some callers. (Closed)
Patch Set: Resync Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/ui/screen_capture_notification_ui.h" 5 #include "chrome/browser/ui/screen_capture_notification_ui.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/ui/views/chrome_views_export.h" 9 #include "chrome/browser/ui/views/chrome_views_export.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 ~NotificationBarClientView() override {} 56 ~NotificationBarClientView() override {}
57 57
58 void set_client_rect(const gfx::Rect& rect) { rect_ = rect; } 58 void set_client_rect(const gfx::Rect& rect) { rect_ = rect; }
59 59
60 // views::ClientView overrides. 60 // views::ClientView overrides.
61 int NonClientHitTest(const gfx::Point& point) override { 61 int NonClientHitTest(const gfx::Point& point) override {
62 if (!bounds().Contains(point)) 62 if (!bounds().Contains(point))
63 return HTNOWHERE; 63 return HTNOWHERE;
64 // The whole window is HTCAPTION, except the |rect_|. 64 // The whole window is HTCAPTION, except the |rect_|.
65 if (rect_.Contains(gfx::PointAtOffsetFromOrigin(point - bounds().origin()))) 65 if (rect_.Contains(gfx::PointAtOffsetFromOrigin(point - origin())))
66 return HTCLIENT; 66 return HTCLIENT;
67 67
68 return HTCAPTION; 68 return HTCAPTION;
69 } 69 }
70 70
71 private: 71 private:
72 gfx::Rect rect_; 72 gfx::Rect rect_;
73 73
74 DISALLOW_COPY_AND_ASSIGN(NotificationBarClientView); 74 DISALLOW_COPY_AND_ASSIGN(NotificationBarClientView);
75 }; 75 };
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 324 }
325 } 325 }
326 326
327 } // namespace 327 } // namespace
328 328
329 std::unique_ptr<ScreenCaptureNotificationUI> 329 std::unique_ptr<ScreenCaptureNotificationUI>
330 ScreenCaptureNotificationUI::Create(const base::string16& text) { 330 ScreenCaptureNotificationUI::Create(const base::string16& text) {
331 return std::unique_ptr<ScreenCaptureNotificationUI>( 331 return std::unique_ptr<ScreenCaptureNotificationUI>(
332 new ScreenCaptureNotificationUIViews(text)); 332 new ScreenCaptureNotificationUIViews(text));
333 } 333 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698