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

Side by Side Diff: extensions/browser/guest_view/guest_view_base.h

Issue 1009193003: Make options zoom isolated, match embedder zoom on navigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't DCHECK embedder zoom controller existence. Created 5 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 // Note that a size can consist of a fractional number of logical pixels 320 // Note that a size can consist of a fractional number of logical pixels
321 // (hence the return value is represented as a double), but will always 321 // (hence the return value is represented as a double), but will always
322 // consist of an integral number of physical pixels (hence |physical_pixels| 322 // consist of an integral number of physical pixels (hence |physical_pixels|
323 // is represented as an int). 323 // is represented as an int).
324 double PhysicalPixelsToLogicalPixels(int physical_pixels); 324 double PhysicalPixelsToLogicalPixels(int physical_pixels);
325 325
326 // WebContentsObserver implementation. 326 // WebContentsObserver implementation.
327 void DidStopLoading() final; 327 void DidStopLoading() final;
328 void RenderViewReady() final; 328 void RenderViewReady() final;
329 void WebContentsDestroyed() final; 329 void WebContentsDestroyed() final;
330 void DidNavigateMainFrame(
331 const content::LoadCommittedDetails& details,
332 const content::FrameNavigateParams& params) override;
330 333
331 // WebContentsDelegate implementation. 334 // WebContentsDelegate implementation.
332 void ActivateContents(content::WebContents* contents) final; 335 void ActivateContents(content::WebContents* contents) final;
333 void DeactivateContents(content::WebContents* contents) final; 336 void DeactivateContents(content::WebContents* contents) final;
334 void ContentsMouseEvent(content::WebContents* source, 337 void ContentsMouseEvent(content::WebContents* source,
335 const gfx::Point& location, 338 const gfx::Point& location,
336 bool motion) override; 339 bool motion) override;
337 void ContentsZoomChange(bool zoom_in) override; 340 void ContentsZoomChange(bool zoom_in) override;
338 void HandleKeyboardEvent( 341 void HandleKeyboardEvent(
339 content::WebContents* source, 342 content::WebContents* source,
340 const content::NativeWebKeyboardEvent& event) override; 343 const content::NativeWebKeyboardEvent& event) override;
341 void LoadingStateChanged(content::WebContents* source, 344 void LoadingStateChanged(content::WebContents* source,
342 bool to_different_document) final; 345 bool to_different_document) final;
343 content::ColorChooser* OpenColorChooser( 346 content::ColorChooser* OpenColorChooser(
344 content::WebContents* web_contents, 347 content::WebContents* web_contents,
345 SkColor color, 348 SkColor color,
346 const std::vector<content::ColorSuggestion>& suggestions) override; 349 const std::vector<content::ColorSuggestion>& suggestions) override;
347 void RunFileChooser(content::WebContents* web_contents, 350 void RunFileChooser(content::WebContents* web_contents,
348 const content::FileChooserParams& params) override; 351 const content::FileChooserParams& params) override;
349 bool ShouldFocusPageAfterCrash() final; 352 bool ShouldFocusPageAfterCrash() final;
350 bool PreHandleGestureEvent(content::WebContents* source, 353 bool PreHandleGestureEvent(content::WebContents* source,
351 const blink::WebGestureEvent& event) override; 354 const blink::WebGestureEvent& event) override;
352 void UpdatePreferredSize(content::WebContents* web_contents, 355 void UpdatePreferredSize(content::WebContents* web_contents,
353 const gfx::Size& pref_size) final; 356 const gfx::Size& pref_size) final;
354 void UpdateTargetURL(content::WebContents* source, const GURL& url) override; 357 void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
355 358
359 void SetGuestZoomLevelToMatchEmbedder();
360
356 private: 361 private:
357 class OwnerContentsObserver; 362 class OwnerContentsObserver;
358 363
359 class OpenerLifetimeObserver; 364 class OpenerLifetimeObserver;
360 365
361 void DispatchEvent(Event* event, int instance_id); 366 void DispatchEvent(Event* event, int instance_id);
362 367
363 void SendQueuedEvents(); 368 void SendQueuedEvents();
364 369
365 void CompleteInit(scoped_ptr<base::DictionaryValue> create_params, 370 void CompleteInit(scoped_ptr<base::DictionaryValue> create_params,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 // This is used to ensure pending tasks will not fire after this object is 460 // This is used to ensure pending tasks will not fire after this object is
456 // destroyed. 461 // destroyed.
457 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; 462 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_;
458 463
459 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); 464 DISALLOW_COPY_AND_ASSIGN(GuestViewBase);
460 }; 465 };
461 466
462 } // namespace extensions 467 } // namespace extensions
463 468
464 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_ 469 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_GUEST_VIEW_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698